|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--org.enhydra.xml.xmlc.dom.DocTypeBuilder
Class for building a DOM DocumentType. Used by XMLC parsers to build a document DOM.
Since the DOM level 1 does not address storing all of the information from the DOCTYPE and DTDs required by XMLC, routine are provided to add this information. Only a subset of the information is actually saved. The internal subset is needed to reproduce the DOCTYPE declaration in the compiled document. The attribute declarations from the external subset are needed to build the table of ID attributes used to generate access methods.
Constructor Summary | |
DocTypeBuilder(XMLCDomFactory domFactory)
Constructor. |
Method Summary | |
void |
addAttributeDecl(String elementName,
String attrName,
String attrType,
String attrEnum,
String defaultDecl,
boolean internalSubset)
Add an attribute declaration. |
void |
addElementDecl(String name,
String contentSpec,
boolean internalSubset)
Add a document type declaration. |
void |
addEntityReference(String name,
boolean internalSubset)
Add an EntityReference object. |
void |
addExternalEntityDecl(String name,
String systemId,
String publicId,
boolean paramEntity,
boolean internalSubset)
Add an external entity. |
void |
addIdAttribute(String elementName,
String attributeName,
boolean internalSubset)
Define an element id attribute. |
void |
addInternalEntityDecl(String name,
String entityValue,
boolean paramEntity,
boolean internalSubset)
Add an internal entity. |
void |
addNotationDecl(String name,
String systemId,
String publicId,
boolean internalSubset)
Add a notation. |
void |
addUnparsedEntityDecl(String name,
String notationName,
boolean internalSubset)
Add an unparsed entity. |
DocumentType |
getCreateDocType()
Get the document type object, creating if necessary. |
String |
getDocumentTypeName()
Get the document type name (rootElement). |
String |
getIdAttribute(String elementName)
Get the id attribute name for an element. |
String |
getInternalSubset()
Get the internal subset as a single string. |
String |
getPublicId()
Get the publicId. |
String |
getSystemId()
Get the systemId. |
void |
setDocumentTypeName(String name)
Set the document type name (rootElement). |
void |
setInternalSubset(String subsetStr)
Add internal subset as a single string. |
void |
setPublicId(String publicId)
Set the publicId. |
void |
setSystemId(String systemId)
Set the systemId. |
Methods inherited from class java.lang.Object |
|
Constructor Detail |
public DocTypeBuilder(XMLCDomFactory domFactory)
domFactory
- Factory class for Documents.Method Detail |
public DocumentType getCreateDocType()
public void setDocumentTypeName(String name)
name
- The Document type name (also root node name).public String getDocumentTypeName()
public void setPublicId(String publicId)
publicId
- Document type public id or null if standalone.public String getPublicId()
public void setSystemId(String systemId)
systemId
- Document type system id or null if standalone.public String getSystemId()
public void addIdAttribute(String elementName, String attributeName, boolean internalSubset)
elementName
- The name of the element.attributeName
- The name of the ID attribute.internalSubset
- Is this part of the internal or
external subset? Internal declarations take precedence.public String getIdAttribute(String elementName)
elementName
- The name of the element.public void addEntityReference(String name, boolean internalSubset)
entity
- The name of the entity.internalSubset
- Is this part of the internal or
external subset?public void addElementDecl(String name, String contentSpec, boolean internalSubset)
name
- The element name.contentSpec
- The content specification.internalSubset
- Is this part of the internal or
external subset?public void addAttributeDecl(String elementName, String attrName, String attrType, String attrEnum, String defaultDecl, boolean internalSubset)
elementName
- The element name.attrName
- The attribute name.attrType
- The attribute type specification:
CDATA, ID, IDREF, IDREFS, NMTOKEN, NMTOKENS,
ENTITY, ENTITIES, NOTATION or ENUMERATION.attrEnum
- - Enumeration for NOTATION and ENUMERATION.defaultDecl
- The default value declaration,
REQUIRED, IMPLIED, FIXED (or DEFAULT).internalSubset
- Is this part of the internal or
external subset?public void addInternalEntityDecl(String name, String entityValue, boolean paramEntity, boolean internalSubset)
name
- The entity name.entityValue
- The value of the entity.paramEntity
- Is this a parameter or general entity?internalSubset
- Is this part of the internal or
external subset?public void addExternalEntityDecl(String name, String systemId, String publicId, boolean paramEntity, boolean internalSubset)
name
- The entity name.systemId
- Document type system id.publicId
- Document type public id, or null if not specified.paramEntity
- Is this a parameter or general entity?internalSubset
- Is this part of the internal or
external subset?public void addUnparsedEntityDecl(String name, String notationName, boolean internalSubset)
name
- The entity name.notationName
- The notation the entity references.internalSubset
- Is this part of the internal or
external subset?public void addNotationDecl(String name, String systemId, String publicId, boolean internalSubset)
name
- The notation name.systemId
- Document type system id.publicId
- Document type public id, or null if not specified.internalSubset
- Is this part of the internal or
external subset?public void setInternalSubset(String subsetStr)
public String getInternalSubset()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |