Package org.jdom
Class EntityRef
- java.lang.Object
-
- org.jdom.Content
-
- org.jdom.EntityRef
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
public class EntityRef extends Content
An XML entity reference. Methods allow the user to manage its name, public id, and system id.- Version:
- $Revision: 1.22 $, $Date: 2007/11/10 05:28:59 $
- Author:
- Brett McLaughlin, Jason Hunter, Philip Nelson
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Modifier Constructor Description protected
EntityRef()
Default, no-args constructor for implementations to use if needed.EntityRef(java.lang.String name)
This will create a newEntityRef
with the supplied name.EntityRef(java.lang.String name, java.lang.String systemID)
This will create a newEntityRef
with the supplied name and system id.EntityRef(java.lang.String name, java.lang.String publicID, java.lang.String systemID)
This will create a newEntityRef
with the supplied name, public id, and system id.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.String
getName()
This returns the name of theEntityRef
.java.lang.String
getPublicID()
This will return the publid ID of thisEntityRef
.java.lang.String
getSystemID()
This will return the system ID of thisEntityRef
.java.lang.String
getValue()
Returns the empty string since entity references don't have an XPath 1.0 string value.EntityRef
setName(java.lang.String name)
This will set the name of thisEntityRef
.EntityRef
setPublicID(java.lang.String publicID)
This will set the public ID of thisEntityRef
.EntityRef
setSystemID(java.lang.String systemID)
This will set the system ID of thisEntityRef
.java.lang.String
toString()
This returns aString
representation of theEntityRef
, suitable for debugging.-
Methods inherited from class org.jdom.Content
clone, detach, equals, getDocument, getParent, getParentElement, hashCode, setParent
-
-
-
-
Constructor Detail
-
EntityRef
protected EntityRef()
Default, no-args constructor for implementations to use if needed.
-
EntityRef
public EntityRef(java.lang.String name)
This will create a newEntityRef
with the supplied name.- Parameters:
name
-String
name of element.- Throws:
IllegalNameException
- if the given name is not a legal XML name.
-
EntityRef
public EntityRef(java.lang.String name, java.lang.String systemID)
This will create a newEntityRef
with the supplied name and system id.- Parameters:
name
-String
name of element.systemID
- system id of the entity reference being constructed- Throws:
IllegalNameException
- if the given name is not a legal XML name.IllegalDataException
- if the given system ID is not a legal system literal.
-
EntityRef
public EntityRef(java.lang.String name, java.lang.String publicID, java.lang.String systemID)
This will create a newEntityRef
with the supplied name, public id, and system id.- Parameters:
name
-String
name of element.publicID
- public id of the entity reference being constructedsystemID
- system id of the entity reference being constructed- Throws:
IllegalDataException
- if the given system ID is not a legal system literal or the the given public ID is not a legal public IDIllegalNameException
- if the given name is not a legal XML name.
-
-
Method Detail
-
getName
public java.lang.String getName()
This returns the name of theEntityRef
.- Returns:
String
- entity name.
-
getValue
public java.lang.String getValue()
Returns the empty string since entity references don't have an XPath 1.0 string value.
-
getPublicID
public java.lang.String getPublicID()
This will return the publid ID of thisEntityRef
. If there is no public ID, then this returnsnull
.- Returns:
- public ID of this
EntityRef
-
getSystemID
public java.lang.String getSystemID()
This will return the system ID of thisEntityRef
. If there is no system ID, then this returnsnull
.- Returns:
- system ID of this
EntityRef
-
setName
public EntityRef setName(java.lang.String name)
This will set the name of thisEntityRef
.- Parameters:
name
- new name of the entity- Returns:
- this
EntityRef
modified. - Throws:
IllegalNameException
- if the given name is not a legal XML name.
-
setPublicID
public EntityRef setPublicID(java.lang.String publicID)
This will set the public ID of thisEntityRef
.- Parameters:
publicID
- new public id- Returns:
- this
EntityRef
modified. - Throws:
IllegalDataException
- if the given public ID is not a legal public ID.
-
setSystemID
public EntityRef setSystemID(java.lang.String systemID)
This will set the system ID of thisEntityRef
.- Parameters:
systemID
- new system id- Returns:
- this
EntityRef
modified. - Throws:
IllegalDataException
- if the given system ID is not a legal system literal.
-
toString
public java.lang.String toString()
This returns aString
representation of theEntityRef
, suitable for debugging.- Overrides:
toString
in classjava.lang.Object
- Returns:
String
- information about theEntityRef
-
-