tauZaman
v0.1

tauzaman.property
Class Property

java.lang.Object
  |
  +--tauzaman.property.Property

public class Property
extends java.lang.Object

Property class is the representation of a single property Properties are two types:

For example;
 
 <property name = "..." value = "..." />
 
For example;
 
 <property name = "..." > 
 <value> ... </value>
 </property>
 

See Also:
Property, FieldInfo, ImportFormat, Format
Status:
design complete, implementation complete

Field Summary
private  PropertyCache cache
          Cached version of this Property's format which includes its parsed Fields, newFormat and whitespace attribute.
private  java.lang.String content
          String content of this Property in case its type is simple
private  FieldInfo[] fieldInfos
          List of field infos in case this Property has a complex type
private  Format[] formats
          List of formats in case this Property has a complex type
private  ImportFormat[] importFormats
          List of imported formats in case this Property has a complex type
private  boolean isSimple
          Whether type of this Property is a simple one or not
private  java.lang.String name
          name of this Property
private  java.net.URL url
          url of this Property
 
Constructor Summary
Property(java.lang.String name, java.net.URL url, org.w3c.dom.Element root, java.util.Hashtable fvMapper)
          Constructs a Property, from a given DOM Node, parsed from Property Specification file.
 
Method Summary
private  void formProperty(org.w3c.dom.Element root, java.util.Hashtable fvMapper)
          Initializes this Property from DOM Node, which points to a property element in the Property Specification file.
 PropertyCache getCache()
          Returns PropertyCache object of this Property.
 java.lang.String getContent()
          If simple type then return content, o.w. return null.
 FieldInfo[] getFieldInfos()
          Return the field value List
 Format[] getFormats()
          Return the format list
 ImportFormat[] getImportFormats()
          Return the import format list
 java.lang.String getName()
          Returns the string name of this Property.
 java.net.URL getUrl()
          Returns URL of this Property.
 boolean hasCache()
          Returns true if this Property has already been loaded for Input/Output reasons.
 boolean isSimpleType()
          Returns the type of this Value
 void setCache(PropertyCache cache)
          Sets PropertyCache object of this Property.
 java.lang.String toString()
          toString method
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

name

private java.lang.String name
name of this Property


url

private java.net.URL url
url of this Property


isSimple

private boolean isSimple
Whether type of this Property is a simple one or not


content

private java.lang.String content
String content of this Property in case its type is simple


formats

private Format[] formats
List of formats in case this Property has a complex type


fieldInfos

private FieldInfo[] fieldInfos
List of field infos in case this Property has a complex type


importFormats

private ImportFormat[] importFormats
List of imported formats in case this Property has a complex type


cache

private PropertyCache cache
Cached version of this Property's format which includes its parsed Fields, newFormat and whitespace attribute. But of course, caching has also its side effects as every caching behavior. For example, if a recursive Format is updated this previous version of it will still be used by this cache.

Constructor Detail

Property

public Property(java.lang.String name,
                java.net.URL url,
                org.w3c.dom.Element root,
                java.util.Hashtable fvMapper)
         throws PropertyFormationException
Constructs a Property, from a given DOM Node, parsed from Property Specification file.

Parameters:
root - a DOM node of parsed Property Specification file
fvMapper - A Hashtable, which maps field value support labels to their urls. This information is passed by PropertyRepository since this information resides in Property specification file (as helper) rather than in individual Properties.
Throws:
PropertyFormationException - if any problem occurs when parsing the property specification file
Method Detail

formProperty

private void formProperty(org.w3c.dom.Element root,
                          java.util.Hashtable fvMapper)
                   throws PropertyFormationException
Initializes this Property from DOM Node, which points to a property element in the Property Specification file.

Parameters:
root - root Element of a single parsed Property xml specification
fvMapper - A Hashtable, which maps field value support labels to their urls. This information is passed by PropertyRepository since this information resides in Property specification file (as helper) rather than in individual Properties.
Throws:
PropertyFormationException - if any problem occurs when parsing the property specification file

hasCache

public boolean hasCache()
Returns true if this Property has already been loaded for Input/Output reasons.

Returns:
true if there is a PropertyCache object of this Property. False otherwise.

getCache

public PropertyCache getCache()
Returns PropertyCache object of this Property.

Returns:
PropertyCache object of this Property

setCache

public void setCache(PropertyCache cache)
Sets PropertyCache object of this Property.


isSimpleType

public boolean isSimpleType()
Returns the type of this Value

Returns:
kind of this Value

getName

public java.lang.String getName()
Returns the string name of this Property.

Returns:
String name of this Property

getUrl

public java.net.URL getUrl()
Returns URL of this Property.

Returns:
URL url of this Property

getContent

public java.lang.String getContent()
If simple type then return content, o.w. return null. We may also handle an error.

Returns:
null or content of this Value

getFieldInfos

public FieldInfo[] getFieldInfos()
Return the field value List

Returns:
list of Field Infos
See Also:
FieldInfo

getFormats

public Format[] getFormats()
Return the format list

Returns:
list of Formats
See Also:
Format

getImportFormats

public ImportFormat[] getImportFormats()
Return the import format list

Returns:
list of ImportFormats
See Also:
ImportFormat

toString

public java.lang.String toString()
toString method

Overrides:
toString in class java.lang.Object
Returns:
string representation of this object

tauZaman
v0.1

Submit a bug or feature

tauZaman is an open-source, publicly avaliable project