|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.edustructures.sifworks.Element
public abstract class Element
The abstract base class for all element and attribute classes in the SIF Data Objects library.
Agent developers do not generally work with this class directly.
ElementDef
Each Element instance is associated with an ElementDef that both identifies
and describes the element or attribute encapsulated by this class. ElementDef
constants are defined by the SIFDTD class for each element and
attribute defined in the SIF Specification. These objects provide
information about how to render elements in a version-dependent way,
including the tag name and sequence number (which may vary from one version
of SIF to the next), the SDO implementation class name, the earliest version
of SIF the element or attribute appeared in, and the latest version of SIF
that supports the element or attribute.
An ElementDef must be provided to the constructor.
| Field Summary | |
|---|---|
static int |
CURRENT_SERIALIZE_VERSION
|
| Constructor Summary | |
|---|---|
Element(ElementDef def)
Constructor |
|
| Method Summary | |
|---|---|
int |
compareTo(Element target)
Compare the text value of this Element to another Element |
ElementDef |
getElementDef()
Gets the metadata for this Element |
Element |
getParent()
Gets the parent of this Element. |
Element |
getRoot()
Enumerating the ancestry of this object to return the root Element |
abstract SIFSimpleType |
getSIFValue()
Gets the SIF strongly-typed value of this element |
abstract java.lang.String |
getTextValue()
Gets the text value of this element if applicable. |
boolean |
isChanged()
Determines if this object is in the changed state. |
boolean |
isDoNotEncode()
Determines if automatic XML Encoding of character entities should be performed on this element when rendered by the ADK. |
boolean |
isEmpty()
Determines if this object is in the empty state |
void |
setChanged()
Sets this DataObject and each of its children to the dirty state. |
void |
setChanged(boolean changed)
Sets this DataObject and each of its children to the specified dirty state. |
void |
setDoNotEncode(boolean option)
Determines if automatic XML Encoding of character entities should be performed on this element when rendered by the ADK. |
void |
setElementDef(ElementDef def)
Sets the metadata for this Element. |
void |
setEmpty()
Sets this DataObject and each of its children to the empty state. |
void |
setEmpty(boolean empty)
Sets this DataObject and each of its children to the specified empty state. |
void |
setParent(Element parent)
Sets the parent of this Element. |
abstract void |
setSIFValue(SIFSimpleType value)
Sets the SIF strongly-typed value of this element |
abstract void |
setTextValue(java.lang.String value)
Sets the text value of this element if applicable. |
java.lang.String |
toString()
Returns the value of getTextValue |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
public static final int CURRENT_SERIALIZE_VERSION
| Constructor Detail |
|---|
public Element(ElementDef def)
def - The metadata that describes this Element| Method Detail |
|---|
public ElementDef getElementDef()
public void setElementDef(ElementDef def)
Note this method should not generally be called by agents because the
ElementDef metadata is established in the constructor. It is provided
in order to support the dynamic creation of Element instances by clients
that do not (or cannot) use reflection to call the default constructor.
These clients can call the Class.newInstance method followed
by setElementDef to construct an Element dynamically.
def - An ElementDef instance that describes this Elementpublic abstract java.lang.String getTextValue()
To change the format used for Text values on elements, set the
ADK.setTextFormatter(SIFFormatter) property
public abstract void setTextValue(java.lang.String value)
The formatter used for parsing by default is
the SIF 1.x formatter, which means this value must be able
to be parsed using SIF 1.x formatting rules.
To change the format used for Text values on elements, set the
ADK.setTextFormatter(SIFFormatter) property
value - The text value of this elementpublic abstract void setSIFValue(SIFSimpleType value)
value - The SIF Value to setpublic abstract SIFSimpleType getSIFValue()
public void setChanged()
public void setChanged(boolean changed)
changed - true to set the dirty state, false to clear itpublic void setEmpty()
public void setEmpty(boolean empty)
changed - true to set the empty state, false to clear itpublic boolean isChanged()
public boolean isEmpty()
public boolean isDoNotEncode()
true if automatic XML Encoding is disabled for this
element; false if enabled (the default)public void setDoNotEncode(boolean option)
option - true if automatic XML Encoding is disabled
for this element; false if enabled (the default)public int compareTo(Element target)
target - The Element to be compared
0 if the argument's text value is
lexicographically equal to this Element's text value; a value less
than 0 if the argument's value is lexicographically
greater than this Element's text value; and a value greater than
0 if the argument's text value is lexicographically
less than this Element's text value. If one Element's text value is
null and the others is not, a negative value is returned.public java.lang.String toString()
getTextValue
toString in class java.lang.Objectpublic Element getParent()
null if it has nonesetParent(com.edustructures.sifworks.Element)public void setParent(Element parent)
getParent()public Element getRoot()
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||