net.charlesames.utility.entity
Class XmlNode

java.lang.Object
  extended by net.charlesames.utility.entity.XmlNode
Direct Known Subclasses:
XmlAttribute, XmlContent, XmlElement

public abstract class XmlNode
extends java.lang.Object

The abstract XmlNode class implements functionality shared between the XmlAttribute and XmlSimpleElement classes.

Author:
Charles Ames

Method Summary
 java.lang.String getDescription()
          Get the description for the XSD element.
 java.lang.String getTag()
          Get the node name.
 XmlSpec getXmlSpec()
          Get the parent XmlSpec instance.
abstract  java.lang.String getXsdTag()
          Get the tag identifying this node in an XML schema document.
 boolean isIncludedInSchema()
          Check if this node should be visible in the schema.
abstract  void putData(WriteableEntity entity, org.w3c.dom.Element element)
          Writes data from an WriteableEntity instance into an XML Element.
 void setDescription(java.lang.String description)
          Set the description for the XSD element.
 void setIncludedInSchema(boolean includedInSchema)
          Indicate whether or not this node should be visible in the schema.
 org.w3c.dom.Element toXsdElement(org.w3c.dom.Node parent)
          Convert the XML specification node to a node description in an XML schema document
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTag

public java.lang.String getTag()
Get the node name.

Returns:
The node name.

getXmlSpec

public XmlSpec getXmlSpec()
Get the parent XmlSpec instance.

Returns:
The parent XmlSpec instance.

isIncludedInSchema

public boolean isIncludedInSchema()
Check if this node should be visible in the schema.

Returns:
True if this node should be visible in the schema; false otherwise.

setIncludedInSchema

public void setIncludedInSchema(boolean includedInSchema)
Indicate whether or not this node should be visible in the schema.

Parameters:
includedInSchema - True if this node should be visible in the schema; false otherwise.

putData

public abstract void putData(WriteableEntity entity,
                             org.w3c.dom.Element element)
Writes data from an WriteableEntity instance into an XML Element.

Parameters:
entity - The source WriteableEntity.
element - The target Element.

getXsdTag

public abstract java.lang.String getXsdTag()
Get the tag identifying this node in an XML schema document.

Returns:
The tag identifying this node in an XML schema document.

getDescription

public java.lang.String getDescription()
Get the description for the XSD element.

Returns:
The description text.

setDescription

public void setDescription(java.lang.String description)
Set the description for the XSD element.

Parameters:
description - The description text.

toXsdElement

public org.w3c.dom.Element toXsdElement(org.w3c.dom.Node parent)
Convert the XML specification node to a node description in an XML schema document

Parameters:
parent - The parent node.
Returns:
THe newly created node.