All Packages Class Hierarchy This Package Previous Next Index
Class com.ibm.xml.parser.DTD
java.lang.Object
|
+----com.ibm.xml.parser.Child
|
+----com.ibm.xml.parser.Parent
|
+----com.ibm.xml.parser.DTD
- public class DTD
- extends Parent
- implements DocumentType
This class represents "<!DOCTYPE ...>
"
- Version:
- 19980206
-
CM_ANY
- Return value of getContentType(String).
-
CM_EMPTY
- Return value of getContentType(String).
-
CM_EOC
- A symbol for getInsertableElements() / getAppendableElements().
-
CM_ERROR
- A symbol for getInsertableElements() / getAppendableElements().
-
CM_PCDATA
- A symbol for getInsertableElements() / getAppendableElements().
-
CM_REGULAR
- Return value of getContentType(String).
-
addElement(Child)
- Add child.
-
checkContent(TXElement)
- Check if specified element has correct content.
-
checkID(String)
-
-
clone()
- Clone this instance.
-
getAppendableElements(TXElement, Hashtable)
-
-
getAttributeDeclaration(String, String)
- Return declaration of specified attribute.
-
getAttributeDeclarations(String)
- Return all attribute declarations of Element en
in Enumeration of AttDef.
-
getChildren()
- [DOM]
Deprecated.
-
getChildrenArray()
- Return internal subset of DTD.
-
getContentType(String)
- Return content type of specified element.
-
getElementDeclaration(String)
- Return an element declaration.
-
getElementDeclarations()
- Return all element declarations
in Enumeration of
ElementDecl
.
-
getElementsByTagName(String)
- [DOM] Not implemented.
Deprecated.
-
getElementTypes()
- [DOM] Not implemented.
Deprecated.
-
getEntities()
- Return
Enumeration
of EntityValue
.
-
getExternalSubset()
- [DOM] Not implemented.
Deprecated.
-
getFirstChild()
- [DOM]
Deprecated.
-
getInsertableElements(TXElement, int, Hashtable)
- Make a table which shows what kind of Element you can inset to specified position of Element el.
-
getInternalSubset()
- [DOM] Not implemented.
Deprecated.
-
getName()
- [DOM] Get a root element name.
-
getNodeType()
- [DOM] Not impelmented.
Deprecated.
-
getNotation(String)
- Return a notation with specified name.
-
getNotationEnumeration()
- Return notations.
-
getNotations()
- [DOM] Not implemented.
Deprecated.
-
getText()
- Return "".
-
hasChildren()
- [DOM]
Deprecated.
-
IDs()
- Enumerate all IDs.
-
insert(Child, int)
-
Deprecated.
-
insertBefore(Node, Node)
- [DOM]
Deprecated.
-
insertBeforeSilently(Node, Node)
-
Deprecated.
-
isAttributeDeclared(String, String)
- Check if declaration of specified attribute exists.
-
isElementDeclared(String)
- Check if specified element is declared.
-
prepareTable(String)
- Make a table for getInsertableElements() / getAppendableElements().
-
print(PrintWriter, String, int)
- Print.
-
registID(Element, String)
-
-
removeChild(Node)
- [DOM]
Deprecated.
-
removeChildSilenty(Node)
-
Deprecated.
-
replaceChild(Node, Node)
- [DOM]
Deprecated.
-
replaceChildSilently(Node, Node)
-
Deprecated.
-
setElementTypes(NamedNodeList)
- [DOM] Not implemented.
Deprecated.
-
setExternalSubset(NodeList)
- [DOM] Not implemented.
Deprecated.
-
setInternalSubset(NodeList)
- [DOM] Not implemented.
Deprecated.
-
setName(String)
- [DOM] Set a root element name.
-
setNotations(NamedNodeList)
- [DOM] Not implemented.
Deprecated.
CM_REGULAR
public static final int CM_REGULAR
- Return value of getContentType(String).
This means the element has content model like regular expression (including mixed content).
CM_EMPTY
public static final int CM_EMPTY
- Return value of getContentType(String).
This means the element can has no content.
CM_ANY
public static final int CM_ANY
- Return value of getContentType(String).
This means the element may has any children.
CM_EOC
public static final String CM_EOC
- A symbol for getInsertableElements() / getAppendableElements().
CM_ERROR
public static final String CM_ERROR
- A symbol for getInsertableElements() / getAppendableElements().
CM_PCDATA
public static final String CM_PCDATA
- A symbol for getInsertableElements() / getAppendableElements().
getNodeType
public int getNodeType()
- Note: getNodeType() is deprecated.
Not implemented.
- [DOM] Not impelmented.
- Overrides:
- getNodeType in class Child
setName
public void setName(String name)
- [DOM] Set a root element name.
getName
public String getName()
- [DOM] Get a root element name.
setExternalSubset
public void setExternalSubset(NodeList externalSubset)
- Note: setExternalSubset() is deprecated.
Not implemented.
- [DOM] Not implemented.
getExternalSubset
public NodeList getExternalSubset()
- Note: getExternalSubset() is deprecated.
Not implemented.
- [DOM] Not implemented.
setInternalSubset
public void setInternalSubset(NodeList internalSubset)
- Note: setInternalSubset() is deprecated.
Not implemented.
- [DOM] Not implemented.
getInternalSubset
public NodeList getInternalSubset()
- Note: getInternalSubset() is deprecated.
Not implemented.
- [DOM] Not implemented.
setNotations
public void setNotations(NamedNodeList notations)
- Note: setNotations() is deprecated.
Not implemented.
- [DOM] Not implemented.
getNotations
public NamedNodeList getNotations()
- Note: getNotations() is deprecated.
Not implemented.
- [DOM] Not implemented.
setElementTypes
public void setElementTypes(NamedNodeList elementTypes)
- Note: setElementTypes() is deprecated.
Not implemented.
- [DOM] Not implemented.
getElementTypes
public NamedNodeList getElementTypes()
- Note: getElementTypes() is deprecated.
Not implemented.
- [DOM] Not implemented.
getChildren
public NodeList getChildren()
- Note: getChildren() is deprecated.
Not implemented.
- [DOM]
- Overrides:
- getChildren in class Parent
hasChildren
public boolean hasChildren()
- Note: hasChildren() is deprecated.
Not implemented.
- [DOM]
- Overrides:
- hasChildren in class Parent
getFirstChild
public Node getFirstChild()
- Note: getFirstChild() is deprecated.
Not implemented.
- [DOM]
- Overrides:
- getFirstChild in class Parent
insert
public void insert(Child ch,
int ind)
- Note: insert() is deprecated.
Not implemented.
- Overrides:
- insert in class Parent
insertBefore
public void insertBefore(Node newChild,
Node refChild)
- Note: insertBefore() is deprecated.
Not implemented.
- [DOM]
- Overrides:
- insertBefore in class Parent
insertBeforeSilently
public void insertBeforeSilently(Node newChild,
Node refChild)
- Note: insertBeforeSilently() is deprecated.
Not implemented.
- Overrides:
- insertBeforeSilently in class Parent
replaceChild
public Node replaceChild(Node oldChild,
Node newChild)
- Note: replaceChild() is deprecated.
Not implemented.
- [DOM]
- Overrides:
- replaceChild in class Parent
replaceChildSilently
public Node replaceChildSilently(Node oldChild,
Node newChild)
- Note: replaceChildSilently() is deprecated.
Not implemented.
removeChild
public Node removeChild(Node oldChild)
- Note: removeChild() is deprecated.
Not implemented.
- [DOM]
- Overrides:
- removeChild in class Parent
removeChildSilenty
public Node removeChildSilenty(Node oldChild)
- Note: removeChildSilenty() is deprecated.
Not implemented.
getElementsByTagName
public NodeEnumerator getElementsByTagName(String name)
- Note: getElementsByTagName() is deprecated.
Not implemented.
- [DOM] Not implemented.
- Overrides:
- getElementsByTagName in class Parent
clone
public synchronized Object clone()
- Clone this instance.
Note: checkID() isn't work in the clone.
- Overrides:
- clone in class Child
- See Also:
- checkID
addElement
public void addElement(Child a)
- Add child.
- Overrides:
- addElement in class Parent
getChildrenArray
public Child[] getChildrenArray()
- Return internal subset of DTD.
- Overrides:
- getChildrenArray in class Parent
getAttributeDeclarations
public Enumeration getAttributeDeclarations(String en)
- Return all attribute declarations of Element en
in Enumeration of AttDef.
getAttributeDeclaration
public AttDef getAttributeDeclaration(String en,
String an)
- Return declaration of specified attribute.
- Parameters:
- en - element name
- an - attribute name
isAttributeDeclared
public boolean isAttributeDeclared(String en,
String an)
- Check if declaration of specified attribute exists.
- Parameters:
- en - element name
- an - attribute name
getElementDeclarations
public Enumeration getElementDeclarations()
- Return all element declarations
in Enumeration of
ElementDecl
.
- See Also:
- ElementDecl
getElementDeclaration
public ElementDecl getElementDeclaration(String ename)
- Return an element declaration.
isElementDeclared
public boolean isElementDeclared(String name)
- Check if specified element is declared.
getNotation
public Notation getNotation(String n)
- Return a notation with specified name.
getNotationEnumeration
public Enumeration getNotationEnumeration()
- Return notations.
- Returns:
- Enumeration of Notation
print
public void print(PrintWriter pw,
String enc,
int indent)
- Print.
- Overrides:
- print in class Child
checkContent
public boolean checkContent(TXElement t)
- Check if specified element has correct content.
- Returns:
- true if match; false if no <!ELEMENT ...> or if not match
getContentType
public int getContentType(String ename)
- Return content type of specified element.
- Parameters:
- ename - Element name
- Returns:
- DTD.CM_EMPTY or DTD.CM_ANY or DTD.CM_REGULAR; 0 if specified element is not declared.
prepareTable
public Hashtable prepareTable(String ename)
- Make a table for getInsertableElements() / getAppendableElements().
- Returns:
- null if specified element is not declared.
getInsertableElements
public Hashtable getInsertableElements(TXElement el,
int ind,
Hashtable ht)
- Make a table which shows what kind of Element you can inset to specified position of Element el.
The Hashtable instance consists of Element names as keys and
InsertableElement
as values.
Usage:
DTD dtd = ...;
Hashtable tab = dtd.prepareTable(el.getName());
dtd.getInsertableElements(el, n, tab);
You can know following information with tab instance.
ie = (InsertableElement)tab.get(DTD.CM_ERROR)
ie.status
means whether el has incorrect contents or not in a subsequence of children [0, n-1].
When ie.status
is true
,
ie.index
is an index number of first wrong Element.
ie = (InsertableElement)tab.get(DTD.CM_EOC)
ie.status
means whether el has complete contents or not in a subsequence of children [0, n-1].
You might be able to insert elements to el
even when ie.status
is true
.
ie = (InsertableElement)tab.get(DTD.CM_PCDATA)
ie.status == false
: You can't insert a TextElement
instance to el.
ie.status == true
: You can. It doesn't mean el will always have correct contents after inserting a TextElement.
ie = (InsertableElement)tab.get("name")
ie == null
: in DTD.CM_ANY, specified element can be inserted.
In DTD.CM_EMPTY, specified element can not be inserted.
In DTD.CM_REGULAR, specified element can not be inserted.
ie.status == false
: You can't insert an Element instance of name to el.
ie.status == true
: You can. It doesn't mean el will always have correct contents after inserting an Element.
- Returns:
- null if the element isn't declared
- See Also:
- InsertableElement
getAppendableElements
public Hashtable getAppendableElements(TXElement el,
Hashtable ht)
- See Also:
- getInsertableElements
registID
public boolean registID(Element t,
String id)
- Returns:
- false when id is already registered.
checkID
public Element checkID(String id)
- Parameters:
- id - ID name
IDs
public Enumeration IDs()
- Enumerate all IDs.
- Returns:
- Enumeration of String
getText
public String getText()
- Return "".
- Overrides:
- getText in class Child
getEntities
public Enumeration getEntities()
- Return
Enumeration
of EntityValue
.
All Packages Class Hierarchy This Package Previous Next Index