com.basecmp.core.persistence.util
Class XmlBean

java.lang.Object
  extended bycom.basecmp.core.persistence.util.XmlBean

public class XmlBean
extends java.lang.Object

Hilfsklasse die XML-Daten nach XML-Attributes-Schema parsed und die Daten über get/setXmlProperty() liefert bzw setzt. Created on 12.06.2004

Author:
Wolfgang Schröder

Field Summary
protected  java.lang.String xmlProperties
           
 
Constructor Summary
XmlBean()
          Bean-Constructor
 
Method Summary
 java.lang.String getDataType(java.lang.String xmlPropertyName)
          Returns the java-type for the given xml-property-name, which was defined by the xml-definition at instantiation.
 java.util.Iterator getPropertyNames()
          Return an iterator on xml property names.
 java.lang.String getXmlProperties()
          Returns the internal xml-representation of all xml-properties.
 java.lang.Object getXmlProperty(java.lang.String propertyname)
          Return the value of the given xml-property-name in it's natural datatype.
 XmlBeanMetaData init(java.lang.String xml)
          Initialisiert die Bean mit der Defaut-Datendefinition, nach der XML-Properties gesetzt bzw gelesen werden können.
 XmlBeanMetaData initFilename(java.lang.String filename)
          Liest die angegebene Datei und initialisiert die Bean durch Auruf von init(String xml).
 boolean isArray(java.lang.String xmlPropertyName)
          Returns true, if the value for the given xml-property-name is an array, otherwise false.
 boolean isNotNull(java.lang.String xmlPropertyName)
          Returns true, if the value for the given xml-property-name may become null, otherwise false.
 boolean isXmlPropertyNull(java.lang.String propertyname)
          Returns true, if the current value for the given xml-property-name is null or non-existent, otherwise false.
 void postProcess()
          This method is used internally by the factory-method and has no functionality after initialization-phase of the bean-instance has been done.
 void setBodyValue(java.lang.String bodyValue)
          This method is used internally by the factory-method and has no functionality after initialization-phase of the bean-instance has been done.
 void setIsArray(java.lang.String isArray)
          This method is used internally by the factory-method and has no functionality after initialization-phase of the bean-instance has been done.
 void setIsNull(java.lang.String isNull)
          This method is used internally by the factory-method and has no functionality after initialization-phase of the bean-instance has been done.
 void setName(java.lang.String name)
          This method is used internally by the factory-method and has no functionality after initialization-phase of the bean-instance has been done.
 void setXmlProperty(java.lang.String name, java.lang.Object value)
          Set the given xml-property-name to the given value.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

xmlProperties

protected java.lang.String xmlProperties
Constructor Detail

XmlBean

public XmlBean()
Bean-Constructor

Method Detail

getDataType

public java.lang.String getDataType(java.lang.String xmlPropertyName)
Returns the java-type for the given xml-property-name, which was defined by the xml-definition at instantiation. Returns null if the given xml-property-name does not exist.


getPropertyNames

public java.util.Iterator getPropertyNames()
Return an iterator on xml property names.

Returns:

getXmlProperties

public java.lang.String getXmlProperties()
Returns the internal xml-representation of all xml-properties. This property may be persisted by Hibernate, JDO or any other peristency-framework.


getXmlProperty

public java.lang.Object getXmlProperty(java.lang.String propertyname)
Return the value of the given xml-property-name in it's natural datatype.

Returns:

init

public XmlBeanMetaData init(java.lang.String xml)
Initialisiert die Bean mit der Defaut-Datendefinition, nach der XML-Properties gesetzt bzw gelesen werden können.

Parameters:
xml - XML-Defaultdaten als String

initFilename

public XmlBeanMetaData initFilename(java.lang.String filename)
Liest die angegebene Datei und initialisiert die Bean durch Auruf von init(String xml).

Parameters:
filename - Dateiname innerhalb des Klassenpfades, beginnend mit einem Pfad-oder Dateinamen ohne Slash!

isArray

public boolean isArray(java.lang.String xmlPropertyName)
Returns true, if the value for the given xml-property-name is an array, otherwise false. Defined by the xml-definition at instantiation.


isNotNull

public boolean isNotNull(java.lang.String xmlPropertyName)
Returns true, if the value for the given xml-property-name may become null, otherwise false. Defined by the xml-definition at instantiation.


isXmlPropertyNull

public boolean isXmlPropertyNull(java.lang.String propertyname)
Returns true, if the current value for the given xml-property-name is null or non-existent, otherwise false.


postProcess

public void postProcess()
This method is used internally by the factory-method and has no functionality after initialization-phase of the bean-instance has been done. The method has to be public, because the factory uses internally an instance of Apache-Digester in order to parse the xml-definition given to the factory.


setBodyValue

public void setBodyValue(java.lang.String bodyValue)
This method is used internally by the factory-method and has no functionality after initialization-phase of the bean-instance has been done. The method has to be public, because the factory uses internally an instance of Apache-Digester in order to parse the xml-definition given to the factory.


setIsArray

public void setIsArray(java.lang.String isArray)
This method is used internally by the factory-method and has no functionality after initialization-phase of the bean-instance has been done. The method has to be public, because the factory uses internally an instance of Apache-Digester in order to parse the xml-definition given to the factory.


setIsNull

public void setIsNull(java.lang.String isNull)
This method is used internally by the factory-method and has no functionality after initialization-phase of the bean-instance has been done. The method has to be public, because the factory uses internally an instance of Apache-Digester in order to parse the xml-definition given to the factory.


setName

public void setName(java.lang.String name)
This method is used internally by the factory-method and has no functionality after initialization-phase of the bean-instance has been done. The method has to be public, because the factory uses internally an instance of Apache-Digester in order to parse the xml-definition given to the factory.


setXmlProperty

public void setXmlProperty(java.lang.String name,
                           java.lang.Object value)
Set the given xml-property-name to the given value. Performs several checks. If one of these checks fail, an IllegalArgumentException is thrown:

Parameters:
name -
value -
Throws:
java.lang.IllegalArgumentException


Copyright © 2004 by basecmp® - Professional Web Solutions