com.conradroche.matra.decl
Class Entity

java.lang.Object
  |
  +--com.conradroche.matra.decl.Entity
All Implemented Interfaces:
Entity, ExternalID
Direct Known Subclasses:
GeneralEntity, ParameterEntity

public class Entity
extends java.lang.Object
implements Entity

CR: TODO: Add javadoc for Entity

Author:
Conrad Roche

Field Summary
static int EXT_ID_NONE
           
static int EXT_ID_PUBLIC
           
static int EXT_ID_SYSTEM
           
static int GLOBAL_ENTITY
           
static int PARAMETER_ENTITY
           
 
Constructor Summary
Entity()
          Entity constructor.
Entity(java.lang.String content)
          Insert the method's description here.
Entity(java.lang.String content, java.util.Hashtable EntityList)
          Insert the method's description here.
Entity(java.lang.String name, java.lang.String value, int type)
          Entity constructor.
 
Method Summary
 java.lang.String getEntityName()
          Insert the method's description here.
 int getExternalIDType()
          Insert the method's description here.
 java.lang.String getLiteralValue()
          Insert the method's description here.
 java.lang.String getPublicIdentifier()
          Insert the method's description here.
 java.lang.String getReplacementText()
          Returns the replacement text for this Entity.
 java.lang.String getResolvedValue(java.util.Hashtable EntityList)
          Insert the method's description here.
 java.lang.String getSystemIdentifier()
          Insert the method's description here.
 int getType()
          Insert the method's description here.
 boolean hasPublicIdentifier()
          Returns true if the Public Identifier is specified.
 boolean hasSystemIdentifier()
          Returns true if the System Identifier is specified.
 boolean isExternalEntity()
          Returns true if this entity is an external entity; false otherwise.
 boolean isGeneralEntity()
          Returns true if the Entity is a General Entity and false otherwise.
 boolean isInternalEntity()
          Returns true if this entity is an internal entity; false otherwise.
 boolean isParameterEntity()
          Returns true if the Entity is a Parameter Entity and false otherwise.
 boolean isParsedEntity()
          Returns true if this entity is an parsed entity; false otherwise.
 boolean isResolved()
          Insert the method's description here.
 boolean isUnparsedEntity()
          Returns true if this entity is an parsed entity; false otherwise.
 void resolveValue(java.util.Hashtable entityList)
          Insert the method's description here.
 void setEntityName(java.lang.String newName)
          Insert the method's description here.
 void setLiteralValue(java.lang.String newValue)
          Insert the method's description here.
 void setPublicIdentifier(java.lang.String publicId)
          Sets the Public Identifier.
 void setSystemIdentifier(java.lang.String systemId)
          Sets the System Identifier.
 void setType(int newType)
          Insert the method's description here.
 java.lang.String toString()
          Insert the method's description here.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PARAMETER_ENTITY

public static final int PARAMETER_ENTITY

GLOBAL_ENTITY

public static final int GLOBAL_ENTITY

EXT_ID_NONE

public static final int EXT_ID_NONE

EXT_ID_SYSTEM

public static final int EXT_ID_SYSTEM

EXT_ID_PUBLIC

public static final int EXT_ID_PUBLIC
Constructor Detail

Entity

public Entity()
Entity constructor.

Entity

public Entity(java.lang.String name,
              java.lang.String value,
              int type)
Entity constructor.

Entity

public Entity(java.lang.String content)
       throws DTDException
Insert the method's description here.
Parameters:
content - java.lang.String

Entity

public Entity(java.lang.String content,
              java.util.Hashtable EntityList)
       throws DTDException
Insert the method's description here.
Parameters:
content - java.lang.String
Method Detail

getExternalIDType

public int getExternalIDType()
Insert the method's description here.
Returns:
int

getEntityName

public java.lang.String getEntityName()
Insert the method's description here.
Specified by:
getEntityName in interface Entity
Returns:
java.lang.String

getPublicIdentifier

public java.lang.String getPublicIdentifier()
Insert the method's description here.
Specified by:
getPublicIdentifier in interface ExternalID
Returns:
java.lang.String

setPublicIdentifier

public void setPublicIdentifier(java.lang.String publicId)
Sets the Public Identifier.
Specified by:
setPublicIdentifier in interface ExternalID
Parameters:
The - Public Identifier

getResolvedValue

public java.lang.String getResolvedValue(java.util.Hashtable EntityList)
Insert the method's description here.
Returns:
java.lang.String

getSystemIdentifier

public java.lang.String getSystemIdentifier()
Insert the method's description here.
Specified by:
getSystemIdentifier in interface ExternalID
Returns:
java.lang.String

setSystemIdentifier

public void setSystemIdentifier(java.lang.String systemId)
Sets the System Identifier.
Specified by:
setSystemIdentifier in interface ExternalID
Parameters:
systemId - The System Identifier

getType

public int getType()
Insert the method's description here.
Returns:
int

getLiteralValue

public java.lang.String getLiteralValue()
Insert the method's description here.
Specified by:
getLiteralValue in interface Entity
Returns:
java.lang.String

getReplacementText

public java.lang.String getReplacementText()
Returns the replacement text for this Entity. From the XML 1.0 Specification - [Definition: The replacement text is the content of the entity, after replacement of character references and parameter-entity references.]
Specified by:
getReplacementText in interface Entity
Returns:
The replacement text.

isInternalEntity

public boolean isInternalEntity()
Returns true if this entity is an internal entity; false otherwise. From the XML 1.0 Specifications - [Definition: If the entity definition is an EntityValue, the defined entity is called an internal entity. There is no separate physical storage object, and the content of the entity is given in the declaration.] Note that some processing of entity and character references in the literal entity literalValue may be required to produce the correct replacement text
Specified by:
isInternalEntity in interface Entity
Returns:
true if this entity is an internal entity; false otherwise.

isExternalEntity

public boolean isExternalEntity()
Returns true if this entity is an external entity; false otherwise. Add javadoc for Entity::isExternalEntity From the XML 1.0 Specifications - Definition: If the entity is not internal, it is an external entity
Specified by:
isExternalEntity in interface Entity
Returns:
true if this entity is an external entity; false otherwise.

isParsedEntity

public boolean isParsedEntity()
Returns true if this entity is an parsed entity; false otherwise. From XML 1.0 Specifications - [Definition: A parsed entity's contents are referred to as its replacement text; this text is considered an integral part of the document.]
Specified by:
isParsedEntity in interface Entity
Returns:
true if this entity is an parsed entity; false otherwise.

isUnparsedEntity

public boolean isUnparsedEntity()
Returns true if this entity is an parsed entity; false otherwise. From XML 1.0 Specifications - [Definition: An unparsed entity is a resource whose contents may or may not be text, and if text, may be other than XML. Each unparsed entity has an associated notation, identified by name. Beyond a requirement that an XML processor make the identifiers for the entity and notation available to the application, XML places no constraints on the contents of unparsed entities.]
Specified by:
isUnparsedEntity in interface Entity
Returns:
true if this entity is an parsed entity; false otherwise.

isResolved

public boolean isResolved()
Insert the method's description here.
Returns:
boolean

resolveValue

public void resolveValue(java.util.Hashtable entityList)
                  throws DTDException
Insert the method's description here.
Parameters:
newValue - java.lang.String

setEntityName

public void setEntityName(java.lang.String newName)
Insert the method's description here.
Specified by:
setEntityName in interface Entity
Parameters:
newName - java.lang.String

setType

public void setType(int newType)
Insert the method's description here.
Parameters:
newType - int

setLiteralValue

public void setLiteralValue(java.lang.String newValue)
Insert the method's description here.
Specified by:
setLiteralValue in interface Entity
Parameters:
newValue - java.lang.String

toString

public java.lang.String toString()
Insert the method's description here.
Overrides:
toString in class java.lang.Object
Returns:
java.lang.String

isGeneralEntity

public boolean isGeneralEntity()
Description copied from interface: Entity
Returns true if the Entity is a General Entity and false otherwise.
Specified by:
isGeneralEntity in interface Entity
Following copied from interface: com.conradroche.dtd.decl.Entity
Returns:
true for General Entity and false otherwise.

isParameterEntity

public boolean isParameterEntity()
Description copied from interface: Entity
Returns true if the Entity is a Parameter Entity and false otherwise.
Specified by:
isParameterEntity in interface Entity
Following copied from interface: com.conradroche.dtd.decl.Entity
Returns:
true for Parameter Entity and false otherwise.

hasSystemIdentifier

public boolean hasSystemIdentifier()
Description copied from interface: ExternalID
Returns true if the System Identifier is specified.
Specified by:
hasSystemIdentifier in interface ExternalID
Following copied from interface: com.conradroche.dtd.decl.ExternalID
Returns:
true if the System Identifier is specified false otherwise.

hasPublicIdentifier

public boolean hasPublicIdentifier()
Description copied from interface: ExternalID
Returns true if the Public Identifier is specified.
Specified by:
hasPublicIdentifier in interface ExternalID
Following copied from interface: com.conradroche.dtd.decl.ExternalID
Returns:
true if the Public Identifier is specified false otherwise.