|
XML for Java Compatibility API 2.0.11 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ibm.xml.parser.Child | +--com.ibm.xml.parser.Parent | +--com.ibm.xml.parser.EntityDecl
The EntityDecl class represents entity declrations. Entities are useful in:
Internal entities have a value that is directly given in the entity declaration. For example:
<!ENTITY IBM "International Business Machines">
External entities refer to declarations to a storage unit by means of a SYSTEM or PUBLIC identifier. For example:
<!ENTITY IBM SYSTEM "ibm.xml">
..associates the name IBM
with the URL "ibm.xml"
.
XML4J must read the file referenced in order to find out the content of that entity.
As you might expect, external Entities contain External IDs in order to provide access to the resource. External entities can can be either text or binary resources. Text resources are XML-encoded resources, and are illustrated by this example:
<!ENTITY IBM SYSTEM "ibm.xml">
Binary entities are anything that is not XML-encoded. Binary entities always include a notation (ndata) which describes the type of resource. For example:
<!ENTITY IBMLogo SYSTEM "ibm.jpg" NDATA JPEG>
ExternalID
,
Parent
,
Entity
, Serialized FormFields inherited from class com.ibm.xml.parser.Child |
ATTDEF,
ATTLIST,
ELEMENT_DECL,
NAME_ATTDEF,
NAME_ATTLIST,
NAME_CDATA,
NAME_COMMENT,
NAME_DOCFRAGMENT,
NAME_DOCUMENT,
NAME_ELEMENT_DECL,
NAME_PSEUDONODE,
NAME_TEXT,
PSEUDONODE |
Constructor Summary | |
EntityDecl(java.lang.String name,
ExternalID externalID,
boolean isParameter,
java.lang.String ndata)
Constructor for external Entities. |
|
EntityDecl(java.lang.String name,
java.lang.String value,
boolean isParameter)
Constructor for internal Entities. |
Method Summary | |
void |
acceptPost(Visitor visitor)
Implements the accept operation of the visitor design pattern when the end of an Entity Node is recognized when traversing the document object tree. |
void |
acceptPre(Visitor visitor)
Implements the accept operation of the visitor design pattern when the start of an Entity Node is recognized when traversing the document object tree. |
protected void |
checkChildType(org.w3c.dom.Node child)
Check whether child is allowed to be insered in this node or not. |
java.lang.Object |
clone()
Clone this EntityDecl using the appropriate factory. |
org.w3c.dom.Node |
cloneNode(boolean deep)
Clone the EntityDecl node. |
boolean |
equals(org.w3c.dom.Node arg,
boolean deep)
Compare two EntityDecl nodes. |
protected org.w3c.dom.Entity |
getEntityImpl()
Wrapper for DOM. |
ExternalID |
getExternalID()
Returns the external ID of this Entity. |
java.lang.String |
getName()
Deprecated. Use getNodeName() |
java.lang.String |
getNDATAType()
Deprecated. This method will be removed in future release. Use getNotationName(). |
java.lang.String |
getNodeName()
Returns the name associated with this Entity. |
short |
getNodeType()
Returns that this object is an Entity Node. |
java.lang.String |
getNotationName()
Returns the notation associated with this Entity. |
java.lang.String |
getPublicId()
Returns the public identifier of the Notation. |
java.lang.String |
getSystemId()
Returns the system identifier of the Notation. |
java.lang.String |
getValue()
Returns the value of this Entity. |
boolean |
isExternal()
Returns whether this entity value is external. |
boolean |
isNDATA()
Deprecated. This method will be removed in future release. |
boolean |
isParameter()
Returns whether this Entity is a parameter Entity. |
Methods inherited from class com.ibm.xml.parser.Parent |
addElement,
appendChild,
elements,
expandEntityReferences,
getChildNodes,
getChildrenArray,
getFirstChild,
getFirstWithoutReference,
getLastChild,
getLastWithoutReference,
getText,
hasChildNodes,
insert,
insertAfter,
insertBefore,
insertFirst,
insertLast,
processAfterRemove,
realInsert,
removeChild,
replaceChild |
Methods inherited from class com.ibm.xml.parser.Child |
clearDigest,
getAttributes,
getDigest,
getFactory,
getNextSibling,
getNextWithoutReference,
getNodeValue,
getOwnerDocument,
getParentNode,
getParentWithoutReference,
getPreviousSibling,
getPreviousWithoutReference,
getUserData,
makeXPointer,
print,
print,
searchAncestors,
searchAncestors,
setFactory,
setNodeValue,
setUserData,
toXMLString,
toXMLString |
Methods inherited from class java.lang.Object |
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public EntityDecl(java.lang.String name, java.lang.String value, boolean isParameter)
name
- Name of this Entity.value
- The XML-encoded value that was directly assigned to the Entity.isParameter
- =true if a parameter Entity; otherwise =false.public EntityDecl(java.lang.String name, ExternalID externalID, boolean isParameter, java.lang.String ndata)
name
- Name of the Entity.externalID
- The reference(s) to the external entity to retrieve.isParameter
- =true if a parameter Entity; otherwise =false.ndata
- The notation associated with the binary Entity, or null if
the Entity is a text Entity.ExternalID
Method Detail |
public java.lang.Object clone()
This method is defined by Child.
Child.clone()
public org.w3c.dom.Node cloneNode(boolean deep)
public boolean equals(org.w3c.dom.Node arg, boolean deep)
public short getNodeType()
This method is defined by DOM.
public java.lang.String getNodeName()
This method is defined by DOM.
public java.lang.String getName()
public boolean isParameter()
public java.lang.String getValue()
public java.lang.String getSystemId()
This method is defined by DOM.
ExternalID.getSystemLiteral()
public java.lang.String getPublicId()
This method is defined by DOM.
ExternalID
public ExternalID getExternalID()
ExternalID
public boolean isExternal()
ExternalID
public java.lang.String getNDATAType()
public java.lang.String getNotationName()
This method is defined by DOM.
public boolean isNDATA()
public void acceptPre(Visitor visitor) throws java.lang.Exception
visitor
- The implemention of the Visitor operation (toXMLString, digest, ...)Visitor
,
TreeTraversal
,
NonRecursivePreorderTreeTraversal
,
TreeTraversalException
public void acceptPost(Visitor visitor) throws java.lang.Exception
visitor
- The implemention of the Visitor operation (toXMLString, digest, ...)Visitor
,
TreeTraversal
,
NonRecursivePreorderTreeTraversal
,
TreeTraversalException
protected void checkChildType(org.w3c.dom.Node child) throws org.w3c.dom.DOMException
protected org.w3c.dom.Entity getEntityImpl()
|
XML for Java Compatibility API 2.0.11 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |