|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object mulan.data.LabelsBuilder
public final class LabelsBuilder
The LabelsBuilder
is responsible for creation of LabelsMetaDataImpl
instance
from specified XML file source. The builder ensures XML source validity against XML schema.
Field Summary | |
---|---|
protected static String |
LABELS_SCHEMA_NAMESPACE
The namespace of the schema for label representation |
Constructor Summary | |
---|---|
LabelsBuilder()
|
Method Summary | |
---|---|
static LabelsMetaData |
createLabels(InputStream inputStream)
Creates a LabelsMetaData instance from specified input stream. |
static LabelsMetaData |
createLabels(String xmlLabelsFilePath)
Creates a LabelsMetaData instance from XML file specified by the path. |
static void |
dumpLabels(LabelsMetaData labelsMetaData,
OutputStream outputStream)
Dumps specified labels meta-data, in XML format, into the specified OutputStream . |
static void |
dumpLabels(LabelsMetaData labelsMetaData,
String xmlDumpFilePath)
Dumps specified labels meta-data into the file in XML format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected static final String LABELS_SCHEMA_NAMESPACE
Constructor Detail |
---|
public LabelsBuilder()
Method Detail |
---|
public static LabelsMetaData createLabels(String xmlLabelsFilePath) throws LabelsBuilderException
LabelsMetaData
instance from XML file specified by the path.
xmlLabelsFilePath
- the path to XML file containing labels definition
LabelsMetaData
instance
ArgumentNullException
- if specified path to XML file is null
IllegalArgumentException
- if file under specified path does not exists
LabelsBuilderException
- if specified file can not be read/openedpublic static LabelsMetaData createLabels(InputStream inputStream) throws LabelsBuilderException
LabelsMetaData
instance from specified input stream.
inputStream
- the input stream containing labels definition in XML format
LabelsMetaData
instance
ArgumentNullException
- if specified input stream is null
LabelsBuilderException
- if any error occur when validating XML against
schema or when creating labels data form specified input streampublic static void dumpLabels(LabelsMetaData labelsMetaData, String xmlDumpFilePath) throws LabelsBuilderException
labelsMetaData
- the meta-data which has to be dumped into the filexmlDumpFilePath
- the path to the file where meta-data should be dumped
LabelsBuilderException
- if specified file can not be read/opened
ArgumentNullException
- if path to the file is not specifiedpublic static void dumpLabels(LabelsMetaData labelsMetaData, OutputStream outputStream) throws LabelsBuilderException
OutputStream
.
labelsMetaData
- the meta-data which has to be dumpedoutputStream
- the output stream where XML dup will be written
LabelsBuilderException
- if error occurs during the serialization of meta-data to
the XML format of resulting XML is not valid against the schema
ArgumentNullException
- if specified output strema is null.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |