public class XMLWriter extends Object
Modifier and Type | Field and Description |
---|---|
static String |
BIG_ENDIAN_ATTRIBUTE
Identifies the
BigEndian attribute. |
static String |
BIN_DATA_NS
Identifies the
BinData tag. |
static String |
BIN_DATA_TAG
Identifies the
BinData tag. |
private static String |
BIN_NS
The XML namespace.
|
static String |
COMPRESSION_ATTRIBUTE
Identifies the
Compression attribute. |
static String |
DIMENSION_ORDER_ATTRIBUTE
Identifies the
DimensionOrder attribute. |
static String |
ID_ATTRIBUTE
Identifies the
ID attribute. |
static String |
IMAGE_TAG
Identifies the
Image tag. |
private static String |
JAXP_SCHEMA_LANGUAGE
The schema language.
|
static String |
LENGTH_ATTRIBUTE
Identifies the
Length attribute. |
static String |
NAME_ATTRIBUTE
Identifies the
Name attribute. |
static String |
OME_TAG
Identifies the
OME tag. |
static String |
PIXELS_TAG
Identifies the
Pixels tag. |
static String |
PIXELS_TYPE_ATTRIBUTE
Identifies the
PixelType attribute. |
private static String |
PLANE
A default plane.
|
private static String |
SCHEMA_LOCATION
The schema location.
|
private static String[] |
SCHEMAS
The schemas.
|
static String |
SIZE_C_ATTRIBUTE
Identifies the
SizeC attribute. |
static String |
SIZE_T_ATTRIBUTE
Identifies the
SizeT attribute. |
static String |
SIZE_X_ATTRIBUTE
Identifies the
SizeX attribute. |
static String |
SIZE_Y_ATTRIBUTE
Identifies the
SizeY attribute. |
static String |
SIZE_Z_ATTRIBUTE
Identifies the
SizeZ attribute. |
private static String |
XML_NS
The XML namespace.
|
private static String |
XSI_NS
The XSI namespace.
|
Constructor and Description |
---|
XMLWriter()
Creates a new instance.
|
Modifier and Type | Method and Description |
---|---|
private void |
copyValues(File file,
byte[] values)
Copies the array to the file.
|
private String |
createXMLDocument(OME ome,
boolean binaryData)
Creates the
String version of the XML file
creating using the specified root node. |
private void |
validate(File file)
Validates if the file is compatible with the latest model.
|
void |
writeFile(File file,
OME ome)
Writes the data to the file.
|
void |
writeFile(File file,
OME ome,
boolean binaryData)
Writes the data to the file.
|
public static final String ID_ATTRIBUTE
ID
attribute.public static final String NAME_ATTRIBUTE
Name
attribute.public static final String DIMENSION_ORDER_ATTRIBUTE
DimensionOrder
attribute.public static final String PIXELS_TYPE_ATTRIBUTE
PixelType
attribute.public static final String SIZE_C_ATTRIBUTE
SizeC
attribute.public static final String SIZE_T_ATTRIBUTE
SizeT
attribute.public static final String SIZE_Z_ATTRIBUTE
SizeZ
attribute.public static final String SIZE_X_ATTRIBUTE
SizeX
attribute.public static final String SIZE_Y_ATTRIBUTE
SizeY
attribute.public static final String COMPRESSION_ATTRIBUTE
Compression
attribute.public static final String BIG_ENDIAN_ATTRIBUTE
BigEndian
attribute.public static final String LENGTH_ATTRIBUTE
Length
attribute.public static final String OME_TAG
OME
tag.public static final String IMAGE_TAG
Image
tag.public static final String PIXELS_TAG
Pixels
tag.public static final String BIN_DATA_TAG
BinData
tag.public static final String BIN_DATA_NS
BinData
tag.private static final String JAXP_SCHEMA_LANGUAGE
private static final String[] SCHEMAS
private static final String XML_NS
private static final String BIN_NS
private static final String XSI_NS
private static final String SCHEMA_LOCATION
private static final String PLANE
private void copyValues(File file, byte[] values) throws Exception
file
- The file where to copy the arrayvalues
- The array to copy.Exception
- Thrown if an error occurred while copy the data.private String createXMLDocument(OME ome, boolean binaryData) throws Exception
String
version of the XML file
creating using the specified root node.ome
- The root node.binaryData
- Pass true
to add the binary data,
false
otherwise.Exception
- Thrown if an error occurred while writing the XML file.private void validate(File file) throws Exception
file
- The file to validate.Exception
- Thrown if the file cannot be validated.public void writeFile(File file, OME ome) throws Exception
file
- The file to handle.ome
- The element to write to the file.Exception
- Thrown if an error occurred while writing the XML file.public void writeFile(File file, OME ome, boolean binaryData) throws Exception
file
- The file to handle.ome
- The element to write to the file.binaryData
- Pass true
to add the binary data,
false
otherwise.Exception
- Thrown if an error occurred while writing the XML file.Copyright © 2016 Open Microscopy Environment