You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by le...@locus.apache.org on 2000/02/05 03:25:23 UTC
cvs commit: xml-xerces/java/src/org/apache/html/dom HTMLBuilder.java HTMLCollectionImpl.java HTMLDOMImplementationImpl.java HTMLDocumentImpl.java HTMLTableElementImpl.java
lehors 00/02/04 18:25:23
Modified: java/src/org/apache/html/dom HTMLBuilder.java
HTMLCollectionImpl.java
HTMLDOMImplementationImpl.java
HTMLDocumentImpl.java HTMLTableElementImpl.java
Log:
changed exception messages for NLS
Revision Changes Path
1.2 +11 -11 xml-xerces/java/src/org/apache/html/dom/HTMLBuilder.java
Index: HTMLBuilder.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/html/dom/HTMLBuilder.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- HTMLBuilder.java 1999/12/14 21:27:04 1.1
+++ HTMLBuilder.java 2000/02/05 02:25:22 1.2
@@ -16,7 +16,7 @@
* for working with the OpenXML HTML parser.
*
*
- * @version $Revision: 1.1 $ $Date: 1999/12/14 21:27:04 $
+ * @version $Revision: 1.2 $ $Date: 2000/02/05 02:25:22 $
* @author <a href="mailto:arkin@openxml.org">Assaf Arkin</a>
*/
public class HTMLBuilder
@@ -71,7 +71,7 @@
throws SAXException
{
if ( ! _done )
- throw new SAXException( "State error: startDocument fired twice on one builder." );
+ throw new SAXException( "HTM001 State error: startDocument fired twice on one builder." );
_document = null;
_done = false;
}
@@ -81,9 +81,9 @@
throws SAXException
{
if ( _document == null )
- throw new SAXException( "State error: document never started or missing document element." );
+ throw new SAXException( "HTM002 State error: document never started or missing document element." );
if ( _current != null )
- throw new SAXException( "State error: document ended before end of document element." );
+ throw new SAXException( "HTM003 State error: document ended before end of document element." );
_current = null;
_done = true;
}
@@ -96,7 +96,7 @@
int i;
if ( tagName == null )
- throw new SAXException( "Argument 'tagName' is null." );
+ throw new SAXException( "HTM004 Argument 'tagName' is null." );
// If this is the root element, this is the time to create a new document,
// because only know we know the document element name and namespace URI.
@@ -107,7 +107,7 @@
elem = (ElementImpl) _document.getDocumentElement();
_current = elem;
if ( _current == null )
- throw new SAXException( "State error: Document.getDocumentElement returns null." );
+ throw new SAXException( "HTM005 State error: Document.getDocumentElement returns null." );
// Insert nodes (comment and PI) that appear before the root element.
if ( _preRootNodes != null )
@@ -123,7 +123,7 @@
// This is a state error, indicates that document has been parsed in full,
// or that there are two root elements.
if ( _current == null )
- throw new SAXException( "State error: startElement called after end of document element." );
+ throw new SAXException( "HTM006 State error: startElement called after end of document element." );
elem = (ElementImpl) _document.createElement( tagName );
_current.appendChild( elem );
_current = elem;
@@ -143,9 +143,9 @@
{
if ( _current == null )
- throw new SAXException( "State error: endElement called with no current node." );
+ throw new SAXException( "HTM007 State error: endElement called with no current node." );
if ( ! _current.getNodeName().equals( tagName ) )
- throw new SAXException( "State error: mismatch in closing tag name " + tagName );
+ throw new SAXException( "HTM008 State error: mismatch in closing tag name " + tagName + "\n" + tagName);
// Move up to the parent element. When you reach the top (closing the root element).
// the parent is document and current is null.
@@ -160,7 +160,7 @@
throws SAXException
{
if ( _current == null )
- throw new SAXException( "State error: character data found outside of root element." );
+ throw new SAXException( "HTM009 State error: character data found outside of root element." );
_current.appendChild( new TextImpl( _document, text ) );
}
@@ -169,7 +169,7 @@
throws SAXException
{
if ( _current == null )
- throw new SAXException( "State error: character data found outside of root element." );
+ throw new SAXException( "HTM010 State error: character data found outside of root element." );
_current.appendChild( new TextImpl( _document, new String( text, start, length ) ) );
}
1.2 +4 -4 xml-xerces/java/src/org/apache/html/dom/HTMLCollectionImpl.java
Index: HTMLCollectionImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/html/dom/HTMLCollectionImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- HTMLCollectionImpl.java 1999/12/14 21:27:04 1.1
+++ HTMLCollectionImpl.java 2000/02/05 02:25:22 1.2
@@ -26,7 +26,7 @@
* might be out dated, but not erroneous.
*
*
- * @version $Revision: 1.1 $ $Date: 1999/12/14 21:27:04 $
+ * @version $Revision: 1.2 $ $Date: 2000/02/05 02:25:22 $
* @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
* @see org.w3c.dom.html.HTMLCollection
*/
@@ -136,7 +136,7 @@
HTMLCollectionImpl( HTMLElement topLevel, short lookingFor )
{
if ( topLevel == null )
- throw new NullPointerException( "Argument 'topLevel' is null." );
+ throw new NullPointerException( "HTM011 Argument 'topLevel' is null." );
_topLevel = topLevel;
_lookingFor = lookingFor;
}
@@ -166,7 +166,7 @@
public final Node item( int index )
{
if ( index < 0 )
- throw new IllegalArgumentException( "Argument 'index' is negative." );
+ throw new IllegalArgumentException( "HTM012 Argument 'index' is negative." );
// Call recursive function on top-level element.
return item( _topLevel, new CollectionIndex( index ) );
}
@@ -184,7 +184,7 @@
public final Node namedItem( String name )
{
if ( name == null )
- throw new NullPointerException( "Argument 'name' is null." );
+ throw new NullPointerException( "HTM013 Argument 'name' is null." );
// Call recursive function on top-level element.
return namedItem( _topLevel, name );
}
1.2 +2 -2 xml-xerces/java/src/org/apache/html/dom/HTMLDOMImplementationImpl.java
Index: HTMLDOMImplementationImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/html/dom/HTMLDOMImplementationImpl.java,v
retrieving revision 1.1
retrieving revision 1.2
diff -u -r1.1 -r1.2
--- HTMLDOMImplementationImpl.java 1999/12/14 21:27:04 1.1
+++ HTMLDOMImplementationImpl.java 2000/02/05 02:25:22 1.2
@@ -12,7 +12,7 @@
* unconstructable, the only way to obtain an instance of a DOM implementation
* is by calling the static method {@link #getDOMImplementation}.
*
- * @version $Revision: 1.1 $ $Date: 1999/12/14 21:27:04 $
+ * @version $Revision: 1.2 $ $Date: 2000/02/05 02:25:22 $
* @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
* @see org.w3c.dom.DOMImplementation
*/
@@ -51,7 +51,7 @@
HTMLDocument doc;
if ( title == null )
- throw new NullPointerException( "Argument 'title' is null." );
+ throw new NullPointerException( "HTM014 Argument 'title' is null." );
doc = new HTMLDocumentImpl();
doc.setTitle( title );
return doc;
1.3 +6 -5 xml-xerces/java/src/org/apache/html/dom/HTMLDocumentImpl.java
Index: HTMLDocumentImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/html/dom/HTMLDocumentImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- HTMLDocumentImpl.java 2000/02/04 03:30:29 1.2
+++ HTMLDocumentImpl.java 2000/02/05 02:25:22 1.3
@@ -27,7 +27,7 @@
* methods ({@link #getURL}, {@link #getCookie}).
*
*
- * @version $Revision: 1.2 $ $Date: 2000/02/04 03:30:29 $
+ * @version $Revision: 1.3 $ $Date: 2000/02/05 02:25:22 $
* @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
* @see org.w3c.dom.html.HTMLDocument
*/
@@ -410,10 +410,10 @@
thrw = ( (java.lang.reflect.InvocationTargetException) except ).getTargetException();
else
thrw = except;
- System.out.println( "Exception " + thrw.getClass().getName() );
- System.out.println( thrw.getMessage() );
+// System.out.println( "Exception " + thrw.getClass().getName() );
+// System.out.println( thrw.getMessage() );
- throw new IllegalStateException( "Tag '" + tagName + "' associated with an Element class that failed to construct." );
+ throw new IllegalStateException( "HTM15 Tag '" + tagName + "' associated with an Element class that failed to construct.\n" + tagName);
}
}
return new HTMLElementImpl( this, tagName );
@@ -688,7 +688,8 @@
try {
_elementTypesHTML.put( tagName, Class.forName( "org.apache.html.dom." + className ) );
} catch ( ClassNotFoundException except ) {
- System.err.println( "OpenXML Error: Could not find class " + className + " implementing HTML element " + tagName );
+ new RuntimeException( "HTM019 OpenXML Error: Could not find class " + className + " implementing HTML element " + tagName
+ + "\n" + className + "\t" + tagName);
}
}
1.3 +4 -4 xml-xerces/java/src/org/apache/html/dom/HTMLTableElementImpl.java
Index: HTMLTableElementImpl.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/html/dom/HTMLTableElementImpl.java,v
retrieving revision 1.2
retrieving revision 1.3
diff -u -r1.2 -r1.3
--- HTMLTableElementImpl.java 2000/01/14 02:01:33 1.2
+++ HTMLTableElementImpl.java 2000/02/05 02:25:22 1.3
@@ -6,7 +6,7 @@
/**
- * @version $Revision: 1.2 $ $Date: 2000/01/14 02:01:33 $
+ * @version $Revision: 1.3 $ $Date: 2000/02/05 02:25:22 $
* @author <a href="mailto:arkin@exoffice.com">Assaf Arkin</a>
* @see org.w3c.dom.html.HTMLAnchorElement
* @see ElementImpl
@@ -36,7 +36,7 @@
public synchronized void setCaption( HTMLTableCaptionElement caption )
{
if ( caption != null && ! caption.getTagName().equals( "CAPTION" ) )
- throw new IllegalArgumentException( "Argument 'caption' is not an element of type <CAPTION>." );
+ throw new IllegalArgumentException( "HTM016 Argument 'caption' is not an element of type <CAPTION>." );
deleteCaption();
if ( caption != null )
appendChild( caption );
@@ -84,7 +84,7 @@
public synchronized void setTHead( HTMLTableSectionElement tHead )
{
if ( tHead != null && ! tHead.getTagName().equals( "THEAD" ) )
- throw new IllegalArgumentException( "Argument 'tHead' is not an element of type <THEAD>." );
+ throw new IllegalArgumentException( "HTM017 Argument 'tHead' is not an element of type <THEAD>." );
deleteTHead();
if ( tHead != null )
appendChild( tHead );
@@ -132,7 +132,7 @@
public synchronized void setTFoot( HTMLTableSectionElement tFoot )
{
if ( tFoot != null && ! tFoot.getTagName().equals( "TFOOT" ) )
- throw new IllegalArgumentException( "Argument 'tFoot' is not an element of type <TFOOT>." );
+ throw new IllegalArgumentException( "HTM018 Argument 'tFoot' is not an element of type <TFOOT>." );
deleteTFoot();
if ( tFoot != null )
appendChild( tFoot );