|
Copyright @ 2002 SAP. All Rights Reserved. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Object | +--com.sap.tc.complib.xml.Initializable
Abstract base class for classes that are able to initialize from a XML input stream. Provides some useful helper methods.
| Field Summary | |
protected java.lang.String |
_apiVersion
|
protected java.util.List |
_attributes
|
protected java.util.List |
_extensions
|
protected boolean |
_initialized
|
protected java.lang.String |
_schemaVersion
|
protected java.lang.StringBuffer |
buffer
|
protected boolean |
clearBuffer
string buffer for collection of tag value parts |
protected static int |
INIT
|
protected boolean |
isEmpty
|
protected int |
recoverMode
|
protected java.lang.String |
recoverTagName
|
protected static int |
RECOVERY_MODE
|
protected static int |
ROOT
|
protected int |
state
|
| Constructor Summary | |
Initializable()
|
|
| Method Summary | |
java.lang.String |
_getAPIVersion()
|
java.lang.String |
_getSchemaVersion()
|
boolean |
_isInitialized()
|
boolean |
_isSchemaAllowed()
|
boolean |
_isSchemaAllowed(java.lang.String schemaVersion)
|
void |
_setSchemaVersion(java.lang.String schemaVersion)
|
protected void |
checkMandatoryAttribute(java.lang.String attrValue,
java.lang.String attrName,
java.lang.String parentTag)
utility checking if an mandatory attribute is null |
protected void |
checkMandatoryAttributeNotEmpty(java.lang.String attrValue,
java.lang.String attrName,
java.lang.String parentTag)
utility checking if an mandatory attribute is null or empty |
protected void |
checkPropertyNotEmptyOrNull(java.util.Collection propertyValue,
java.lang.String propertyName,
java.lang.String owner)
utility method checking if a property is empty (Map) or null |
protected void |
checkPropertyNotEmptyOrNull(java.util.Map propertyValue,
java.lang.String propertyName,
java.lang.String owner)
utility method checking if a property is empty (Collection) or null |
protected void |
checkPropertyNotEmptyOrNull(java.lang.String propertyValue,
java.lang.String propertyName,
java.lang.String owner)
utility method checking if a property is empty (String) or null |
protected void |
checkPropertyNotNull(java.lang.Object propertyValue,
java.lang.String propertyName,
java.lang.String owner)
utility method checking if a property is null |
protected boolean |
doSerialize(java.lang.String schemaVersion,
java.lang.String minSchemaVersion)
|
protected void |
dropTagValue()
Reject the value of the tag. |
protected void |
endDocument()
|
protected abstract boolean |
endTag(java.lang.String name)
|
protected Attribute[] |
getAttributes()
|
protected java.util.List |
getAttributes(org.xml.sax.Attributes attributes)
Converts SAX attributes to an attribute array |
protected boolean |
getBooleanValue()
Returns the boolean values of a tag. |
protected boolean |
getBooleanValue(java.lang.String stringValue,
java.lang.String attrName,
java.lang.String element)
utility function converting a string false/true or yes/no into a boolean |
protected double |
getDoubleValue()
getter for double values of tags. to be called in endTag event |
protected float |
getFloatValue()
getter for float values of tags. to be called in endTag event |
protected java.lang.String |
getIllegalAttributeMessage(java.lang.String attrName,
java.lang.String attrValue,
java.lang.String tagName)
utility returning message for exception for illegal atributes of XML tag |
protected int |
getIntegerValue()
getter for integer values of tags. to be called in endTag event |
protected long |
getLongValue()
getter for long values of tags. to be called in endTag event |
protected java.lang.String |
getMissingTagMessage(java.lang.String missingTag,
java.lang.String parentTag)
utility returning Exception message for missing mandatory tags |
protected java.lang.String |
getStringValue()
getter for string values of tags. to be called in endTag event |
protected java.lang.String |
getStringValue(boolean trim)
getter for string values of tags. parameter trim allows to determine, whether leading and trailing whitespace should be stripped. to be called in endTag event |
protected boolean |
isEmptyTag()
returns true if the tag value is empty |
protected void |
removeAttribute(java.lang.String name)
|
protected org.xml.sax.InputSource |
resolveEntity(java.lang.String publicId,
java.lang.String systemId)
|
protected void |
setAttribute(java.lang.String name,
java.lang.String value)
|
protected void |
startDocument()
|
protected abstract void |
startTag(java.lang.String name,
org.xml.sax.Attributes attributes)
|
protected void |
tagValue(char[] chars,
int start,
int length)
tag value event wrapper. since SAX splits consecutive lines of character input in multiple events, this method collect the parts. use one of the getter methods below (getString, getBoolean...) to access the content of a tag. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected static final int INIT
protected static final int RECOVERY_MODE
protected static final int ROOT
protected int state
protected java.lang.String recoverTagName
protected int recoverMode
protected java.util.List _extensions
protected java.util.List _attributes
protected java.lang.String _schemaVersion
protected java.lang.String _apiVersion
protected boolean _initialized
protected boolean clearBuffer
protected boolean isEmpty
protected java.lang.StringBuffer buffer
| Constructor Detail |
public Initializable()
| Method Detail |
protected void tagValue(char[] chars,
int start,
int length)
protected boolean isEmptyTag()
protected java.lang.String getStringValue()
protected java.lang.String getStringValue(boolean trim)
protected int getIntegerValue()
protected long getLongValue()
protected float getFloatValue()
protected double getDoubleValue()
protected boolean getBooleanValue()
protected java.util.List getAttributes(org.xml.sax.Attributes attributes)
attributes - a list of SAX attributes
protected void setAttribute(java.lang.String name,
java.lang.String value)
protected void removeAttribute(java.lang.String name)
protected Attribute[] getAttributes()
protected void dropTagValue()
protected boolean getBooleanValue(java.lang.String stringValue,
java.lang.String attrName,
java.lang.String element)
throws org.xml.sax.SAXException
org.xml.sax.SAXException - if conversion is not possible
protected void checkMandatoryAttribute(java.lang.String attrValue,
java.lang.String attrName,
java.lang.String parentTag)
throws org.xml.sax.SAXException
org.xml.sax.SAXException - if null
protected void checkMandatoryAttributeNotEmpty(java.lang.String attrValue,
java.lang.String attrName,
java.lang.String parentTag)
throws org.xml.sax.SAXException
org.xml.sax.SAXException - if conversion is not possible
protected java.lang.String getMissingTagMessage(java.lang.String missingTag,
java.lang.String parentTag)
protected java.lang.String getIllegalAttributeMessage(java.lang.String attrName,
java.lang.String attrValue,
java.lang.String tagName)
protected void checkPropertyNotEmptyOrNull(java.lang.String propertyValue,
java.lang.String propertyName,
java.lang.String owner)
throws MissingElementException
ValidationException - if conversion is not possible
protected void checkPropertyNotNull(java.lang.Object propertyValue,
java.lang.String propertyName,
java.lang.String owner)
throws MissingElementException
ValidationException - if conversion is not possible
protected void checkPropertyNotEmptyOrNull(java.util.Map propertyValue,
java.lang.String propertyName,
java.lang.String owner)
throws ValidationException
ValidationException - if conversion is not possible
protected void checkPropertyNotEmptyOrNull(java.util.Collection propertyValue,
java.lang.String propertyName,
java.lang.String owner)
throws ValidationException
ValidationException - if conversion is not possible
protected boolean doSerialize(java.lang.String schemaVersion,
java.lang.String minSchemaVersion)
public boolean _isSchemaAllowed()
public boolean _isSchemaAllowed(java.lang.String schemaVersion)
formatVersion - InvalidFileFormatException - public java.lang.String _getSchemaVersion()
public void _setSchemaVersion(java.lang.String schemaVersion)
public java.lang.String _getAPIVersion()
public boolean _isInitialized()
protected void startDocument()
protected void endDocument()
protected abstract void startTag(java.lang.String name,
org.xml.sax.Attributes attributes)
throws org.xml.sax.SAXException
protected abstract boolean endTag(java.lang.String name)
throws org.xml.sax.SAXException
protected org.xml.sax.InputSource resolveEntity(java.lang.String publicId,
java.lang.String systemId)
throws org.xml.sax.SAXException
|
Copyright @ 2002 SAP. All Rights Reserved. | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||