public class XMLHelper
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
protected static class |
XMLHelper.StringArrayStream |
protected static class |
XMLHelper.StringBufferStream |
protected static class |
XMLHelper.StringStream |
class |
XMLHelper.VHandler
The validation handler to the xml reader.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
NAMESPACE |
static java.lang.String |
SCHEMA |
Constructor and Description |
---|
XMLHelper() |
Modifier and Type | Method and Description |
---|---|
static XMLHelper |
getInstance()
Get the instance of the helper.
|
java.lang.Object |
readXML(java.io.InputStream stream)
Read from input stream.
|
java.lang.Object |
readXML(java.io.InputStream stream,
java.lang.ClassLoader classloader)
Read from input stream.
|
java.lang.Object |
readXML(java.io.InputStream stream,
java.lang.ClassLoader classloader,
java.lang.String packageName,
java.lang.String schemaResource)
Read from input stream.
|
java.lang.Object |
readXML(java.io.InputStream stream,
java.lang.ClassLoader classloader,
java.lang.String packageName,
java.lang.String schemaResource,
java.util.logging.Logger logger,
java.lang.String loggerPrefix)
Read from input stream.
|
java.lang.Object |
readXML(java.io.InputStream stream,
java.lang.String packageName,
java.lang.String schemaResource)
Read from input stream.
|
java.lang.Object |
readXML(java.io.InputStream stream,
java.lang.String packageName,
java.lang.String schemaResource,
java.util.logging.Logger logger,
java.lang.String loggerPrefix)
Read from input stream.
|
java.lang.Object |
readXML(java.lang.String resource)
Read an xml file.
|
java.lang.Object |
readXML(java.lang.String[] resource)
Read an xml from string array.
|
java.lang.Object |
readXML(java.lang.String[] resource,
java.lang.String packageName,
java.lang.String schemaResource)
Read an xml from string array.
|
java.lang.Object |
readXML(java.lang.String[] resource,
java.lang.String packageName,
java.lang.String schemaResource,
java.util.logging.Logger logger)
Read an xml from string array.
|
java.lang.Object |
readXML(java.lang.String[] resource,
java.lang.String packageName,
java.lang.String schemaResource,
java.util.logging.Logger logger,
java.lang.String loggerPrefix)
Read an xml from string array.
|
java.lang.Object |
readXML(java.lang.StringBuffer resource)
Read an xml from StringBuffer.
|
java.lang.Object |
readXML(java.lang.StringBuffer resource,
java.lang.String packageName,
java.lang.String schemaResource)
Read an xml from StringBuffer.
|
java.lang.Object |
readXML(java.lang.StringBuffer resource,
java.lang.String packageName,
java.lang.String schemaResource,
java.util.logging.Logger logger)
Read an xml from StringBuffer.
|
java.lang.Object |
readXML(java.lang.String resource,
java.lang.ClassLoader classloader)
Read an xml file.
|
java.lang.Object |
readXML(java.lang.String resource,
java.lang.ClassLoader classloader,
java.lang.String packageName,
java.lang.String schemaResource)
Read an xml file.
|
java.lang.Object |
readXML(java.lang.String resource,
java.lang.ClassLoader classloader,
java.lang.String packageName,
java.lang.String schemaResource,
java.util.logging.Logger logger)
Read an xml file.
|
java.lang.Object |
readXML(java.lang.String resource,
java.lang.String packageName,
java.lang.String schemaResource)
Read an xml file.
|
java.lang.Object |
readXML(java.lang.String resource,
java.lang.String packageName,
java.lang.String schemaResource,
java.util.logging.Logger logger)
Read an xml file.
|
static java.lang.String |
toString(XSDContextIF ctx,
java.lang.Object obj,
boolean resolve)
Get a string presentation of the given object.
|
static java.lang.String |
toString(XSDContextIF ctx,
java.lang.String prefix,
java.lang.String tag,
java.lang.Object obj,
boolean resolve)
Get a string presentation of the given object.
|
public static final java.lang.String NAMESPACE
public static final java.lang.String SCHEMA
public static XMLHelper getInstance()
public java.lang.Object readXML(java.lang.String resource) throws javax.xml.bind.JAXBException, java.io.IOException, java.io.FileNotFoundException
com.highqsoft.xsd.schema
and
the schema resource com/highqsoft/xsd/schema.xsd
.resource
- The name of the file or a resource.javax.xml.bind.JAXBException
java.io.IOException
java.io.FileNotFoundException
public java.lang.Object readXML(java.lang.String resource, java.lang.ClassLoader classloader) throws javax.xml.bind.JAXBException, java.io.IOException, java.io.FileNotFoundException
com.highqsoft.xsd.schema
and
the schema resource com/highqsoft/xsd/schema.xsd
.resource
- The name of the file or a resource.classloader
- the class loader to be used.javax.xml.bind.JAXBException
java.io.IOException
java.io.FileNotFoundException
public java.lang.Object readXML(java.lang.String resource, java.lang.String packageName, java.lang.String schemaResource) throws javax.xml.bind.JAXBException, java.io.IOException, java.io.FileNotFoundException
resource
- The name of the file or a resource.packageName
- The package name to be used for marshalling.schemaResource
- The resource of the schemajavax.xml.bind.JAXBException
java.io.IOException
java.io.FileNotFoundException
public java.lang.Object readXML(java.lang.String resource, java.lang.String packageName, java.lang.String schemaResource, java.util.logging.Logger logger) throws javax.xml.bind.JAXBException, java.io.IOException, java.io.FileNotFoundException
resource
- The name of the file or a resource.packageName
- The package name to be used for marshalling.schemaResource
- The resource of the schemalogger
- the loggerjavax.xml.bind.JAXBException
java.io.IOException
java.io.FileNotFoundException
public java.lang.Object readXML(java.lang.String resource, java.lang.ClassLoader classloader, java.lang.String packageName, java.lang.String schemaResource) throws javax.xml.bind.JAXBException, java.io.IOException, java.io.FileNotFoundException
resource
- The name of the file or a resource.classloader
- the class loader to be used.packageName
- The package name to be used for marshalling.schemaResource
- The resource of the schemajavax.xml.bind.JAXBException
java.io.IOException
java.io.FileNotFoundException
public java.lang.Object readXML(java.lang.String resource, java.lang.ClassLoader classloader, java.lang.String packageName, java.lang.String schemaResource, java.util.logging.Logger logger) throws javax.xml.bind.JAXBException, java.io.IOException, java.io.FileNotFoundException
resource
- The name of the file or a resource.packageName
- The package name to be used for marshalling.schemaResource
- The resource of the schemalogger
- A logger to be used when schema validation problem exist.javax.xml.bind.JAXBException
java.io.IOException
java.io.FileNotFoundException
public java.lang.Object readXML(java.lang.StringBuffer resource) throws javax.xml.bind.JAXBException, java.io.IOException, java.io.FileNotFoundException
com.highqsoft.xsd.schema
and
the schema resource com/highqsoft/xsd/schema.xsd
.resource
- The string buffer.javax.xml.bind.JAXBException
java.io.IOException
java.io.FileNotFoundException
public java.lang.Object readXML(java.lang.StringBuffer resource, java.lang.String packageName, java.lang.String schemaResource) throws javax.xml.bind.JAXBException, java.io.IOException, java.io.FileNotFoundException
resource
- The string buffer.packageName
- The package name to be used for marshalling.schemaResource
- The resource of the schemajavax.xml.bind.JAXBException
java.io.IOException
java.io.FileNotFoundException
public java.lang.Object readXML(java.lang.StringBuffer resource, java.lang.String packageName, java.lang.String schemaResource, java.util.logging.Logger logger) throws javax.xml.bind.JAXBException, java.io.IOException, java.io.FileNotFoundException
resource
- The string buffer.packageName
- The package name to be used for marshalling.schemaResource
- The resource of the schemalogger
- A logger to be used when schema validation problem exist.javax.xml.bind.JAXBException
java.io.IOException
java.io.FileNotFoundException
public java.lang.Object readXML(java.lang.String[] resource) throws javax.xml.bind.JAXBException, java.io.IOException, java.io.FileNotFoundException
com.highqsoft.xsd.schema
and
the schema resource com/highqsoft/xsd/schema.xsd
.resource
- the string array.javax.xml.bind.JAXBException
java.io.IOException
java.io.FileNotFoundException
public java.lang.Object readXML(java.lang.String[] resource, java.lang.String packageName, java.lang.String schemaResource) throws javax.xml.bind.JAXBException, java.io.IOException, java.io.FileNotFoundException
resource
- the string array.packageName
- The package name to be used for marshalling.schemaResource
- The resource of the schemajavax.xml.bind.JAXBException
java.io.IOException
java.io.FileNotFoundException
public java.lang.Object readXML(java.lang.String[] resource, java.lang.String packageName, java.lang.String schemaResource, java.util.logging.Logger logger) throws javax.xml.bind.JAXBException, java.io.IOException, java.io.FileNotFoundException
resource
- the string array.packageName
- The package name to be used for marshalling.schemaResource
- The resource of the schemalogger
- A logger to be used when schema validation problem exist.javax.xml.bind.JAXBException
java.io.IOException
java.io.FileNotFoundException
public java.lang.Object readXML(java.lang.String[] resource, java.lang.String packageName, java.lang.String schemaResource, java.util.logging.Logger logger, java.lang.String loggerPrefix) throws javax.xml.bind.JAXBException, java.io.IOException, java.io.FileNotFoundException
resource
- the string array.packageName
- The package name to be used for marshalling.schemaResource
- The resource of the schemalogger
- A logger to be used when schema validation problem exist.javax.xml.bind.JAXBException
java.io.IOException
java.io.FileNotFoundException
public java.lang.Object readXML(java.io.InputStream stream) throws javax.xml.bind.JAXBException, java.io.IOException
com.highqsoft.xsd.schema
and
the schema resource com/highqsoft/xsd/schema.xsd
.stream
- the input stream.javax.xml.bind.JAXBException
java.io.IOException
public java.lang.Object readXML(java.io.InputStream stream, java.lang.ClassLoader classloader) throws javax.xml.bind.JAXBException, java.io.IOException
com.highqsoft.xsd.schema
and
the schema resource com/highqsoft/xsd/schema.xsd
.stream
- the input stream.classloader
- the class loader to be used.javax.xml.bind.JAXBException
java.io.IOException
public java.lang.Object readXML(java.io.InputStream stream, java.lang.String packageName, java.lang.String schemaResource) throws javax.xml.bind.JAXBException, java.io.IOException
stream
- the input stream.packageName
- The package name to be used for marshalling.schemaResource
- The resource of the schemajavax.xml.bind.JAXBException
java.io.IOException
public java.lang.Object readXML(java.io.InputStream stream, java.lang.ClassLoader classloader, java.lang.String packageName, java.lang.String schemaResource) throws javax.xml.bind.JAXBException, java.io.IOException
stream
- the input stream.classloader
- the class loader to be used.packageName
- The package name to be used for marshalling.schemaResource
- The resource of the schemajavax.xml.bind.JAXBException
java.io.IOException
public java.lang.Object readXML(java.io.InputStream stream, java.lang.String packageName, java.lang.String schemaResource, java.util.logging.Logger logger, java.lang.String loggerPrefix) throws javax.xml.bind.JAXBException, java.io.IOException
stream
- the input stream.packageName
- The package name to be used for marshalling.schemaResource
- The resource of the schemalogger
- A logger to be used when schema validation problem exist.javax.xml.bind.JAXBException
java.io.IOException
public java.lang.Object readXML(java.io.InputStream stream, java.lang.ClassLoader classloader, java.lang.String packageName, java.lang.String schemaResource, java.util.logging.Logger logger, java.lang.String loggerPrefix) throws javax.xml.bind.JAXBException, java.io.IOException
stream
- the input stream.classloader
- the class loader to be used.packageName
- The package name to be used for marshalling.schemaResource
- The resource of the schemalogger
- A logger to be used when schema validation problem exist.javax.xml.bind.JAXBException
java.io.IOException
public static java.lang.String toString(XSDContextIF ctx, java.lang.Object obj, boolean resolve)
ctx
- The context, it is optional, when resolve parameter is false.obj
- the object to be printed.resolve
- if true property values will be resolved.public static java.lang.String toString(XSDContextIF ctx, java.lang.String prefix, java.lang.String tag, java.lang.Object obj, boolean resolve)
ctx
- The context, it is optional, when resolve parameter is false.prefix
- the line prefixtag
- the tag name belong to the given object.obj
- the object to be printed.resolve
- if true property values will be resolved.