public class OMEXMLServiceImpl extends AbstractService implements OMEXMLService
Modifier and Type | Field and Description |
---|---|
static String |
LATEST_VERSION
Latest OME-XML version namespace.
|
static String |
NO_OME_XML_MSG |
Constructor and Description |
---|
OMEXMLServiceImpl()
Default constructor.
|
Modifier and Type | Method and Description |
---|---|
void |
addMetadataOnly(OMEXMLMetadata omexmlMeta,
int image)
Insert a MetadataOnly element under the Image specified by 'index' in the
given OME-XML metadata object.
|
MetadataRetrieve |
asRetrieve(MetadataStore meta)
Gets the given
MetadataStore object as a MetadataRetrieve . |
MetadataStore |
asStore(MetadataRetrieve meta)
Gets the given
MetadataRetrieve object as a MetadataStore . |
void |
convertMetadata(MetadataRetrieve src,
MetadataStore dest)
Copies information from a metadata retrieval object
(source) into a metadata store (destination).
|
void |
convertMetadata(String xml,
MetadataStore dest)
Converts information from an OME-XML string (source)
into a metadata store (destination).
|
OMEXMLMetadata |
createOMEXMLMetadata()
Creates an OME-XML metadata object using reflection, to avoid
direct dependencies on the optional
loci.formats.ome package. |
OMEXMLMetadata |
createOMEXMLMetadata(String xml)
Creates an OME-XML metadata object using reflection, to avoid
direct dependencies on the optional
loci.formats.ome package,
wrapping a DOM representation of the given OME-XML string. |
OMEXMLMetadata |
createOMEXMLMetadata(String xml,
String version)
Creates an OME-XML metadata object using reflection, to avoid
direct dependencies on the optional
loci.formats.ome package,
wrapping a DOM representation of the given OME-XML string. |
Object |
createOMEXMLRoot(String xml)
Constructs an OME root node.
|
boolean |
equals(Node e1,
Node e2)
Compares two Elements for equality.
|
String |
getLatestVersion()
Retrieves the latest supported version of the OME-XML schema.
|
OMEXMLMetadata |
getOMEMetadata(MetadataRetrieve src)
Returns a
OMEXMLMetadata object with the same
contents as the given MetadataRetrieve, converting it if necessary. |
String |
getOMEXML(MetadataRetrieve src)
Extracts an OME-XML metadata string from the given metadata object,
by converting to an OME-XML metadata object if necessary.
|
String |
getOMEXMLVersion(Object o)
Gets the schema version for the given OME-XML metadata or root object
(e.g., "2007-06" or "2003-FC").
|
Hashtable |
getOriginalMetadata(OMEXMLMetadata omexmlMeta)
Parse any OriginalMetadata annotations from the given OME-XML metadata
object and store them in a Hashtable.
|
boolean |
isEqual(OMEXMLMetadata src1,
OMEXMLMetadata src2)
Determine whether or not two OMEXMLMetadata objects are equal.
|
boolean |
isOMEXMLMetadata(Object o)
Checks whether the given object is an OME-XML metadata object.
|
boolean |
isOMEXMLRoot(Object o)
Checks whether the given object is an OME-XML root object.
|
void |
populateOriginalMetadata(OMEXMLMetadata omexmlMeta,
Hashtable<String,Object> metadata)
Adds the key/value pairs in the specified Hashtable as new
OriginalMetadata annotations in the given OME-XML metadata object.
|
void |
populateOriginalMetadata(OMEXMLMetadata omexmlMeta,
String key,
String value)
Adds the specified key/value pair as a new OriginalMetadata node
to the given OME-XML metadata object.
|
void |
removeBinData(OMEXMLMetadata omexmlMeta)
Remove all of the BinData elements from the given OME-XML metadata object.
|
void |
removeChannels(OMEXMLMetadata omexmlMeta,
int image,
int sizeC)
Remove all but the first sizeC valid Channel elements from the given
OME-XML metadata object.
|
String |
transformToLatestVersion(String xml)
Transforms the given OME-XML string to the latest supported version of
of the OME-XML schema.
|
boolean |
validateOMEXML(String xml)
Attempts to validate the given OME-XML string using
Java's XML validation facility.
|
boolean |
validateOMEXML(String xml,
boolean pixelsHack)
Attempts to validate the given OME-XML string using
Java's XML validation facility.
|
checkClassDependency
public static final String LATEST_VERSION
public static final String NO_OME_XML_MSG
public String getLatestVersion()
OMEXMLService
getLatestVersion
in interface OMEXMLService
OMEXMLService.getLatestVersion()
public String transformToLatestVersion(String xml) throws ServiceException
OMEXMLService
transformToLatestVersion
in interface OMEXMLService
ServiceException
OMEXMLService.transformToLatestVersion(String)
public OMEXMLMetadata createOMEXMLMetadata() throws ServiceException
OMEXMLService
loci.formats.ome
package.createOMEXMLMetadata
in interface OMEXMLService
AbstractOMEXMLMetadata
,
or null if the class is not available.ServiceException
- If there is an error creating the OME-XML
metadata object.OMEXMLService.createOMEXMLMetadata()
public OMEXMLMetadata createOMEXMLMetadata(String xml) throws ServiceException
OMEXMLService
loci.formats.ome
package,
wrapping a DOM representation of the given OME-XML string.createOMEXMLMetadata
in interface OMEXMLService
AbstractOMEXMLMetadata
,
or null if the class is not available.ServiceException
- If there is an error creating the OME-XML
metadata object.OMEXMLService.createOMEXMLMetadata(java.lang.String)
public OMEXMLMetadata createOMEXMLMetadata(String xml, String version) throws ServiceException
OMEXMLService
loci.formats.ome
package,
wrapping a DOM representation of the given OME-XML string.createOMEXMLMetadata
in interface OMEXMLService
xml
- The OME-XML string to use for initial population of the
metadata object.version
- The OME-XML version to use (e.g., "2003-FC" or "2007-06").
If the xml and version parameters are both null, the newest version is
used.AbstractOMEXMLMetadata
,
or null if the class is not available.ServiceException
- If there is an error creating the OME-XML
metadata object.OMEXMLService.createOMEXMLMetadata(java.lang.String, java.lang.String)
public Object createOMEXMLRoot(String xml) throws ServiceException
OMEXMLService
createOMEXMLRoot
in interface OMEXMLService
xml
- String of XML to create the root node from.ServiceException
- If there is an error creating the OME-XML
metadata object.OMEXMLService.createOMEXMLRoot(java.lang.String)
public boolean isOMEXMLMetadata(Object o)
OMEXMLService
isOMEXMLMetadata
in interface OMEXMLService
OMEXMLMetadata
.OMEXMLService.isOMEXMLMetadata(java.lang.Object)
public boolean isOMEXMLRoot(Object o)
OMEXMLService
isOMEXMLRoot
in interface OMEXMLService
OMEXMLNode
.OMEXMLService.isOMEXMLRoot(java.lang.Object)
public String getOMEXMLVersion(Object o)
OMEXMLService
getOMEXMLVersion
in interface OMEXMLService
OMEXMLMetadata
or ome.xml.OMEXMLNode.OMEXMLService.getOMEXMLVersion(java.lang.Object)
public OMEXMLMetadata getOMEMetadata(MetadataRetrieve src) throws ServiceException
OMEXMLService
OMEXMLMetadata
object with the same
contents as the given MetadataRetrieve, converting it if necessary.getOMEMetadata
in interface OMEXMLService
ServiceException
- If there is an error creating the OME-XML
metadata object.OMEXMLService.getOMEMetadata(loci.formats.meta.MetadataRetrieve)
public String getOMEXML(MetadataRetrieve src) throws ServiceException
OMEXMLService
getOMEXML
in interface OMEXMLService
ServiceException
- If there is an error creating the OME-XML
metadata object.OMEXMLService.getOMEXML(loci.formats.meta.MetadataRetrieve)
public boolean validateOMEXML(String xml)
OMEXMLService
validateOMEXML
in interface OMEXMLService
xml
- XML string to validate.OMEXMLService.validateOMEXML(java.lang.String)
public boolean validateOMEXML(String xml, boolean pixelsHack)
OMEXMLService
validateOMEXML
in interface OMEXMLService
xml
- XML string to validate.pixelsHack
- Whether to ignore validation errors
due to childless Pixels elementsOMEXMLService.validateOMEXML(java.lang.String, boolean)
public Hashtable getOriginalMetadata(OMEXMLMetadata omexmlMeta)
OMEXMLService
getOriginalMetadata
in interface OMEXMLService
omexmlMeta
- An object of type
OMEXMLMetadata
.OMEXMLService.getOriginalMetadata(loci.formats.ome.OMEXMLMetadata)
public void populateOriginalMetadata(OMEXMLMetadata omexmlMeta, Hashtable<String,Object> metadata)
OMEXMLService
populateOriginalMetadata
in interface OMEXMLService
omexmlMeta
- An object of type
OMEXMLMetadata
.metadata
- A hashtable containing metadata key/value pairs.OMEXMLService.populateOriginalMetadata(loci.formats.ome.OMEXMLMetadata, Hashtable)
public void populateOriginalMetadata(OMEXMLMetadata omexmlMeta, String key, String value)
OMEXMLService
populateOriginalMetadata
in interface OMEXMLService
omexmlMeta
- An object of type
OMEXMLMetadata
.key
- Metadata key to populate.value
- Metadata value corresponding to the specified key.OMEXMLService.populateOriginalMetadata(loci.formats.ome.OMEXMLMetadata, java.lang.String, java.lang.String)
public void convertMetadata(String xml, MetadataStore dest) throws ServiceException
OMEXMLService
convertMetadata
in interface OMEXMLService
ServiceException
- If there is an error creating the OME-XML
metadata object.OMEXMLService.convertMetadata(java.lang.String, loci.formats.meta.MetadataStore)
public void convertMetadata(MetadataRetrieve src, MetadataStore dest)
OMEXMLService
convertMetadata
in interface OMEXMLService
OMEXMLService.convertMetadata(loci.formats.meta.MetadataRetrieve, loci.formats.meta.MetadataStore)
public void removeBinData(OMEXMLMetadata omexmlMeta)
OMEXMLService
removeBinData
in interface OMEXMLService
OMEXMLService.removeBinData(OMEXMLMetadata)
public void removeChannels(OMEXMLMetadata omexmlMeta, int image, int sizeC)
OMEXMLService
removeChannels
in interface OMEXMLService
OMEXMLService.removeChannels(OMEXMLMetadata, int, int)
public void addMetadataOnly(OMEXMLMetadata omexmlMeta, int image)
OMEXMLService
addMetadataOnly
in interface OMEXMLService
OMEXMLService.addMetadataOnly(OMEXMLMetadata, int)
public boolean isEqual(OMEXMLMetadata src1, OMEXMLMetadata src2)
OMEXMLService
isEqual
in interface OMEXMLService
OMEXMLService.isEqual(OMEXMLMetadata, OMEXMLMetadata)
public MetadataStore asStore(MetadataRetrieve meta)
OMEXMLService
MetadataRetrieve
object as a MetadataStore
.
Returns null if the object is incompatible and cannot be casted.asStore
in interface OMEXMLService
OMEXMLService.asStore(loci.formats.meta.MetadataRetrieve)
public MetadataRetrieve asRetrieve(MetadataStore meta)
OMEXMLService
MetadataStore
object as a MetadataRetrieve
.
Returns null if the object is incompatible and cannot be casted.asRetrieve
in interface OMEXMLService
OMEXMLService.asRetrieve(loci.formats.meta.MetadataStore)
Copyright © 2014 Open Microscopy Environment