|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectnet.charlesames.utility.common.Disposable
net.charlesames.utility.entity.Entity
net.charlesames.utility.entity.WriteableEntity
public abstract class WriteableEntity
A WriteableEntity is an Entity whose contents can be saved to or loaded from a file.
Each subclass of WriteableEntity has a static XmlSpec instance that explains how data
should be either saved to an XML data element or recovered from an XML data element.
| Method Summary | |
|---|---|
boolean |
check(HtmlBuilder htmlBuilder)
Check this component for errors and inconsistencies |
static void |
clearXmlSpecs()
Clear all XML specification instances. |
static XmlSpec |
createXmlSpec(java.lang.Class<? extends WriteableEntity> entityClass,
java.lang.String tag,
java.lang.String description)
Create an XML specification for the indicated entity class. |
EntityContainer |
getContainer()
Getter for the Container property. |
java.lang.String |
getTagName()
Getter for the TagName property. |
void |
getXmlData(org.w3c.dom.Element element)
Read data from an XML Element. |
XmlSpec |
getXmlSpec()
Get the XML specification for this subclass of WriteableEntity. |
static XmlSpec |
getXmlSpec(java.lang.Class<? extends WriteableEntity> entityClass)
Get the XmlSpec for the indicated subclass of WriteableEntity. |
static void |
initializeXsd(org.w3c.dom.Document document)
Initialize XML schema creation. |
boolean |
isPersistent()
Getter for the Persistent flag. |
void |
logError(org.w3c.dom.Node node,
java.lang.Exception exception)
Handle an exception encountered while loading this document. |
void |
logError(org.w3c.dom.Node node,
java.lang.String message)
Handle an error encountered while loading this document. |
void |
makeDirty()
Signal that the document has experienced a change which should be saved to the associated file. |
void |
putXmlData(org.w3c.dom.Element element)
Write data to an XML Element. |
void |
save(java.io.File file)
Write the content of this entity to the indicated file in XML format. |
boolean |
setID(int id)
Setter for the ID property. |
boolean |
setName(java.lang.String value)
Setter for the Name property. |
void |
setPersistent(boolean persistent)
Setter for the Persistent flag. |
boolean |
setStatus(Status status)
Setter for the Status property. |
org.w3c.dom.Element |
toXmlNode(org.w3c.dom.Node parent)
Create an XML Element instance and fill it with data. |
| Methods inherited from class net.charlesames.utility.entity.Entity |
|---|
decrementReferenceCount, dereferenceHandle, dispose, equals, getHandle, getID, getName, getPath, getReferenceCount, getStatus, getText, hasContainer, incrementReferenceCount, isModifiable, methodHasOverride, predecessor, resequenceEntities, setContainer, setModifiable, shiftEntitiesDown, shiftEntityDown, shiftEntityUp, successor, toString, wipe |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Method Detail |
|---|
public EntityContainer getContainer()
EntityContainer property.
getContainer in class EntityContainer value.public boolean isPersistent()
Persistent flag.
The Persistent flag controls whether calls to makeDirty() are transmitted to the repository container.
Default is true;
Persistent value.public void setPersistent(boolean persistent)
Persistent flag.
The Persistent flag controls whether calls to makeDirty() are transmitted to the repository container.
Default is true;
persistent - The intended Persistent value.public void makeDirty()
public boolean setID(int id)
EntityID property.
setID in class Entityid - The intended ID value.
ID change actually happened; false otherwise.public boolean setName(java.lang.String value)
EntityName property.
setName in class Entityvalue - The intended Name value.
Name change actually happened; false otherwise.public boolean setStatus(Status status)
EntityStatus property.
setStatus in class Entitystatus - The intended Status value.
Status change actually happened; false otherwise.public final java.lang.String getTagName()
TagName property.
TagName value.public final org.w3c.dom.Element toXmlNode(org.w3c.dom.Node parent)
Element instance and fill it with data.
parent - The parent XML Node to which the new Element will be appended.
The class of the parent may be either org.w3c.dom.Element or org.w3c.dom.Document.
Element instance.public XmlSpec getXmlSpec()
WriteableEntity.
WriteableEntity.public static void clearXmlSpecs()
public static XmlSpec getXmlSpec(java.lang.Class<? extends WriteableEntity> entityClass)
WriteableEntity.
entityClass - The indicated entity subclass.
NoSuchObjectException - when not found.public static void initializeXsd(org.w3c.dom.Document document)
Used flag false for all XmlSpec instances.
document - The XML Document which is to receive the schema information.
public void logError(org.w3c.dom.Node node,
java.lang.String message)
node - The XML node where this error was detected.message - A text string describing the error.
public void logError(org.w3c.dom.Node node,
java.lang.Exception exception)
node - The XML node where this error was detected.exception - The exception describing the error.public final void putXmlData(org.w3c.dom.Element element)
Element.
element - The target Element.public void getXmlData(org.w3c.dom.Element element)
Element.
element - The source Element.public void save(java.io.File file)
file - The indicated file.public boolean check(HtmlBuilder htmlBuilder)
htmlBuilder - Accumulates an HTML formatted record of each error or inconsistency found.
public static XmlSpec createXmlSpec(java.lang.Class<? extends WriteableEntity> entityClass,
java.lang.String tag,
java.lang.String description)
entityClass - The indicated entity class.tag - The node name for an XML Element which describes an instance of the entity class.description - A text description for the XSD element.
XmlSpec instance.
java.lang.RuntimeException - when an XmlSpec instance already exists for the indicated entity class.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||