|
xml2class XML data structures |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||
java.lang.Object | +--xml2class.X2cTools
This class provides some utility methods for the whole xml2class package. Most important: an entity encoder, a method invoker and a token-string to array converter.
XML2ClassParser,
XMLFile| Constructor Summary | |
X2cTools()
|
|
| Method Summary | |
static java.lang.Object |
invokeMethod(java.lang.Object element,
java.lang.String methodName)
Allows to invoke any (parameterless) method for any object. |
static java.lang.String |
stripClassPath(java.lang.String fullTagName)
Removes any path information from a class name. |
static java.lang.String |
toEntityString(java.lang.String s)
Returns the same string, but with any entity character encoded as XML entity (e.g. |
static java.lang.String[] |
tokensToArray(java.lang.String tokenString)
Transforms a token-string into a string array. |
static java.lang.String[] |
tokensToArray(java.lang.String tokenString,
java.lang.String separators)
Transforms a token-string into a string array. |
static java.lang.String |
toXMLString(java.lang.Object element)
Converts any element into an XML string, at the condition that it provides a toXMLString() method. |
static java.lang.String |
upperCaseFirstLetter(java.lang.String string)
Capitalizes the first character. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public X2cTools()
| Method Detail |
public static java.lang.String stripClassPath(java.lang.String fullTagName)
public static java.lang.String upperCaseFirstLetter(java.lang.String string)
public static java.lang.String[] tokensToArray(java.lang.String tokenString)
tokenString - any string, asuming that whitespace serves as token separator.
public static java.lang.String[] tokensToArray(java.lang.String tokenString,
java.lang.String separators)
tokenString - any string.separators - a string including any token separator characters.public static java.lang.String toEntityString(java.lang.String s)
< results in <).s - String whose entities should be encoded.
public static java.lang.Object invokeMethod(java.lang.Object element,
java.lang.String methodName)
throws X2cClassBuildingException
element - the object whose method should be invoked.methodName - the method's name.X2cClassBuildingException - is thrown if the indicated method could not be found or invoked for any reasons.
public static java.lang.String toXMLString(java.lang.Object element)
throws X2cOutputException
toXMLString() method.any - object (not necessarily XMLSaveable).X2cOutputException - is thrown if the element does not support toXMLString().
|
xml2class XML data structures |
|||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||