Class com.ibm.xml.parser.ExternalID
java.lang.Object
|
+----com.ibm.xml.parser.ExternalID
- public class ExternalID
- extends java.lang.Object
- implements java.io.Serializable
The ExternalID class provides support for external XML entities. External IDs are used,
for example, by DOM TXNotation Nodes. External IDs always contain a system ID
which is a URI. However, external IDs may also include a public ID which may
be used to try to generate an alternative URI. This can be very useful when a particular
entity is already widely available, and the XML processor is can use the public ID
to index into a local catalog of resources to retrieve the entity value. If valid,
public IDs are used in preference to system IDs.
- Version:
- Revision: 02 1.3 src/com/ibm/xml/parser/ExternalID.java, xml4jsrc, xml4j-jtcsv, xml4j_1_0_4
- See Also:
- TXNotation, Entity
Methods inherited from class java.lang.Object
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ExternalID
public ExternalID(java.lang.String systemID)
- Constructor for system IDs.
- Parameters:
systemID
- URI, which may be used to retrieve an external entity's content.
ExternalID
public ExternalID(java.lang.String publicID,
java.lang.String systemID)
- Constructor for public and system IDs.
- Parameters:
publicID
- Identifier to be used to try to generate an alternative URI in order to
retrieve the external entity's content, or null if
a system identitier is to be constructed.
systemID
- URI, which may be used to retrieve an external entity's content.
isSystem
public boolean isSystem()
- Returns if this external ID is a system ID (or public ID).
- Returns:
- System ID=true, Public ID=false.
- See Also:
- isPublic
isPublic
public boolean isPublic()
- Returns if this external ID is a public ID (or system ID).
- Returns:
- Public ID=true, System ID=false.
- See Also:
- isSystem
getSystemLiteral
public java.lang.String getSystemLiteral()
- Returns the system identifier of this external ID.
A system identifier is a URI, which may be used to retrieve an external entity's content.
- Returns:
- The system identifier, or null if the identifier is not defined.
- See Also:
- getPubidLiteral
getPubidLiteral
public java.lang.String getPubidLiteral()
- Returns the public identifier of this external ID. This value is only valid if the
identifier is defined as public (as opposed to system).
Public identifiers may be used to try to generate an alternative URI in order to
retrieve an external entity's content. If retrieval fails using
the public identifier, an attempt must be made to retrieve content using the system
identifier.
- Returns:
- The public identifier, or null if the identifier is not defined.
- See Also:
- getSystemLiteral
toString
public java.lang.String toString()
- Returns this external ID in the format it was declared:
SYSTEM "systemID"
or
PUBLIC "publicID" "systemID"
.
- Returns:
- XML string representing the content of the external ID (never null).
- Overrides:
- toString in class java.lang.Object