|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object olg.csv.bean.loader.Util
public final class Util
Util in loading objects from XML Documents.
Constructor Summary | |
---|---|
private |
Util()
private constructor to prevent its instantiation. |
Method Summary | ||
---|---|---|
static
|
checkBean(Class<T> beanClass)
This test checks only if it has a constructor with no argument and is not an array or an enum or a primitive. |
|
static String |
emptyToNull(String str)
Convert an empty String to null . |
|
static Object |
evaluerDOM(Object document,
String expression,
QName retour)
Extracts Element from XML Element corresponding to the given XPath expression. |
|
static Locale |
getLocale(String locale)
Returns a locale corresponding to one of the available locales supported on the JVM and matches the given parameter. |
|
static Document |
openDocument(File file)
Returns the XML Document corresponding to the content of the given file. |
|
static String |
toString(Document document)
transforms a XML Document as a String. |
|
static void |
validate(File file)
Validate a file as a bean-row XML file. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
private Util()
Method Detail |
---|
public static Object evaluerDOM(Object document, String expression, QName retour) throws XPathExpressionException
document
- The context startingexpression
- XPath Expressionretour
- returned type
XPathExpressionException
- If the expression cannot be evaluatedpublic static void validate(File file) throws SAXException, IOException
file
- the file to validate.
SAXException
- If any parse errors occur.
IOException
- If any IO errors occur.public static Document openDocument(File file) throws ParserConfigurationException, SAXException, IOException
file
- the file
ParserConfigurationException
- if a DocumentBuilder cannot be created which satisfies the
configuration requested.
SAXException
- If any parse errors occur.
IOException
- If any IO errors occur.public static String toString(Document document) throws TransformerException
document
- the document.
TransformerException
- Thrown if it is not possible to create a Transformer instance
or if an error occurs during the course of the String
transformationpublic static <T> boolean checkBean(Class<T> beanClass)
T
- the type of the bean.beanClass
- the class
true
if the given class is identify as a bean.public static String emptyToNull(String str)
null
.
str
- String to convert.
public static Locale getLocale(String locale)
locale
- a locale String representation like "en" or "fr_CH"
null
if none available locale matches with the given
parameter.Locale
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |