You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@xerces.apache.org by an...@locus.apache.org on 2000/10/10 10:05:01 UTC
cvs commit: xml-xerces/java/src/org/apache/xerces/xni QName.java XMLAttributes.java XMLComponent.java XMLComponentManager.java XMLDTDContentModelFilter.java XMLDTDContentModelHandler.java XMLDTDContentModelSource.java XMLDTDFilter.java XMLDTDHandler.java XMLDTDSource.java XMLDocumentFilter.java XMLDocumentHandler.java XMLDocumentSource.java XMLEntityHandler.java XMLString.java
andyc 00/10/10 01:05:01
Modified: java/src/org/apache/xerces/impl/validation/grammars Tag:
xerces_j_2 DTDGrammar.java
java/src/org/apache/xerces/parsers Tag: xerces_j_2
DTDParser.java
java/src/org/apache/xerces/xni Tag: xerces_j_2 QName.java
XMLAttributes.java XMLComponent.java
XMLComponentManager.java
XMLDTDContentModelFilter.java
XMLDTDContentModelHandler.java
XMLDTDContentModelSource.java XMLDTDFilter.java
XMLDTDHandler.java XMLDTDSource.java
XMLDocumentFilter.java XMLDocumentHandler.java
XMLDocumentSource.java XMLEntityHandler.java
XMLString.java
Log:
1) Made modifications to XMLDTDHandler to remove isPE parameter
from internal and external entity declaration callbacks. Since
parameter entity names start with '%', this parameter is not
needed.
2) Added complete javadoc to XNI interfaces and classes. This
should help a lot in understanding what the core interfaces
and classes have and how they relate to each other. I also
added the javadoc comments to those classes that implement
either the document or dtd/dtd content model handler
interfaces. There's still more to do, though.
3) Removed filter callbacks from DTDGrammar. The DTD grammar
object is no longer a filter, just another handler. It is
assumed that the DTD scanner would call *both* the DTD
grammar (so that it can populate the validation structures
in the grammar) as well as the registered dtd/dtd content
model handler so that DTD information can be reported. It
was too complicated when the DTD grammar was a filter that
would pass on the DTD information. And the new design is
all about simplicity.
4) Did I forget anything for this log message?
Revision Changes Path
No revision
No revision
1.1.2.6 +244 -209 xml-xerces/java/src/org/apache/xerces/impl/validation/grammars/Attic/DTDGrammar.java
Index: DTDGrammar.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/impl/validation/grammars/Attic/DTDGrammar.java,v
retrieving revision 1.1.2.5
retrieving revision 1.1.2.6
diff -u -r1.1.2.5 -r1.1.2.6
--- DTDGrammar.java 2000/10/09 23:08:31 1.1.2.5
+++ DTDGrammar.java 2000/10/10 08:04:56 1.1.2.6
@@ -71,7 +71,7 @@
/**
* @author Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000
- * @version $Id: DTDGrammar.java,v 1.1.2.5 2000/10/09 23:08:31 jeffreyr Exp $
+ * @version $Id: DTDGrammar.java,v 1.1.2.6 2000/10/10 08:04:56 andyc Exp $
*/
public class DTDGrammar
extends Grammar
@@ -108,30 +108,18 @@
/** Simple Type. */
private XMLSimpleType fSimpleType = new XMLSimpleType();
+ // debugging
- /** setDTDHandler */
- protected XMLDTDHandler setDTDHandler;
-
- /** setDTDContentModelHandler */
- protected XMLDTDContentModelHandler setDTDContentModelHandler;
-
-
- // debugging
-
/** Debug DTDGrammar. */
private static final boolean DEBUG_SCANNER_STATE = false;
-
-
//
// Constructors
//
- /**
- *
- */
+ /** Default constructor. */
public DTDGrammar() {
- }
+ }
/**
*
@@ -142,96 +130,96 @@
}
//
- // XMLEntityHandler methods
+ // XMLDTDHandler methods
//
/**
- * startEntity
- *
- * @param name
- * @param publicId
- * @param systemId
- * @param encoding
+ * This method notifies of the start of an entity. The DTD has the
+ * pseudo-name of "[dtd]; and parameter entity names start with '%'.
+ * <p>
+ * <strong>Note:</strong> Since the DTD is an entity, the handler
+ * will be notified of the start of the DTD entity by calling the
+ * startEntity method with the entity name "[dtd]" <em>before</em> calling
+ * the startDTD method.
+ *
+ * @param name The name of the entity.
+ * @param publicId The public identifier of the entity if the entity
+ * is external, null otherwise.
+ * @param systemId The system identifier of the entity if the entity
+ * is external, null otherwise.
+ * @param encoding The auto-detected IANA encoding name of the entity
+ * stream. This value will be null in those situations
+ * where the entity encoding is not auto-detected (e.g.
+ * internal parameter entities).
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void startEntity(String name, String publicId, String systemId, String encoding)
- throws SAXException {
+ public void startEntity(String name, String publicId, String systemId,
+ String encoding) throws SAXException {
this.fEntityDecl.setValues( name, publicId, systemId, null, null, false );//fill internal fEntityDecl struct
}
/**
- * endEntity
- *
- * @param name
+ * The start of the DTD.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void endEntity(String name)
- throws SAXException {
- }
-
- //
- // XMLDTDHandler methods
- //
-
- /**
- * startDTD
- */
- public void startDTD()
- throws SAXException {
- if( setDTDHandler != null){
- setDTDHandler.startDTD();//callback
- }
+ public void startDTD() throws SAXException {
} // startDTD
/**
- * comment
+ * A comment.
*
- * @param text
+ * @param text The text in the comment.
+ *
+ * @throws SAXException Thrown by application to signal an error.
*/
- public void comment(XMLString text)
- throws SAXException {
- if( setDTDHandler != null ){
- setDTDHandler.comment( text );
- }
+ public void comment(XMLString text) throws SAXException {
} // comment
/**
- * processingInstruction
- *
- * @param target
- * @param data
+ * A processing instruction. Processing instructions consist of a
+ * target name and, optionally, text data. The data is only meaningful
+ * to the application.
+ * <p>
+ * Typically, a processing instruction's data will contain a series
+ * of pseudo-attributes. These pseudo-attributes follow the form of
+ * element attributes but are <strong>not</strong> parsed or presented
+ * to the application as anything other than text. The application is
+ * responsible for parsing the data.
+ *
+ * @param target The target.
+ * @param data The data or null if none specified.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void processingInstruction(String target, XMLString data)
throws SAXException {
- if( setDTDHandler != null ){
- setDTDHandler.processingInstruction( target, data );
- }
} // processingInstruction
/**
- * startExternalSubset
+ * The start of the external subset.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void startExternalSubset()
- throws SAXException {
- if( setDTDHandler != null ){
- setDTDHandler.startExternalSubset();
- }
-
+ public void startExternalSubset() throws SAXException {
} // startExternalSubset
/**
- * endExternalSubset
+ * The end of the external subset.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void endExternalSubset()
- throws SAXException {
- if( setDTDHandler != null ){
- setDTDHandler.endExternalSubset();
- }
+ public void endExternalSubset() throws SAXException {
} // endExternalSubset
/**
- * elementDecl
+ * An element declaration.
*
- * @param name
- * @param contentModel
+ * @param name The name of the element.
+ * @param contentModel The element content model.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void elementDecl(String name, XMLString contentModel)
throws SAXException {
@@ -241,32 +229,39 @@
fElementDecl.name.setValues( null, null, name, null );
setElementDecl(fCurrentElementIndex, fElementDecl );//set internal structure
- if( setDTDHandler != null ){
- setDTDHandler.elementDecl( name, contentModel );
- }
} // elementDecl
/**
- * startAttlist
+ * The start of an attribute list.
*
- * @param elementName
+ * @param elementName The name of the element that this attribute
+ * list is associated with.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void startAttlist(String elementName)
- throws SAXException {
- if( setDTDHandler != null ){
- setDTDHandler.startAttlist( elementName );
- }
+ public void startAttlist(String elementName) throws SAXException {
} // startAttlist
/**
- * attributeDecl
+ * An attribute declaration.
*
- * @param elementName
- * @param attributeName
- * @param type
- * @param enumeration
- * @param defaultType
- * @param defaultValue
+ * @param elementName The name of the element that this attribute
+ * is associated with.
+ * @param attributeName The name of the attribute.
+ * @param type The attribute type. This value will be one of
+ * the following: "CDATA", "ENTITY", "ENTITIES",
+ * "ENUMERATION", "ID", "IDREF", "IDREFS",
+ * "NMTOKEN", "NMTOKENS", or "NOTATION".
+ * @param enumeration If the type has the value "ENUMERATION", this
+ * array holds the allowed attribute values;
+ * otherwise, this array is null.
+ * @param defaultType The attribute default type. This value will be
+ * one of the following: "#FIXED", "#IMPLIED",
+ * "#REQUIRED", or null.
+ * @param defaultValue The attribute default value, or null if no
+ * default value is specified.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void attributeDecl(String elementName, String attributeName, String type, String[] enumeration, String defaultType, XMLString defaultValue)
throws SAXException {
@@ -295,207 +290,247 @@
fAttributeDecl.simpleType = fSimpleType;
setAttributeDecl( fCurrentElementIndex, fCurrentAttributeIndex,
fAttributeDecl );
- if( setDTDHandler != null ){
- setDTDHandler.attributeDecl( elementName, attributeName, type,
- enumeration, defaultType, defaultValue );
- }
} // attributeDecl
/**
- * endAttlist
+ * The end of an attribute list.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void endAttlist()
- throws SAXException {
- if( setDTDHandler != null ){
- setDTDHandler.endAttlist();
- }
+ public void endAttlist() throws SAXException {
} // endAttlist
/**
- * internalEntityDecl
+ * An internal entity declaration.
*
- * @param name
- * @param text
- * @param isPE
+ * @param name The name of the entity. Parameter entity names start with
+ * '%', whereas the name of a general entity is just the
+ * entity name.
+ * @param text The value of the entity.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void internalEntityDecl(String name, XMLString text, boolean isPE)
+ public void internalEntityDecl(String name, XMLString text)
throws SAXException {
- if( setDTDHandler != null ){
- setDTDHandler.internalEntityDecl(name, text, isPE);
- }
} // internalEntityDecl
/**
- * externalEntityDecl
+ * An external entity declaration.
*
- * @param name
- * @param publicId
- * @param systemId
- * @param isPE
+ * @param name The name of the entity. Parameter entity names start
+ * with '%', whereas the name of a general entity is just
+ * the entity name.
+ * @param publicId The public identifier of the entity or null if the
+ * the entity was specified with SYSTEM.
+ * @param systemId The system identifier of the entity.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void externalEntityDecl(String name, String publicId, String systemId, boolean isPE)
+ public void externalEntityDecl(String name, String publicId, String systemId)
throws SAXException {
- if( setDTDHandler != null ){
- setDTDHandler.externalEntityDecl(name, publicId, systemId, isPE );
- }
} // externalEntityDecl
/**
- * unparsedEntityDecl
+ * An unparsed entity declaration.
*
- * @param name
- * @param publicId
- * @param systemId
- * @param notation
+ * @param name The name of the entity.
+ * @param publicId The public identifier of the entity, or null if not
+ * specified.
+ * @param systemId The system identifier of the entity, or null if not
+ * specified.
+ * @param notation The name of the notation.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void unparsedEntityDecl(String name, String publicId, String systemId, String notation)
throws SAXException {
- if( setDTDHandler != null ){
- setDTDHandler.unparsedEntityDecl(name, publicId, systemId, notation );
- }
} // unparsedEntityDecl
/**
- * notationDecl
+ * A notation declaration
*
- * @param name
- * @param publicId
- * @param systemId
+ * @param name The name of the notation.
+ * @param publicId The public identifier of the notation, or null if not
+ * specified.
+ * @param systemId The system identifier of the notation, or null if not
+ * specified.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void notationDecl(String name, String publicId, String systemId)
throws SAXException {
- if( setDTDHandler != null ){
- setDTDHandler.notationDecl( name, publicId, systemId );
- }
} // notationDecl
/**
- * startConditional
+ * The start of a conditional section.
*
- * @param type
+ * @param type The type of the conditional section. This value will
+ * either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see CONDITIONAL_INCLUDE
+ * @see CONDITIONAL_IGNORE
*/
- public void startConditional(short type)
- throws SAXException {
- if( setDTDHandler != null ){
- setDTDHandler.startConditional( type );
- }
+ public void startConditional(short type) throws SAXException {
} // startConditional
/**
- * endConditional
+ * The end of a conditional section.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void endConditional()
- throws SAXException {
- if( setDTDHandler != null ){
- setDTDHandler.endConditional();
- }
+ public void endConditional() throws SAXException {
} // endConditional
/**
- * endDTD
+ * The end of the DTD.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void endDTD()
- throws SAXException {
- if( setDTDHandler != null ){
- setDTDHandler.endDTD();
- }
+ public void endDTD() throws SAXException {
} // endDTD
+ /**
+ * This method notifies the end of an entity. The DTD has the pseudo-name
+ * of "[dtd]; and parameter entity names start with '%'.
+ * <p>
+ * <strong>Note:</strong> Since the DTD is an entity, the handler
+ * will be notified of the end of the DTD entity by calling the
+ * endEntity method with the entity name "[dtd]" <em>after</em> calling
+ * the endDTD method.
+ *
+ * @param name The name of the entity.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ */
+ public void endEntity(String name) throws SAXException {
+ }
+
//
// XMLDTDContentModelHandler methods
//
/**
- * startContentModel
- *
- * @param elementName
- * @param type
+ * The start of a content model. Depending on the type of the content
+ * model, specific methods may be called between the call to the
+ * startContentModel method and the call to the endContentModel method.
+ *
+ * @param elementName The name of the element.
+ * @param type The content model type.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see TYPE_EMPTY
+ * @see TYPE_ANY
+ * @see TYPE_MIXED
+ * @see TYPE_CHILDREN
*/
public void startContentModel(String elementName, short type)
throws SAXException {
- if( setDTDContentModelHandler != null ){
- setDTDContentModelHandler.startContentModel( elementName, type );
- }
} // startContentModel
/**
- * mixedElement
- *
- * @param elementName
+ * A referenced element in a mixed content model. If the mixed content
+ * model only allows text content, then this method will not be called
+ * for that model. However, if this method is called for a mixed
+ * content model, then the zero or more occurrence count is implied.
+ * <p>
+ * <strong>Note:</strong> This method is only called after a call to
+ * the startContentModel method where the type is TYPE_MIXED.
+ *
+ * @param elementName The name of the referenced element.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see TYPE_MIXED
*/
- public void mixedElement(String elementName)
- throws SAXException {
- if( setDTDContentModelHandler != null ){
- setDTDContentModelHandler.mixedElement( elementName );
- }
+ public void mixedElement(String elementName) throws SAXException {
} // mixedElement
/**
- * childrenStartGroup
+ * The start of a children group.
+ * <p>
+ * <strong>Note:</strong> This method is only called after a call to
+ * the startContentModel method where the type is TYPE_CHILDREN.
+ * <p>
+ * <strong>Note:</strong> Children groups can be nested and have
+ * associated occurrence counts.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see TYPE_CHILDREN
*/
- public void childrenStartGroup()
- throws SAXException {
- if( setDTDContentModelHandler != null ){
- setDTDContentModelHandler.childrenStartGroup();
- }
-
+ public void childrenStartGroup() throws SAXException {
} // childrenStartGroup
/**
- * childrenElement
+ * A referenced element in a children content model.
*
- * @param elementName
+ * @param elementName The name of the referenced element.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see TYPE_CHILDREN
*/
- public void childrenElement(String elementName)
- throws SAXException {
- if( setDTDContentModelHandler != null ){
- setDTDContentModelHandler.childrenElement( elementName );
- }
+ public void childrenElement(String elementName) throws SAXException {
} // childrenElement
/**
- * childrenSeparator
- *
- * @param separator
+ * The separator between choices or sequences of a children content
+ * model.
+ * <p>
+ * <strong>Note:</strong> This method is only called after a call to
+ * the startContentModel method where the type is TYPE_CHILDREN.
+ *
+ * @param separator The type of children separator.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see SEPARATOR_CHOICE
+ * @see SEPARATOR_SEQUENCE
+ * @see TYPE_CHILDREN
*/
- public void childrenSeparator(short separator)
- throws SAXException {
- if( setDTDContentModelHandler != null ){
- setDTDContentModelHandler.childrenSeparator( separator );
- }
+ public void childrenSeparator(short separator) throws SAXException {
} // childrenSeparator
/**
- * childrenOccurrence
- *
- * @param occurrence
+ * The occurrence count for a child in a children content model.
+ * <p>
+ * <strong>Note:</strong> This method is only called after a call to
+ * the startContentModel method where the type is TYPE_CHILDREN.
+ *
+ * @param occurrence The occurrence count for the last children element
+ * or children group.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see OCCURS_ZERO_OR_ONE
+ * @see OCCURS_ZERO_OR_MORE
+ * @see OCCURS_ONE_OR_MORE
+ * @see TYPE_CHILDREN
*/
- public void childrenOccurrence(short occurrence)
- throws SAXException {
- if( setDTDContentModelHandler != null ){
- setDTDContentModelHandler.childrenOccurrence( occurrence );
- }
+ public void childrenOccurrence(short occurrence) throws SAXException {
} // childrenOccurrence
/**
- * childrenEndGroup
+ * The end of a children group.
+ * <p>
+ * <strong>Note:</strong> This method is only called after a call to
+ * the startContentModel method where the type is TYPE_CHILDREN.
+ *
+ * @see TYPE_CHILDREN
*/
- public void childrenEndGroup()
- throws SAXException {
- if( setDTDContentModelHandler != null ){
- setDTDContentModelHandler.childrenEndGroup();
- }
+ public void childrenEndGroup() throws SAXException {
} // childrenEndGroup
/**
- * endContentModel
+ * The end of a content model.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void endContentModel()
- throws SAXException {
- if( setDTDContentModelHandler != null ){
- setDTDContentModelHandler.endContentModel();
- }
+ public void endContentModel() throws SAXException {
} // endContentModel
} // class DTDGrammar
No revision
No revision
1.1.2.8 +241 -118 xml-xerces/java/src/org/apache/xerces/parsers/Attic/DTDParser.java
Index: DTDParser.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/parsers/Attic/DTDParser.java,v
retrieving revision 1.1.2.7
retrieving revision 1.1.2.8
diff -u -r1.1.2.7 -r1.1.2.8
--- DTDParser.java 2000/10/02 00:40:12 1.1.2.7
+++ DTDParser.java 2000/10/10 08:04:57 1.1.2.8
@@ -67,7 +67,7 @@
/**
* @author Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000
- * @version $Id: DTDParser.java,v 1.1.2.7 2000/10/02 00:40:12 lehors Exp $
+ * @version $Id: DTDParser.java,v 1.1.2.8 2000/10/10 08:04:57 andyc Exp $
*/
public class DTDParser
extends XMLGrammarParser
@@ -107,251 +107,374 @@
} // getDTDGrammar
//
- // XMLEntityHandler methods
+ // XMLDTDHandler methods
//
/**
- * startEntity
- *
- * @param name
- * @param publicId
- * @param systemId
+ * This method notifies of the start of an entity. The DTD has the
+ * pseudo-name of "[dtd]; and parameter entity names start with '%'.
+ * <p>
+ * <strong>Note:</strong> Since the DTD is an entity, the handler
+ * will be notified of the start of the DTD entity by calling the
+ * startEntity method with the entity name "[dtd]" <em>before</em> calling
+ * the startDTD method.
+ *
+ * @param name The name of the entity.
+ * @param publicId The public identifier of the entity if the entity
+ * is external, null otherwise.
+ * @param systemId The system identifier of the entity if the entity
+ * is external, null otherwise.
+ * @param encoding The auto-detected IANA encoding name of the entity
+ * stream. This value will be null in those situations
+ * where the entity encoding is not auto-detected (e.g.
+ * internal parameter entities).
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void startEntity(String name, String publicId, String systemId)
- throws SAXException {
+ public void startEntity(String name, String publicId, String systemId,
+ String encoding) throws SAXException {
}
/**
- * endEntity
- *
- * @param name
+ * The start of the DTD.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void endEntity(String name)
- throws SAXException {
- }
-
- //
- // XMLDTDHandler methods
- //
-
- /**
- * startDTD
- */
- public void startDTD()
- throws SAXException {
+ public void startDTD() throws SAXException {
} // startDTD
/**
- * comment
+ * A comment.
*
- * @param text
+ * @param text The text in the comment.
+ *
+ * @throws SAXException Thrown by application to signal an error.
*/
- public void comment(XMLString text)
- throws SAXException {
+ public void comment(XMLString text) throws SAXException {
} // comment
/**
- * processingInstruction
- *
- * @param target
- * @param data
+ * A processing instruction. Processing instructions consist of a
+ * target name and, optionally, text data. The data is only meaningful
+ * to the application.
+ * <p>
+ * Typically, a processing instruction's data will contain a series
+ * of pseudo-attributes. These pseudo-attributes follow the form of
+ * element attributes but are <strong>not</strong> parsed or presented
+ * to the application as anything other than text. The application is
+ * responsible for parsing the data.
+ *
+ * @param target The target.
+ * @param data The data or null if none specified.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void processingInstruction(String target, XMLString data)
throws SAXException {
} // processingInstruction
/**
- * startExternalSubset
+ * The start of the external subset.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void startExternalSubset()
- throws SAXException {
+ public void startExternalSubset() throws SAXException {
} // startExternalSubset
/**
- * endExternalSubset
+ * The end of the external subset.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void endExternalSubset()
- throws SAXException {
+ public void endExternalSubset() throws SAXException {
} // endExternalSubset
/**
- * elementDecl
+ * An element declaration.
*
- * @param name
- * @param contentModel
+ * @param name The name of the element.
+ * @param contentModel The element content model.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void elementDecl(String name, XMLString contentModel)
throws SAXException {
} // elementDecl
/**
- * startAttlist
+ * The start of an attribute list.
*
- * @param elementName
+ * @param elementName The name of the element that this attribute
+ * list is associated with.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void startAttlist(String elementName)
- throws SAXException {
+ public void startAttlist(String elementName) throws SAXException {
} // startAttlist
/**
- * attributeDecl
+ * An attribute declaration.
*
- * @param elementName
- * @param attributeName
- * @param type
- * @param enumeration
- * @param defaultType
- * @param defaultValue
+ * @param elementName The name of the element that this attribute
+ * is associated with.
+ * @param attributeName The name of the attribute.
+ * @param type The attribute type. This value will be one of
+ * the following: "CDATA", "ENTITY", "ENTITIES",
+ * "ENUMERATION", "ID", "IDREF", "IDREFS",
+ * "NMTOKEN", "NMTOKENS", or "NOTATION".
+ * @param enumeration If the type has the value "ENUMERATION", this
+ * array holds the allowed attribute values;
+ * otherwise, this array is null.
+ * @param defaultType The attribute default type. This value will be
+ * one of the following: "#FIXED", "#IMPLIED",
+ * "#REQUIRED", or null.
+ * @param defaultValue The attribute default value, or null if no
+ * default value is specified.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void attributeDecl(String elementName, String attributeName, String type, String[] enumeration, String defaultType, XMLString defaultValue)
throws SAXException {
} // attributeDecl
/**
- * endAttlist
+ * The end of an attribute list.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void endAttlist()
- throws SAXException {
+ public void endAttlist() throws SAXException {
} // endAttlist
/**
- * internalEntityDecl
+ * An internal entity declaration.
*
- * @param name
- * @param text
- * @param isPE
+ * @param name The name of the entity. Parameter entity names start with
+ * '%', whereas the name of a general entity is just the
+ * entity name.
+ * @param text The value of the entity.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void internalEntityDecl(String name, XMLString text, boolean isPE)
+ public void internalEntityDecl(String name, XMLString text)
throws SAXException {
} // internalEntityDecl
/**
- * externalEntityDecl
+ * An external entity declaration.
*
- * @param name
- * @param publicId
- * @param systemId
- * @param isPE
+ * @param name The name of the entity. Parameter entity names start
+ * with '%', whereas the name of a general entity is just
+ * the entity name.
+ * @param publicId The public identifier of the entity or null if the
+ * the entity was specified with SYSTEM.
+ * @param systemId The system identifier of the entity.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void externalEntityDecl(String name, String publicId, String systemId, boolean isPE)
+ public void externalEntityDecl(String name, String publicId, String systemId)
throws SAXException {
} // externalEntityDecl
/**
- * unparsedEntityDecl
+ * An unparsed entity declaration.
*
- * @param name
- * @param publicId
- * @param systemId
- * @param notation
+ * @param name The name of the entity.
+ * @param publicId The public identifier of the entity, or null if not
+ * specified.
+ * @param systemId The system identifier of the entity, or null if not
+ * specified.
+ * @param notation The name of the notation.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void unparsedEntityDecl(String name, String publicId, String systemId, String notation)
throws SAXException {
} // unparsedEntityDecl
/**
- * notationDecl
+ * A notation declaration
*
- * @param name
- * @param publicId
- * @param systemId
+ * @param name The name of the notation.
+ * @param publicId The public identifier of the notation, or null if not
+ * specified.
+ * @param systemId The system identifier of the notation, or null if not
+ * specified.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void notationDecl(String name, String publicId, String systemId)
throws SAXException {
} // notationDecl
/**
- * startConditional
+ * The start of a conditional section.
*
- * @param type
+ * @param type The type of the conditional section. This value will
+ * either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see CONDITIONAL_INCLUDE
+ * @see CONDITIONAL_IGNORE
*/
- public void startConditional(short type)
- throws SAXException {
+ public void startConditional(short type) throws SAXException {
} // startConditional
/**
- * endConditional
+ * The end of a conditional section.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void endConditional()
- throws SAXException {
+ public void endConditional() throws SAXException {
} // endConditional
/**
- * endDTD
+ * The end of the DTD.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void endDTD()
- throws SAXException {
+ public void endDTD() throws SAXException {
} // endDTD
+ /**
+ * This method notifies the end of an entity. The DTD has the pseudo-name
+ * of "[dtd]; and parameter entity names start with '%'.
+ * <p>
+ * <strong>Note:</strong> Since the DTD is an entity, the handler
+ * will be notified of the end of the DTD entity by calling the
+ * endEntity method with the entity name "[dtd]" <em>after</em> calling
+ * the endDTD method.
+ *
+ * @param name The name of the entity.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ */
+ public void endEntity(String name) throws SAXException {
+ }
+
//
// XMLDTDContentModelHandler methods
//
/**
- * startContentModel
- *
- * @param elementName
- * @param type
+ * The start of a content model. Depending on the type of the content
+ * model, specific methods may be called between the call to the
+ * startContentModel method and the call to the endContentModel method.
+ *
+ * @param elementName The name of the element.
+ * @param type The content model type.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see TYPE_EMPTY
+ * @see TYPE_ANY
+ * @see TYPE_MIXED
+ * @see TYPE_CHILDREN
*/
public void startContentModel(String elementName, short type)
throws SAXException {
} // startContentModel
/**
- * mixedElement
- *
- * @param elementName
+ * A referenced element in a mixed content model. If the mixed content
+ * model only allows text content, then this method will not be called
+ * for that model. However, if this method is called for a mixed
+ * content model, then the zero or more occurrence count is implied.
+ * <p>
+ * <strong>Note:</strong> This method is only called after a call to
+ * the startContentModel method where the type is TYPE_MIXED.
+ *
+ * @param elementName The name of the referenced element.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see TYPE_MIXED
*/
- public void mixedElement(String elementName)
- throws SAXException {
+ public void mixedElement(String elementName) throws SAXException {
} // mixedElement
/**
- * childrenStartGroup
+ * The start of a children group.
+ * <p>
+ * <strong>Note:</strong> This method is only called after a call to
+ * the startContentModel method where the type is TYPE_CHILDREN.
+ * <p>
+ * <strong>Note:</strong> Children groups can be nested and have
+ * associated occurrence counts.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see TYPE_CHILDREN
*/
- public void childrenStartGroup()
- throws SAXException {
+ public void childrenStartGroup() throws SAXException {
} // childrenStartGroup
/**
- * childrenElement
+ * A referenced element in a children content model.
*
- * @param elementName
+ * @param elementName The name of the referenced element.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see TYPE_CHILDREN
*/
- public void childrenElement(String elementName)
- throws SAXException {
+ public void childrenElement(String elementName) throws SAXException {
} // childrenElement
/**
- * childrenSeparator
- *
- * @param separator
+ * The separator between choices or sequences of a children content
+ * model.
+ * <p>
+ * <strong>Note:</strong> This method is only called after a call to
+ * the startContentModel method where the type is TYPE_CHILDREN.
+ *
+ * @param separator The type of children separator.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see SEPARATOR_CHOICE
+ * @see SEPARATOR_SEQUENCE
+ * @see TYPE_CHILDREN
*/
- public void childrenSeparator(short separator)
- throws SAXException {
+ public void childrenSeparator(short separator) throws SAXException {
} // childrenSeparator
/**
- * childrenOccurrence
- *
- * @param occurrence
+ * The occurrence count for a child in a children content model.
+ * <p>
+ * <strong>Note:</strong> This method is only called after a call to
+ * the startContentModel method where the type is TYPE_CHILDREN.
+ *
+ * @param occurrence The occurrence count for the last children element
+ * or children group.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see OCCURS_ZERO_OR_ONE
+ * @see OCCURS_ZERO_OR_MORE
+ * @see OCCURS_ONE_OR_MORE
+ * @see TYPE_CHILDREN
*/
- public void childrenOccurrence(short occurrence)
- throws SAXException {
+ public void childrenOccurrence(short occurrence) throws SAXException {
} // childrenOccurrence
/**
- * childrenEndGroup
+ * The end of a children group.
+ * <p>
+ * <strong>Note:</strong> This method is only called after a call to
+ * the startContentModel method where the type is TYPE_CHILDREN.
+ *
+ * @see TYPE_CHILDREN
*/
- public void childrenEndGroup()
- throws SAXException {
+ public void childrenEndGroup() throws SAXException {
} // childrenEndGroup
/**
- * endContentModel
+ * The end of a content model.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void endContentModel()
- throws SAXException {
+ public void endContentModel() throws SAXException {
} // endContentModel
} // class DTDParser
No revision
No revision
1.1.2.3 +9 -8 xml-xerces/java/src/org/apache/xerces/xni/Attic/QName.java
Index: QName.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Attic/QName.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- QName.java 2000/10/02 00:40:16 1.1.2.2
+++ QName.java 2000/10/10 08:04:57 1.1.2.3
@@ -65,12 +65,12 @@
* equal strings. Within the parser, these values are considered symbols
* and should always be retrieved from the <code>SymbolTable</code>.
*
- * @see SymbolTable
+ * @see org.apache.xerces.util.SymbolTable
*
* @author Stubs generated by DesignDoc on Wed Jun 07 11:58:44 PDT 2000
* @author Andy Clark, IBM
*
- * @version $Id: QName.java,v 1.1.2.2 2000/10/02 00:40:16 lehors Exp $
+ * @version $Id: QName.java,v 1.1.2.3 2000/10/10 08:04:57 andyc Exp $
*/
public class QName {
@@ -109,18 +109,17 @@
/** Default constructor. */
public QName() {
clear();
- }
+ } // <init>()
/** Constructs a QName with the specified values. */
- public QName(String prefix, String localpart, String rawname,
- String uri) {
+ public QName(String prefix, String localpart, String rawname, String uri) {
setValues(prefix, localpart, rawname, uri);
- }
+ } // <init>(String,String,String,String)
/** Constructs a copy of the specified QName. */
public QName(QName qname) {
setValues(qname);
- }
+ } // <init>(QName)
//
// Public methods
@@ -168,6 +167,7 @@
/** Returns a string representation of this object. */
public String toString() {
+
StringBuffer str = new StringBuffer();
boolean comma = false;
if (prefix != null) {
@@ -195,6 +195,7 @@
str.append("uri=\""+uri+'"');
}
return str.toString();
- }
+
+ } // toString():String
} // class QName
1.1.2.3 +36 -23 xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLAttributes.java
Index: XMLAttributes.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLAttributes.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- XMLAttributes.java 2000/10/02 00:40:16 1.1.2.2
+++ XMLAttributes.java 2000/10/10 08:04:57 1.1.2.3
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999,2000 The Apache Software Foundation. All rights
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -64,8 +64,21 @@
import org.xml.sax.Attributes;
/**
+ * The XMLAttributes class is a collection of attributes for an element.
+ * In the parser, the document source would scan the entire start element
+ * and collect the attributes. The attributes are communicated to the
+ * document handler in the startElement method.
+ * <p>
+ * The attributes are read-write so that subsequent stages in the document
+ * pipeline can modify the values or change the attributes that are
+ * propogated to the next stage.
+ *
+ * @see XMLDocumentHandler#startElement
+ *
* @author Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000
- * @version $Id: XMLAttributes.java,v 1.1.2.2 2000/10/02 00:40:16 lehors Exp $
+ * @author Andy Clark, IBM
+ *
+ * @version $Id: XMLAttributes.java,v 1.1.2.3 2000/10/10 08:04:57 andyc Exp $
*/
public class XMLAttributes
implements AttributeList, Attributes {
@@ -221,7 +234,7 @@
*/
public void setValue(int index, XMLString value) {
setValue(index, value != null ? value.toString() : null);
- } // setValue
+ } // setValue(int,XMLString)
/**
* getValue
@@ -231,7 +244,7 @@
*/
public void getValue(int index, XMLString value) {
throw new RuntimeException("not implemented");
- } // getValue
+ } // getValue(int,XMLString)
/**
* getEntityCount
@@ -242,7 +255,7 @@
*/
public int getEntityCount(int attrIndex) {
throw new RuntimeException("not implemented");
- } // getEntityCount
+ } // getEntityCount(int):int
/**
* getEntityName
@@ -254,7 +267,7 @@
*/
public String getEntityName(int attrIndex, int entityIndex) {
throw new RuntimeException("not implemented");
- } // getEntityName
+ } // getEntityName(int,int):String
/**
* getEntityOffset
@@ -266,7 +279,7 @@
*/
public int getEntityOffset(int attrIndex, int entityIndex) {
throw new RuntimeException("not implemented");
- } // getEntityOffset
+ } // getEntityOffset(int,int):int
/**
* getEntityLength
@@ -278,7 +291,7 @@
*/
public int getEntityLength(int attrIndex, int entityIndex) {
throw new RuntimeException("not implemented");
- } // getEntityLength
+ } // getEntityLength(int,int):int
//
// AttributeList and Attributes methods
@@ -294,7 +307,7 @@
*/
public int getLength() {
return fSize;
- }
+ } // getLength():int
/**
* Look up an attribute's type by index.
@@ -321,7 +334,7 @@
return null;
}
return fAttributes[index].type;
- }
+ } // getType(int):String
/**
* Look up an attribute's type by XML 1.0 qualified name.
@@ -329,7 +342,7 @@
* <p>See {@link #getType(int) getType(int)} for a description
* of the possible types.</p>
*
- * @param qName The XML 1.0 qualified name.
+ * @param qname The XML 1.0 qualified name.
* @return The attribute type as a string, or null if the
* attribute is not in the list or if qualified names
* are not available.
@@ -337,7 +350,7 @@
public String getType(String qname) {
int index = getIndex(qname);
return index != -1 ? fAttributes[index].type : null;
- }
+ } // getType(String):String
/**
* Look up an attribute's value by index.
@@ -357,7 +370,7 @@
return null;
}
return fAttributes[index].value;
- }
+ } // getValue(int):String
/**
* Look up an attribute's value by XML 1.0 qualified name.
@@ -365,7 +378,7 @@
* <p>See {@link #getValue(int) getValue(int)} for a description
* of the possible values.</p>
*
- * @param qName The XML 1.0 qualified name.
+ * @param qname The XML 1.0 qualified name.
* @return The attribute value as a string, or null if the
* attribute is not in the list or if qualified names
* are not available.
@@ -373,7 +386,7 @@
public String getValue(String qname) {
int index = getIndex(qname);
return index != -1 ? fAttributes[index].value : null;
- }
+ } // getValue(String):String
//
// AttributeList methods
@@ -400,7 +413,7 @@
return null;
}
return fAttributes[index].name.rawname;
- }
+ } // getName(int):String
//
// Attributes methods
@@ -422,7 +435,7 @@
}
}
return -1;
- }
+ } // getIndex(String):int
/**
* Look up the index of an attribute by Namespace name.
@@ -444,7 +457,7 @@
}
}
return -1;
- }
+ } // getIndex(String,String):int
/**
* Look up an attribute's local name by index.
@@ -463,7 +476,7 @@
return null;
}
return fAttributes[index].name.localpart;
- }
+ } // getLocalName(int):String
/**
* Look up an attribute's XML 1.0 qualified name by index.
@@ -480,7 +493,7 @@
}
String rawname = fAttributes[index].name.rawname;
return rawname != null ? rawname : "";
- }
+ } // getQName(int):String
/**
* Look up an attribute's type by Namespace name.
@@ -501,7 +514,7 @@
}
int index = getIndex(uri, localName);
return index != -1 ? getType(index) : null;
- }
+ } // getType(String,String):String
/**
* Look up an attribute's Namespace URI by index.
@@ -518,7 +531,7 @@
}
String uri = fAttributes[index].name.uri;
return uri != null ? uri : "";
- }
+ } // getURI(int):String
/**
* Look up an attribute's value by Namespace name.
@@ -535,7 +548,7 @@
public String getValue(String uri, String localName) {
int index = getIndex(uri, localName);
return index != -1 ? getValue(index) : null;
- }
+ } // getValue(String,String):String
//
// Classes
1.1.2.3 +48 -12 xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLComponent.java
Index: XMLComponent.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLComponent.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- XMLComponent.java 2000/10/02 00:40:16 1.1.2.2
+++ XMLComponent.java 2000/10/10 08:04:58 1.1.2.3
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999,2000 The Apache Software Foundation. All rights
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -62,37 +62,73 @@
import org.xml.sax.SAXNotSupportedException;
/**
+ * The component interface defines methods that must be implemented
+ * by components in a parser configuration. The component methods allow
+ * the component manager to initialize the component state and notify
+ * the component when feature and property values change.
+ *
+ * @see XMLComponentManager
+ *
* @author Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000
- * @version $Id: XMLComponent.java,v 1.1.2.2 2000/10/02 00:40:16 lehors Exp $
+ * @author Andy Clark, IBM
+ *
+ * @version $Id: XMLComponent.java,v 1.1.2.3 2000/10/10 08:04:58 andyc Exp $
*/
public interface XMLComponent {
//
- // Methods
+ // XMLComponent methods
//
/**
- * reset
+ * Resets the component. The component can query the component manager
+ * about any features and properties that affect the operation of the
+ * component.
*
- * @param configurationManager
+ * @param componentManager The component manager.
+ *
+ * @throws SAXException Thrown by component on initialization error.
+ * For example, if a feature or property is
+ * required for the operation of the component, the
+ * component manager may throw a
+ * SAXNotRecognizedException or a
+ * SAXNotSupportedException.
*/
- public void reset(XMLComponentManager configurationManager)
+ public void reset(XMLComponentManager componentManager)
throws SAXException;
/**
- * setFeature
+ * Sets the state of a feature. This method is called by the component
+ * manager any time after reset when a feature changes state.
+ * <p>
+ * <strong>Note:</strong> Components should silently ignore features
+ * that do not affect the operation of the component.
*
- * @param featureId
- * @param state
+ * @param featureId The feature identifier.
+ * @param state The state of the feature.
+ *
+ * @throws SAXNotRecognizedException The component should not throw
+ * this exception.
+ * @throws SAXNotSupportedException The component should not throw
+ * this exception.
*/
public void setFeature(String featureId, boolean state)
throws SAXNotRecognizedException, SAXNotSupportedException;
/**
- * setProperty
+ * Sets the value of a property. This method is called by the component
+ * manager any time after reset when a property changes value.
+ * <p>
+ * <strong>Note:</strong> Components should silently ignore properties
+ * that do not affect the operation of the component.
*
- * @param propertyId
- * @param value
+ * @param propertyId The property identifier.
+ * @param value The value of the property.
+ *
+ * @throws SAXNotRecognizedException The component should not throw
+ * this exception.
+ * @throws SAXNotSupportedException The component should not throw
+ * this exception.
*/
public void setProperty(String propertyId, Object value)
throws SAXNotRecognizedException, SAXNotSupportedException;
1.1.2.3 +27 -9 xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLComponentManager.java
Index: XMLComponentManager.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLComponentManager.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- XMLComponentManager.java 2000/10/02 00:40:16 1.1.2.2
+++ XMLComponentManager.java 2000/10/10 08:04:58 1.1.2.3
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999,2000 The Apache Software Foundation. All rights
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -61,31 +61,49 @@
import org.xml.sax.SAXNotSupportedException;
/**
+ * The component manager manages a parser configuration and the components
+ * that make up that configuration. The manager notifies each component
+ * before parsing to allow the components to initialize their state; and
+ * also any time that a parser feature or property changes.
+ * <p>
+ * The methods of the component manager allow components to query features
+ * and properties that affect the operation of the component.
+ *
+ * @see XMLComponent
+ *
* @author Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000
- * @version $Id: XMLComponentManager.java,v 1.1.2.2 2000/10/02 00:40:16 lehors Exp $
+ * @author Andy Clark, IBM
+ *
+ * @version $Id: XMLComponentManager.java,v 1.1.2.3 2000/10/10 08:04:58 andyc Exp $
*/
public interface XMLComponentManager {
//
- // Methods
+ // XMLComponentManager methods
//
/**
- * getFeature
+ * Returns the state of a feature.
*
- * @param featureId
+ * @param featureId The feature identifier.
*
- * @return
+ * @throws SAXNotRecognizedException Thrown if the feature is not
+ * recognized.
+ * @throws SAXNotSupportedException Thrown if the feature is not
+ * supported.
*/
public boolean getFeature(String featureId)
throws SAXNotRecognizedException, SAXNotSupportedException;
/**
- * getProperty
+ * Returns the value of a property.
*
- * @param propertyId
+ * @param propertyId The property identifier.
*
- * @return
+ * @throws SAXNotRecognizedException Thrown if the feature is not
+ * recognized.
+ * @throws SAXNotSupportedException Thrown if the feature is not
+ * supported.
*/
public Object getProperty(String propertyId)
throws SAXNotRecognizedException, SAXNotSupportedException;
1.1.2.2 +15 -2 xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDTDContentModelFilter.java
Index: XMLDTDContentModelFilter.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDTDContentModelFilter.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- XMLDTDContentModelFilter.java 2000/10/02 00:32:48 1.1.2.1
+++ XMLDTDContentModelFilter.java 2000/10/10 08:04:58 1.1.2.2
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999,2000 The Apache Software Foundation. All rights
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -58,8 +58,21 @@
package org.apache.xerces.xni;
/**
+ * A DTD content model filter acts as both a DTD content model handler
+ * and a DTD content model source.
+ * <p>
+ * A pipeline of DTD content model components starts with a DTD content
+ * model source; is followed by zero or more DTD content model filters;
+ * and ends with a DTD content model handler.
+ *
+ * @see XMLDTDContentModelSource
+ * @see XMLDTDContentModelHandler
+ * @see XMLDTDHandler
+ *
* @author Stubs generated by DesignDoc on Sun Oct 01 16:53:37 PDT 2000
- * @version $Id: XMLDTDContentModelFilter.java,v 1.1.2.1 2000/10/02 00:32:48 andyc Exp $
+ * @author Andy Clark, IBM
+ *
+ * @version $Id: XMLDTDContentModelFilter.java,v 1.1.2.2 2000/10/10 08:04:58 andyc Exp $
*/
public interface XMLDTDContentModelFilter
extends XMLDTDContentModelHandler, XMLDTDContentModelSource {
1.1.2.4 +242 -40 xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDTDContentModelHandler.java
Index: XMLDTDContentModelHandler.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDTDContentModelHandler.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- XMLDTDContentModelHandler.java 2000/10/06 16:40:10 1.1.2.3
+++ XMLDTDContentModelHandler.java 2000/10/10 08:04:58 1.1.2.4
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999,2000 The Apache Software Foundation. All rights
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -60,103 +60,305 @@
import org.xml.sax.SAXException;
/**
+ * The DTD content model handler interface defines callback methods
+ * to report information items in DTD content models of an element
+ * declaration. Parser components interested in DTD content model
+ * information implement this interface and are registered as the DTD
+ * content model handler on the DTD content model source.
+ * <p>
+ * A pipeline of DTD content model components starts with a DTD content
+ * model source; is followed by zero or more DTD content model filters;
+ * and ends with a DTD content model handler.
+ *
+ * @see XMLDTDContentModelSource
+ * @see XMLDTDContentModelFilter
+ * @see XMLDTDHandler
+ *
* @author Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000
- * @version $Id: XMLDTDContentModelHandler.java,v 1.1.2.3 2000/10/06 16:40:10 jeffreyr Exp $
+ * @author Andy Clark, IBM
+ *
+ * @version $Id: XMLDTDContentModelHandler.java,v 1.1.2.4 2000/10/10 08:04:58 andyc Exp $
*/
public interface XMLDTDContentModelHandler {
//
// Constants
//
+
+ // content model types
- /** TYPE_EMPTY */
+ /**
+ * Empty content model type. The element is not allowed to contain
+ * any content except for ignorable whitespace.
+ * <p>
+ * For example:
+ * <pre>
+ * <!ELEMENT elem EMPTY>
+ * </pre>
+ *
+ * @see TYPE_ANY
+ * @see TYPE_MIXED
+ * @see TYPE_CHILDREN
+ */
public static final short TYPE_EMPTY = 0;
- /** TYPE_ANY */
+ /**
+ * Any content model type. The element may contain any declared elements
+ * or text content.
+ * <p>
+ * For example:
+ * <pre>
+ * <!ELEMENT elem ANY>
+ * </pre>
+ *
+ * @see TYPE_EMPTY
+ * @see TYPE_MIXED
+ * @see TYPE_CHILDREN
+ */
public static final short TYPE_ANY = 1;
- /** TYPE_MIXED */
+ /**
+ * A mixed content model. The element can contain specified elements or
+ * text content.
+ * <p>
+ * For example:
+ * <pre>
+ * <!ELEMENT elem1 (#PCDATA)>
+ * <!ELEMENT elem2 (#PCDATA|foo|bar)*>
+ * </pre>
+ *
+ * @see TYPE_EMPTY
+ * @see TYPE_ANY
+ * @see TYPE_CHILDREN
+ */
public static final short TYPE_MIXED = 2;
- /** TYPE_CHILDREN */
+ /**
+ * A children content model. The element can contain specified elements
+ * as sequences or choices and with specified occurrence counts.
+ * <p>
+ * For example:
+ * <pre>
+ * <!ELEMENT elem1 (foo)>
+ * <!ELEMENT elem2 (foo?)>
+ * <!ELEMENT elem3 (foo*)>
+ * <!ELEMENT elem4 (foo+)>
+ * <!ELEMENT elem5 (foo,bar)>
+ * <!ELEMENT elem6 (foo|bar)>
+ * <!ELEMENT elem7 (foo|(bar,baz)+)>
+ * </pre>
+ *
+ * @see TYPE_EMPTY
+ * @see TYPE_ANY
+ * @see TYPE_MIXED
+ * @see SEPARATOR_CHOICE
+ * @see SEPARATOR_SEQUENCE
+ * @see OCCURS_ZERO_OR_ONE
+ * @see OCCURS_ZERO_OR_MORE
+ * @see OCCURS_ONE_OR_MORE
+ */
public static final short TYPE_CHILDREN = 3;
- /** SEPARATOR_CHOICE */
+ // children model separators
+
+ /**
+ * A choice separator for children content models. This separator is used
+ * to specify that the allowed child is one of a collection.
+ * <p>
+ * For example:
+ * <pre>
+ * <!ELEMENT elem (foo|bar)>
+ * <!ELEMENT elem (foo|bar+)>
+ * <!ELEMENT elem (foo|bar|baz)>
+ * </pre>
+ *
+ * @see SEPARATOR_SEQUENCE
+ * @see TYPE_CHILDREN
+ */
public static final short SEPARATOR_CHOICE = 4;
- /** SEPARATOR_SEQUENCE */
+ /**
+ * A sequence separator for children content models. This separator is
+ * used to specify that the allowed children must follow in the
+ * specified sequence.
+ * <p>
+ * <pre>
+ * <!ELEMENT elem (foo,bar)>
+ * <!ELEMENT elem (foo,bar*)>
+ * <!ELEMENT elem (foo,bar,baz)>
+ * </pre>
+ *
+ * @see SEPARATOR_SEQUENCE
+ * @see TYPE_CHILDREN
+ */
public static final short SEPARATOR_SEQUENCE = 5;
+
+ // children model occurrence counts
- /** OCCURS_ZERO_OR_ONE */
+ /**
+ * This occurrence count limits the element, choice, or sequence in a
+ * children content model to zero or one. In other words, the child
+ * is optional.
+ * <p>
+ * For example:
+ * <pre>
+ * <!ELEMENT elem (foo?)>
+ * </pre>
+ *
+ * @see OCCURS_ZERO_OR_MORE
+ * @see OCCURS_ONE_OR_MORE
+ * @see TYPE_CHILDREN
+ */
public static final short OCCURS_ZERO_OR_ONE = 6;
- /** OCCURS_ZERO_OR_MORE */
+ /**
+ * This occurrence count limits the element, choice, or sequence in a
+ * children content model to zero or more. In other words, the child
+ * may appear an arbitrary number of times, or not at all.
+ * <p>
+ * For example:
+ * <pre>
+ * <!ELEMENT elem (foo*)>
+ * </pre>
+ *
+ * @see OCCURS_ZERO_OR_ONE
+ * @see OCCURS_ONE_OR_MORE
+ * @see TYPE_CHILDREN
+ */
public static final short OCCURS_ZERO_OR_MORE = 7;
- /** OCCURS_ONE_OR_MORE */
+ /**
+ * This occurrence count limits the element, choice, or sequence in a
+ * children content model to one or more. In other words, the child
+ * may appear an arbitrary number of times, but must appear at least
+ * once.
+ * <p>
+ * For example:
+ * <pre>
+ * <!ELEMENT elem (foo+)>
+ * </pre>
+ *
+ * @see OCCURS_ZERO_OR_ONE
+ * @see OCCURS_ZERO_OR_MORE
+ * @see TYPE_CHILDREN
+ */
public static final short OCCURS_ONE_OR_MORE = 8;
//
- // Methods
+ // XMLDTDContentModelHandler methods
//
/**
- * startContentModel
+ * The start of a content model. Depending on the type of the content
+ * model, specific methods may be called between the call to the
+ * startContentModel method and the call to the endContentModel method.
*
- * @param elementName
- * @param type
+ * @param elementName The name of the element.
+ * @param type The content model type.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see TYPE_EMPTY
+ * @see TYPE_ANY
+ * @see TYPE_MIXED
+ * @see TYPE_CHILDREN
*/
public void startContentModel(String elementName, short type)
throws SAXException;
/**
- * mixedElement
+ * A referenced element in a mixed content model. If the mixed content
+ * model only allows text content, then this method will not be called
+ * for that model. However, if this method is called for a mixed
+ * content model, then the zero or more occurrence count is implied.
+ * <p>
+ * <strong>Note:</strong> This method is only called after a call to
+ * the startContentModel method where the type is TYPE_MIXED.
*
- * @param elementName
+ * @param elementName The name of the referenced element.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see TYPE_MIXED
*/
- public void mixedElement(String elementName)
- throws SAXException;
+ public void mixedElement(String elementName) throws SAXException;
/**
- * childrenStartGroup
+ * The start of a children group.
+ * <p>
+ * <strong>Note:</strong> This method is only called after a call to
+ * the startContentModel method where the type is TYPE_CHILDREN.
+ * <p>
+ * <strong>Note:</strong> Children groups can be nested and have
+ * associated occurrence counts.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see TYPE_CHILDREN
*/
- public void childrenStartGroup()
- throws SAXException;
+ public void childrenStartGroup() throws SAXException;
/**
- * childrenElement
+ * A referenced element in a children content model.
*
- * @param elementName
+ * @param elementName The name of the referenced element.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see TYPE_CHILDREN
*/
- public void childrenElement(String elementName)
- throws SAXException;
+ public void childrenElement(String elementName) throws SAXException;
/**
- * childrenSeparator
+ * The separator between choices or sequences of a children content
+ * model.
+ * <p>
+ * <strong>Note:</strong> This method is only called after a call to
+ * the startContentModel method where the type is TYPE_CHILDREN.
*
- * @param separator
+ * @param separator The type of children separator.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see SEPARATOR_CHOICE
+ * @see SEPARATOR_SEQUENCE
+ * @see TYPE_CHILDREN
*/
- public void childrenSeparator(short separator)
- throws SAXException;
+ public void childrenSeparator(short separator) throws SAXException;
/**
- * childrenOccurrence
+ * The occurrence count for a child in a children content model.
+ * <p>
+ * <strong>Note:</strong> This method is only called after a call to
+ * the startContentModel method where the type is TYPE_CHILDREN.
*
- * @param occurrence
+ * @param occurrence The occurrence count for the last children element
+ * or children group.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see OCCURS_ZERO_OR_ONE
+ * @see OCCURS_ZERO_OR_MORE
+ * @see OCCURS_ONE_OR_MORE
+ * @see TYPE_CHILDREN
*/
- public void childrenOccurrence(short occurrence)
- throws SAXException;
+ public void childrenOccurrence(short occurrence) throws SAXException;
/**
- * childrenEndGroup
+ * The end of a children group.
+ * <p>
+ * <strong>Note:</strong> This method is only called after a call to
+ * the startContentModel method where the type is TYPE_CHILDREN.
+ *
+ * @see TYPE_CHILDREN
*/
- public void childrenEndGroup()
- throws SAXException;
+ public void childrenEndGroup() throws SAXException;
/**
- * endContentModel
+ * The end of a content model.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void endContentModel()
- throws SAXException;
+ public void endContentModel() throws SAXException;
} // interface XMLDTDContentModelHandler
1.1.2.3 +18 -5 xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDTDContentModelSource.java
Index: XMLDTDContentModelSource.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDTDContentModelSource.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- XMLDTDContentModelSource.java 2000/10/02 00:40:16 1.1.2.2
+++ XMLDTDContentModelSource.java 2000/10/10 08:04:58 1.1.2.3
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999,2000 The Apache Software Foundation. All rights
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -58,19 +58,32 @@
package org.apache.xerces.xni;
/**
+ * Classes that implement this interface act as sources for DTD content
+ * model information items.
+ * <p>
+ * A pipeline of DTD content model components starts with a DTD content
+ * model source; is followed by zero or more DTD content model filters;
+ * and ends with a DTD content model handler.
+ *
+ * @see XMLDTDContentModelHandler
+ * @see XMLDTDContentModelFilter
+ * @see XMLDTDHandler
+ *
* @author Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000
- * @version $Id: XMLDTDContentModelSource.java,v 1.1.2.2 2000/10/02 00:40:16 lehors Exp $
+ * @author Andy Clark, IBM
+ *
+ * @version $Id: XMLDTDContentModelSource.java,v 1.1.2.3 2000/10/10 08:04:58 andyc Exp $
*/
public interface XMLDTDContentModelSource {
//
- // Methods
+ // XMLDTDContentModelSource methods
//
/**
- * setDTDContentModelHandler
+ * Sets the DTD content model handler.
*
- * @param dtdContentModelHandler
+ * @param dtdContentModelHandler The DTD content model handler.
*/
public void setDTDContentModelHandler(XMLDTDContentModelHandler dtdContentModelHandler);
1.1.2.2 +13 -2 xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDTDFilter.java
Index: XMLDTDFilter.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDTDFilter.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- XMLDTDFilter.java 2000/10/02 00:32:49 1.1.2.1
+++ XMLDTDFilter.java 2000/10/10 08:04:58 1.1.2.2
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999,2000 The Apache Software Foundation. All rights
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -58,8 +58,19 @@
package org.apache.xerces.xni;
/**
+ * A DTD filter acts as both a DTD handler and a DTD source.
+ * <p>
+ * A pipeline of DTD components starts with a DTD source; is followed by
+ * zero or more DTD filters; and ends with a DTD handler.
+ *
+ * @see XMLDTDSource
+ * @see XMLDTDHandler
+ * @see XMLDTDContentModelHandler
+ *
* @author Stubs generated by DesignDoc on Sun Oct 01 16:53:37 PDT 2000
- * @version $Id: XMLDTDFilter.java,v 1.1.2.1 2000/10/02 00:32:49 andyc Exp $
+ * @author Andy Clark, IBM
+ *
+ * @version $Id: XMLDTDFilter.java,v 1.1.2.2 2000/10/10 08:04:58 andyc Exp $
*/
public interface XMLDTDFilter
extends XMLDTDHandler, XMLDTDSource {
1.1.2.4 +185 -77 xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDTDHandler.java
Index: XMLDTDHandler.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDTDHandler.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- XMLDTDHandler.java 2000/10/06 16:38:18 1.1.2.3
+++ XMLDTDHandler.java 2000/10/10 08:04:58 1.1.2.4
@@ -63,157 +63,265 @@
import org.xml.sax.SAXException;
/**
+ * The DTD handler interface defines callback methods to report
+ * information items in the DTD of an XML document. Parser components
+ * interested in DTD information implement this interface and are
+ * registered as the DTD handler on the DTD source.
+ * <p>
+ * A pipeline of DTD components starts with a DTD source; is followed
+ * by zero or more DTD filters; and ends with a DTD handler.
+ *
+ * @see XMLDTDSource
+ * @see XMLDTDFilter
+ * @see XMLDTDContentModelHandler
+ *
* @author Stubs generated by DesignDoc on Mon Sep 18 18:23:16 PDT 2000
- * @version $Id: XMLDTDHandler.java,v 1.1.2.3 2000/10/06 16:38:18 jeffreyr Exp $
+ * @author Andy Clark, IBM
+ *
+ * @version $Id: XMLDTDHandler.java,v 1.1.2.4 2000/10/10 08:04:58 andyc Exp $
*/
-public interface XMLDTDHandler
- extends XMLEntityHandler {
+public interface XMLDTDHandler {
//
// Constants
//
- /** CONDITIONAL_INCLUDE */
+ /** Conditional section: INCLUDE. */
public static final short CONDITIONAL_INCLUDE = 0;
- /** CONDITIONAL_IGNORE */
+ /** Conditional section: IGNORE. */
public static final short CONDITIONAL_IGNORE = 1;
//
- // Methods
+ // XMLDTDHandler methods
//
/**
- * startDTD
- */
- public void startDTD()
- throws SAXException;
-
- /**
- * comment
+ * This method notifies of the start of an entity. The DTD has the
+ * pseudo-name of "[dtd]; and parameter entity names start with '%'.
+ * <p>
+ * <strong>Note:</strong> Since the DTD is an entity, the handler
+ * will be notified of the start of the DTD entity by calling the
+ * startEntity method with the entity name "[dtd]" <em>before</em> calling
+ * the startDTD method.
*
- * @param text
+ * @param name The name of the entity.
+ * @param publicId The public identifier of the entity if the entity
+ * is external, null otherwise.
+ * @param systemId The system identifier of the entity if the entity
+ * is external, null otherwise.
+ * @param encoding The auto-detected IANA encoding name of the entity
+ * stream. This value will be null in those situations
+ * where the entity encoding is not auto-detected (e.g.
+ * internal parameter entities).
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ */
+ public void startEntity(String name, String publicId, String systemId,
+ String encoding) throws SAXException;
+
+ /**
+ * The start of the DTD.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void comment(XMLString text)
- throws SAXException;
+ public void startDTD() throws SAXException;
/**
- * processingInstruction
+ * A comment.
*
- * @param target
- * @param data
+ * @param text The text in the comment.
+ *
+ * @throws SAXException Thrown by application to signal an error.
+ */
+ public void comment(XMLString text) throws SAXException;
+
+ /**
+ * A processing instruction. Processing instructions consist of a
+ * target name and, optionally, text data. The data is only meaningful
+ * to the application.
+ * <p>
+ * Typically, a processing instruction's data will contain a series
+ * of pseudo-attributes. These pseudo-attributes follow the form of
+ * element attributes but are <strong>not</strong> parsed or presented
+ * to the application as anything other than text. The application is
+ * responsible for parsing the data.
+ *
+ * @param target The target.
+ * @param data The data or null if none specified.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void processingInstruction(String target, XMLString data)
throws SAXException;
/**
- * startExternalSubset
+ * The start of the external subset.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void startExternalSubset()
- throws SAXException;
+ public void startExternalSubset() throws SAXException;
/**
- * endExternalSubset
+ * The end of the external subset.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void endExternalSubset()
- throws SAXException;
+ public void endExternalSubset() throws SAXException;
/**
- * elementDecl
+ * An element declaration.
*
- * @param name
- * @param contentModel
+ * @param name The name of the element.
+ * @param contentModel The element content model.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void elementDecl(String name, XMLString contentModel)
throws SAXException;
/**
- * startAttlist
+ * The start of an attribute list.
*
- * @param elementName
+ * @param elementName The name of the element that this attribute
+ * list is associated with.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void startAttlist(String elementName)
- throws SAXException;
+ public void startAttlist(String elementName) throws SAXException;
/**
- * attributeDecl
+ * An attribute declaration.
*
- * @param elementName
- * @param attributeName
- * @param type
- * @param enumeration
- * @param defaultType
- * @param defaultValue
- */
- public void attributeDecl(String elementName, String attributeName, String type, String[] enumeration, String defaultType, XMLString defaultValue)
+ * @param elementName The name of the element that this attribute
+ * is associated with.
+ * @param attributeName The name of the attribute.
+ * @param type The attribute type. This value will be one of
+ * the following: "CDATA", "ENTITY", "ENTITIES",
+ * "ENUMERATION", "ID", "IDREF", "IDREFS",
+ * "NMTOKEN", "NMTOKENS", or "NOTATION".
+ * @param enumeration If the type has the value "ENUMERATION", this
+ * array holds the allowed attribute values;
+ * otherwise, this array is null.
+ * @param defaultType The attribute default type. This value will be
+ * one of the following: "#FIXED", "#IMPLIED",
+ * "#REQUIRED", or null.
+ * @param defaultValue The attribute default value, or null if no
+ * default value is specified.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ */
+ public void attributeDecl(String elementName, String attributeName,
+ String type, String[] enumeration,
+ String defaultType, XMLString defaultValue)
throws SAXException;
/**
- * endAttlist
+ * The end of an attribute list.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void endAttlist()
- throws SAXException;
+ public void endAttlist() throws SAXException;
/**
- * internalEntityDecl
+ * An internal entity declaration.
*
- * @param name
- * @param text
- * @param isPE
+ * @param name The name of the entity. Parameter entity names start with
+ * '%', whereas the name of a general entity is just the
+ * entity name.
+ * @param text The value of the entity.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void internalEntityDecl(String name, XMLString text, boolean isPE)
+ public void internalEntityDecl(String name, XMLString text)
throws SAXException;
/**
- * externalEntityDecl
+ * An external entity declaration.
*
- * @param name
- * @param publicId
- * @param systemId
- * @param isPE
+ * @param name The name of the entity. Parameter entity names start
+ * with '%', whereas the name of a general entity is just
+ * the entity name.
+ * @param publicId The public identifier of the entity or null if the
+ * the entity was specified with SYSTEM.
+ * @param systemId The system identifier of the entity.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void externalEntityDecl(String name, String publicId, String systemId, boolean isPE)
+ public void externalEntityDecl(String name,
+ String publicId, String systemId)
throws SAXException;
/**
- * unparsedEntityDecl
+ * An unparsed entity declaration.
*
- * @param name
- * @param publicId
- * @param systemId
- * @param notation
- */
- public void unparsedEntityDecl(String name, String publicId, String systemId, String notation)
- throws SAXException;
+ * @param name The name of the entity.
+ * @param publicId The public identifier of the entity, or null if not
+ * specified.
+ * @param systemId The system identifier of the entity, or null if not
+ * specified.
+ * @param notation The name of the notation.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ */
+ public void unparsedEntityDecl(String name,
+ String publicId, String systemId,
+ String notation) throws SAXException;
/**
- * notationDecl
+ * A notation declaration
*
- * @param name
- * @param publicId
- * @param systemId
+ * @param name The name of the notation.
+ * @param publicId The public identifier of the notation, or null if not
+ * specified.
+ * @param systemId The system identifier of the notation, or null if not
+ * specified.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void notationDecl(String name, String publicId, String systemId)
throws SAXException;
/**
- * startConditional
+ * The start of a conditional section.
*
- * @param type
+ * @param type The type of the conditional section. This value will
+ * either be CONDITIONAL_INCLUDE or CONDITIONAL_IGNORE.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ *
+ * @see CONDITIONAL_INCLUDE
+ * @see CONDITIONAL_IGNORE
*/
- public void startConditional(short type)
- throws SAXException;
+ public void startConditional(short type) throws SAXException;
/**
- * endConditional
+ * The end of a conditional section.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void endConditional()
- throws SAXException;
+ public void endConditional() throws SAXException;
/**
- * endDTD
+ * The end of the DTD.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void endDTD()
- throws SAXException;
+ public void endDTD() throws SAXException;
+
+ /**
+ * This method notifies the end of an entity. The DTD has the pseudo-name
+ * of "[dtd]; and parameter entity names start with '%'.
+ * <p>
+ * <strong>Note:</strong> Since the DTD is an entity, the handler
+ * will be notified of the end of the DTD entity by calling the
+ * endEntity method with the entity name "[dtd]" <em>after</em> calling
+ * the endDTD method.
+ *
+ * @param name The name of the entity.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ */
+ public void endEntity(String name) throws SAXException;
} // interface XMLDTDHandler
1.1.2.3 +17 -5 xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDTDSource.java
Index: XMLDTDSource.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDTDSource.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- XMLDTDSource.java 2000/10/02 00:40:16 1.1.2.2
+++ XMLDTDSource.java 2000/10/10 08:04:58 1.1.2.3
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999,2000 The Apache Software Foundation. All rights
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -58,19 +58,31 @@
package org.apache.xerces.xni;
/**
+ * Classes that implement this interface act as sources for DTD information
+ * items.
+ * <p>
+ * A pipeline of DTD components starts with a DTD source; is followed
+ * by zero or more DTD filters; and ends with a DTD handler.
+ *
+ * @see XMLDTDHandler
+ * @see XMLDTDFilter
+ * @see XMLDTDContentModelHandler
+ *
* @author Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000
- * @version $Id: XMLDTDSource.java,v 1.1.2.2 2000/10/02 00:40:16 lehors Exp $
+ * @author Andy Clark, IBM
+ *
+ * @version $Id: XMLDTDSource.java,v 1.1.2.3 2000/10/10 08:04:58 andyc Exp $
*/
public interface XMLDTDSource {
//
- // Methods
+ // XMLDTDSource methods
//
/**
- * setDTDHandler
+ * Sets the DTD handler.
*
- * @param dtdHandler
+ * @param dtdHandler The DTD handler.
*/
public void setDTDHandler(XMLDTDHandler dtdHandler);
1.1.2.2 +13 -2 xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDocumentFilter.java
Index: XMLDocumentFilter.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDocumentFilter.java,v
retrieving revision 1.1.2.1
retrieving revision 1.1.2.2
diff -u -r1.1.2.1 -r1.1.2.2
--- XMLDocumentFilter.java 2000/10/02 00:32:47 1.1.2.1
+++ XMLDocumentFilter.java 2000/10/10 08:04:59 1.1.2.2
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999,2000 The Apache Software Foundation. All rights
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -58,8 +58,19 @@
package org.apache.xerces.xni;
/**
+ * A document filter acts as both a document handler and a document source.
+ * <p>
+ * A pipeline of document components starts with a document source; is
+ * followed by zero or more document filters; and ends with a document
+ * handler.
+ *
+ * @see XMLDocumentSource
+ * @see XMLDocumentHandler
+ *
* @author Stubs generated by DesignDoc on Sun Oct 01 16:53:37 PDT 2000
- * @version $Id: XMLDocumentFilter.java,v 1.1.2.1 2000/10/02 00:32:47 andyc Exp $
+ * @author Andy Clark, IBM
+ *
+ * @version $Id: XMLDocumentFilter.java,v 1.1.2.2 2000/10/10 08:04:59 andyc Exp $
*/
public interface XMLDocumentFilter
extends XMLDocumentHandler, XMLDocumentSource {
1.1.2.5 +171 -48 xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDocumentHandler.java
Index: XMLDocumentHandler.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDocumentHandler.java,v
retrieving revision 1.1.2.4
retrieving revision 1.1.2.5
diff -u -r1.1.2.4 -r1.1.2.5
--- XMLDocumentHandler.java 2000/10/06 17:50:03 1.1.2.4
+++ XMLDocumentHandler.java 2000/10/10 08:04:59 1.1.2.5
@@ -64,124 +64,247 @@
import org.xml.sax.SAXException;
/**
+ * The document handler interface defines callback methods to report
+ * information items in XML documents. Parser components interested in
+ * document information implement this interface and are registered
+ * as the document handler on the document source.
+ * <p>
+ * A pipeline of document components starts with a document source; is
+ * followed by zero or more document filters; and ends with a document
+ * handler.
+ *
+ * @see XMLDocumentSource
+ * @see XMLDocumentFilter
+ *
* @author Stubs generated by DesignDoc on Mon Sep 18 18:23:16 PDT 2000
- * @version $Id: XMLDocumentHandler.java,v 1.1.2.4 2000/10/06 17:50:03 andyc Exp $
+ * @author Andy Clark, IBM
+ *
+ * @version $Id: XMLDocumentHandler.java,v 1.1.2.5 2000/10/10 08:04:59 andyc Exp $
*/
-public interface XMLDocumentHandler
- extends XMLEntityHandler {
+public interface XMLDocumentHandler {
//
- // Methods
+ // XMLDocumentHandler methods
//
/**
- * startDocument
+ * This method notifies the start of an entity. The document entity has
+ * the pseudo-name of "[xml]"; and general entities are just specified
+ * by their name.
+ * <p>
+ * <strong>Note:</strong> Since the document is an entity, the handler
+ * will be notified of the start of the document entity by calling the
+ * startEntity method with the entity name "[xml]" <em>before</em> calling
+ * the startDocument method. When exposing entity boundaries through the
+ * SAX API, the document entity is never reported, however.
+ * <p>
+ * <strong>Note:</strong> This method is not called for entity references
+ * appearing as part of attribute values.
+ *
+ * @param name The name of the entity.
+ * @param publicId The public identifier of the entity if the entity
+ * is external, null otherwise.
+ * @param systemId The system identifier of the entity if the entity
+ * is external, null otherwise.
+ * @param encoding The auto-detected IANA encoding name of the entity
+ * stream. This value will be null in those situations
+ * where the entity encoding is not auto-detected (e.g.
+ * internal entities or a document entity that is
+ * parsed from a java.io.Reader).
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ */
+ public void startEntity(String name, String publicId, String systemId,
+ String encoding) throws SAXException;
+
+ /**
+ * Notifies of the presence of a TextDecl line in an entity. If present,
+ * this method will be called immediately following the startEntity call.
+ * <p>
+ * <strong>Note:</strong> This method will never be called for the
+ * document entity; it is only called for external general entities
+ * referenced in document content.
+ * <p>
+ * <strong>Note:</strong> This method is not called for entity references
+ * appearing as part of attribute values.
+ *
+ * @param version The XML version, or null if not specified.
+ * @param encoding The IANA encoding name of the entity.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
+ public void textDecl(String version, String encoding) throws SAXException;
+
+ /**
+ * The start of the document.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ */
public void startDocument() throws SAXException;
/**
- * xmlDecl
- *
- * @param version
- * @param encoding
- * @param standalone
+ * Notifies of the presence of an XMLDecl line in the document. If
+ * present, this method will be called immediately following the
+ * startDocument call.
+ *
+ * @param version The XML version.
+ * @param encoding The IANA encoding name of the document, or null if
+ * not specified.
+ * @param standalone The standalone value, or null if not specified.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void xmlDecl(String version, String encoding, String standalone)
throws SAXException;
/**
- * doctypeDecl
+ * Notifies of the presence of the DOCTYPE line in the document.
*
- * @param rootElement
- * @param publicId
- * @param systemId
+ * @param rootElement The name of the root element.
+ * @param publicId The public identifier if an external DTD or null
+ * if the external DTD is specified using SYSTEM.
+ * @param systemId The system identifier if an external DTD, null
+ * otherwise.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void doctypeDecl(String rootElement, String publicId, String systemId)
throws SAXException;
/**
- * comment
+ * A comment.
*
- * @param text
+ * @param text The text in the comment.
+ *
+ * @throws SAXException Thrown by application to signal an error.
*/
public void comment(XMLString text) throws SAXException;
/**
- * processingInstruction
- *
- * @param target
- * @param data
+ * A processing instruction. Processing instructions consist of a
+ * target name and, optionally, text data. The data is only meaningful
+ * to the application.
+ * <p>
+ * Typically, a processing instruction's data will contain a series
+ * of pseudo-attributes. These pseudo-attributes follow the form of
+ * element attributes but are <strong>not</strong> parsed or presented
+ * to the application as anything other than text. The application is
+ * responsible for parsing the data.
+ *
+ * @param target The target.
+ * @param data The data or null if none specified.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void processingInstruction(String target, XMLString data)
throws SAXException;
/**
- * startPrefixMapping
+ * The start of a namespace prefix mapping. This method will only be
+ * called when namespace processing is enabled.
*
- * @param prefix
- * @param uri
+ * @param prefix The namespace prefix.
+ * @param uri The URI bound to the prefix.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void startPrefixMapping(String prefix, String uri)
throws SAXException;
/**
- * startElement
- *
- * @param element
- * @param attributes
+ * The start of an element. If the document specifies the start element
+ * by using an empty tag, then the startElement method will immediately
+ * be followed by the endElement method, with no intervening methods.
+ *
+ * @param element The name of the element.
+ * @param attributes The element attributes.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void startElement(QName element, XMLAttributes attributes)
throws SAXException;
/**
- * characters
+ * Character content.
*
- * @param text
+ * @param text The content.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void characters(XMLString text) throws SAXException;
/**
- * ignorableWhitespace
- *
- * @param text
+ * Ignorable whitespace. For this method to be called, the document
+ * source must have some way of determining that the text containing
+ * only whitespace characters should be considered ignorable. For
+ * example, the validator can determine if a length of whitespace
+ * characters in the document are ignorable based on the element
+ * content model.
+ *
+ * @param text The ignorable whitespace.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void ignorableWhitespace(XMLString text) throws SAXException;
/**
- * endElement
+ * The end of an element.
*
- * @param element
+ * @param element The name of the element.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void endElement(QName element) throws SAXException;
/**
- * endPrefixMapping
+ * The end of a namespace prefix mapping. This method will only be
+ * called when namespace processing is enabled.
*
- * @param prefix
+ * @param prefix The namespace prefix.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void endPrefixMapping(String prefix) throws SAXException;
- /**
- * textDecl
- *
- * @param version
- * @param encoding
- */
- public void textDecl(String version, String encoding) throws SAXException;
-
- /**
- * startCDATA
+ /**
+ * The start of a CDATA section.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void startCDATA() throws SAXException;
/**
- * endCDATA
+ * The end of a CDATA section.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void endCDATA() throws SAXException;
/**
- * endDocument
+ * The end of the document.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void endDocument() throws SAXException;
+
+ /**
+ * This method notifies the end of an entity. The document entity has
+ * the pseudo-name of "[xml]"; and general entities are just specified
+ * by their name.
+ * <p>
+ * <strong>Note:</strong> Since the document is an entity, the handler
+ * will be notified of the end of the document entity by calling the
+ * endEntity method with the entity name "[xml]" <em>after</em> calling
+ * the endDocument method. When exposing entity boundaries through the
+ * SAX API, the document entity is never reported, however.
+ * <p>
+ * <strong>Note:</strong> This method is not called for entity references
+ * appearing as part of attribute values.
+ *
+ * @param name The name of the entity.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
+ */
+ public void endEntity(String name) throws SAXException;
} // interface XMLDocumentHandler
1.1.2.3 +17 -5 xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDocumentSource.java
Index: XMLDocumentSource.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLDocumentSource.java,v
retrieving revision 1.1.2.2
retrieving revision 1.1.2.3
diff -u -r1.1.2.2 -r1.1.2.3
--- XMLDocumentSource.java 2000/10/02 00:40:17 1.1.2.2
+++ XMLDocumentSource.java 2000/10/10 08:04:59 1.1.2.3
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999,2000 The Apache Software Foundation. All rights
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -58,19 +58,31 @@
package org.apache.xerces.xni;
/**
+ * Classes that implement this interface act as sources for document
+ * information items.
+ * <p>
+ * A pipeline of document components starts with a document source; is
+ * followed by zero or more document filters; and ends with a document
+ * handler.
+ *
+ * @see XMLDocumentHandler
+ * @see XMLDocumentFilter
+ *
* @author Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000
- * @version $Id: XMLDocumentSource.java,v 1.1.2.2 2000/10/02 00:40:17 lehors Exp $
+ * @author Andy Clark, IBM
+ *
+ * @version $Id: XMLDocumentSource.java,v 1.1.2.3 2000/10/10 08:04:59 andyc Exp $
*/
public interface XMLDocumentSource {
//
- // Methods
+ // XMLDocumentSource methods
//
/**
- * setDocumentHandler
+ * Sets the document handler to receive information about the document.
*
- * @param documentHandler
+ * @param documentHandler The document handler.
*/
public void setDocumentHandler(XMLDocumentHandler documentHandler);
1.1.2.4 +35 -12 xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLEntityHandler.java
Index: XMLEntityHandler.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLEntityHandler.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- XMLEntityHandler.java 2000/10/02 23:19:17 1.1.2.3
+++ XMLEntityHandler.java 2000/10/10 08:04:59 1.1.2.4
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999,2000 The Apache Software Foundation. All rights
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -56,35 +56,58 @@
*/
package org.apache.xerces.xni;
+
import org.xml.sax.SAXException;
/**
+ * The entity handler interface defines methods to report information
+ * about the start and end of entities.
+ *
+ * @see org.apache.xerces.impl.XMLEntityScanner
+ *
* @author Stubs generated by DesignDoc on Mon Sep 18 18:23:16 PDT 2000
- * @version $Id: XMLEntityHandler.java,v 1.1.2.3 2000/10/02 23:19:17 andyc Exp $
+ * @author Andy Clark, IBM
+ *
+ * @version $Id: XMLEntityHandler.java,v 1.1.2.4 2000/10/10 08:04:59 andyc Exp $
*/
public interface XMLEntityHandler {
//
- // Methods
+ // XMLEntityHandler methods
//
/**
- * startEntity
+ * This method notifies of the start of an entity. The document entity
+ * has the pseudo-name of "[xml]"; the DTD has the pseudo-name of "[dtd];
+ * parameter entity names start with '%'; and general entities are just
+ * specified by their name.
*
- * @param name
- * @param publicId
- * @param systemId
- * @param encoding
+ * @param name The name of the entity.
+ * @param publicId The public identifier of the entity if the entity
+ * is external, null otherwise.
+ * @param systemId The system identifier of the entity if the entity
+ * is external, null otherwise.
+ * @param encoding The auto-detected IANA encoding name of the entity
+ * stream. This value will be null in those situations
+ * where the entity encoding is not auto-detected (e.g.
+ * internal entities or a document entity that is
+ * parsed from a java.io.Reader).
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
public void startEntity(String name, String publicId, String systemId,
String encoding) throws SAXException;
/**
- * endEntity
+ * This method notifies the end of an entity. The document entity has
+ * the pseudo-name of "[xml]"; the DTD has the pseudo-name of "[dtd];
+ * parameter entity names start with '%'; and general entities are just
+ * specified by their name.
*
- * @param name
+ * @param name The name of the entity.
+ *
+ * @throws SAXException Thrown by handler to signal an error.
*/
- public void endEntity(String name)
- throws SAXException;
+ public void endEntity(String name) throws SAXException;
} // interface XMLEntityHandler
1.1.2.4 +76 -44 xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLString.java
Index: XMLString.java
===================================================================
RCS file: /home/cvs/xml-xerces/java/src/org/apache/xerces/xni/Attic/XMLString.java,v
retrieving revision 1.1.2.3
retrieving revision 1.1.2.4
diff -u -r1.1.2.3 -r1.1.2.4
--- XMLString.java 2000/10/03 18:40:38 1.1.2.3
+++ XMLString.java 2000/10/10 08:04:59 1.1.2.4
@@ -2,7 +2,7 @@
* The Apache Software License, Version 1.1
*
*
- * Copyright (c) 1999,2000 The Apache Software Foundation. All rights
+ * Copyright (c) 2000 The Apache Software Foundation. All rights
* reserved.
*
* Redistribution and use in source and binary forms, with or without
@@ -58,9 +58,28 @@
package org.apache.xerces.xni;
/**
+ * This class is used as a structure to pass text contained in the underlying
+ * character buffer of the scanner. The offset and length fields allow the
+ * buffer to be re-used without creating new character arrays.
+ * <p>
+ * <strong>Note:</strong> Methods that are passed an XMLString structure
+ * should consider the contents read-only and not make any modifications
+ * to the contents of the buffer. The method receiving this structure
+ * should also not modify the offset and length if this structure (or
+ * the values of this structure) are passed to another method.
+ * <p>
+ * <strong>Note:</strong> Methods that are passed an XMLString structure
+ * are required to copy the information out of the buffer if it is to be
+ * saved for use beyond the scope of the method. The contents of the
+ * structure are volatile and the contents of the character buffer cannot
+ * be assured once the method that is passed this structure returns.
+ * Therefore, methods passed this structure should not save any reference
+ * to the structure or the character array contained in the structure.
+ *
* @author Stubs generated by DesignDoc on Mon Sep 11 11:10:57 PDT 2000
* @author Eric Ye
- * @version $Id: XMLString.java,v 1.1.2.3 2000/10/03 18:40:38 lehors Exp $
+ *
+ * @version $Id: XMLString.java,v 1.1.2.4 2000/10/10 08:04:59 andyc Exp $
*/
public class XMLString {
@@ -68,79 +87,93 @@
// Data
//
- /** ch */
+ /** The character array. */
public char[] ch;
- /** offset */
+ /** The offset into the character array. */
public int offset;
- /** length */
+ /** The length of characters from the offset. */
public int length;
//
// Constructors
//
- /**
- *
- */
+ /** Default constructor. */
public XMLString() {
- }
+ } // <init>()
/**
+ * Constructs an XMLString structure preset with the specified
+ * values.
*
- *
- * @param ch
- * @param offset
- * @param length
+ * @param ch The character array.
+ * @param offset The offset into the character array.
+ * @param length The length of characters from the offset.
*/
public XMLString(char[] ch, int offset, int length) {
setValues(ch, offset, length);
- }
+ } // <init>(char[],int,int)
+ /**
+ * Constructs an XMLString structure with copies of the values in
+ * the given structure.
+ * <p>
+ * <strong>Note:</strong> This does not copy the character array;
+ * only the reference to the array is copied.
+ *
+ * @param string The XMLString to copy.
+ */
+ public XMLString(XMLString string) {
+ setValues(string);
+ } // <init>(XMLString)
+
//
- // Methods
+ // Public methods
//
/**
- * setValues
+ * Initializes the contents of the XMLString structure with the
+ * specified values.
*
- * @param ch
- * @param offset
- * @param length
+ * @param ch The character array.
+ * @param offset The offset into the character array.
+ * @param length The length of characters from the offset.
*/
public void setValues(char[] ch, int offset, int length) {
this.ch = ch;
this.offset = offset;
this.length = length;
- } // setValues
+ } // setValues(char[],int,int)
/**
- * setValues
+ * Initializes the contents of the XMLString structure with copies
+ * of the given string structure.
+ * <p>
+ * <strong>Note:</strong> This does not copy the character array;
+ * only the reference to the array is copied.
*
* @param s
*/
public void setValues(XMLString s) {
setValues(s.ch, s.offset, s.length);
- } // setValues
+ } // setValues(XMLString)
- /**
- * clear
- */
+ /** Resets all of the values to their defaults. */
public void clear() {
this.ch = null;
this.offset = 0;
this.length = 0;
- } // clear
+ } // clear()
/**
- * equals
- *
- * @param ch
- * @param offset
- * @param length
+ * Returns true if the contents of this XMLString structure and
+ * the specified array are equal.
*
- * @return
+ * @param ch The character array.
+ * @param offset The offset into the character array.
+ * @param length The length of characters from the offset.
*/
public boolean equals(char[] ch, int offset, int length) {
if (ch == null) {
@@ -156,14 +189,13 @@
}
}
return true;
- } // equals
+ } // equals(char[],int,int):boolean
/**
- * equals
- *
- * @param s
+ * Returns true if the contents of this XMLString structure and
+ * the specified string are equal.
*
- * @return
+ * @param s The string to compare.
*/
public boolean equals(String s) {
if (s == null) {
@@ -183,15 +215,15 @@
}
return true;
- } // equals
+ } // equals(String):boolean
- /**
- * toString
- *
- * @return
- */
+ //
+ // Object methods
+ //
+
+ /** Returns a string representation of this object. */
public String toString() {
return new String(ch, offset, length);
- } // toString
+ } // toString():String
} // class XMLString