|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.embl.ebi.escience.baclava.DataThing
public class DataThing
A simple wrapper around an arbitrary Collection object which allows lookup and storage of any metadata within the collection or its children. In addition, there is an object of metadata concerning the DataThing itself. You obtain a DataThing by invoking the bake operation on the DataThingFactory in the factory subpackage, this is to allow the factory to sensibly configure such things as types and underlying collections.
Field Summary | |
---|---|
static java.util.Properties |
mimeTypes
|
static LSIDProvider |
SYSTEM_DEFAULT_LSID_PROVIDER
|
Constructor Summary | |
---|---|
DataThing(DataThing other)
|
|
DataThing(org.jdom.Element e)
Construct a new DataThing from the supplied XML Jdom Element. |
|
DataThing(java.lang.Object o)
Create and bind a new SemanticMarkup object to the DataThing itself, it's not totally clear there's a need for this but it does no harm so why not? |
Method Summary | |
---|---|
java.util.Iterator<DataThing> |
childIterator()
Iterate over all imediate children. |
java.lang.Object |
clone()
|
void |
copyMetadataFrom(DataThing source)
Copy the markup from the supplied DataThing object to this one. |
DataThing |
drillAndSet(DataThing oldDT,
java.lang.String newData)
Drill into a collection searching for a data-object that has the same data with oldDT and replace its data with newData. |
DataThing |
extractChild(java.lang.Object child)
Extract a child object as a DataThing. |
void |
fillLSIDValues()
Populate all unassigned LSID values using the system default LSID provider |
void |
fillLSIDValues(LSIDProvider provider)
Populate all unassigned LSID values in the LSID map from the supplied LSIDProvider. |
java.lang.String[] |
getAllLSIDs()
Return an array of all the LSIDs that this DataThing's LSID map contains as values |
java.lang.Object |
getDataObject()
Get the underlying data object, this is the first level of the data document. |
java.lang.Object |
getDataObjectWithLSID(java.lang.String LSID)
Get the object with the supplied LSID or return null if there isn't one |
org.jdom.Element |
getElement()
Return the JDom Element corresponding to this DataThing represented as XML |
javax.swing.ImageIcon |
getIcon()
Get a display icon for this DataThing, currently this is based on the MIME type from the syntactic type string. |
java.lang.String |
getLSID(java.lang.Object target)
Get the LSID of the named object, returns the empty string if there is no such mapping |
java.util.Map<java.lang.Object,java.lang.String> |
getLSIDMap()
Get the LSID map object->LSID |
SemanticMarkup |
getMetadata()
Return the SemanticMarkup object associated with the DataThing itself |
SemanticMarkup |
getMetadataForObject(java.lang.Object theObject,
boolean supplyDefault)
Get the SemanticMarkup associated with an object in this DataThing. |
java.lang.String |
getMostInterestingMIMETypeForObject(java.lang.Object o)
|
java.lang.String |
getSyntacticType()
Get the syntax type of this DataThing. |
java.lang.String |
getSyntacticTypeForObject(java.lang.Object o)
|
BaclavaIterator |
iterator(java.lang.String desiredType)
Given a desired type, return the BaclavaIterator that provides DataThing objects of this type. |
void |
linkMetadataFrom(DataThing source)
Link the metadata of this object to the specified datathing, similar in effect to the copy operation above in most cases but doesn't deep copy the metadata. |
void |
setLSID(java.lang.Object target,
java.lang.String id)
Set the LSID of the named object to the specified value. |
java.lang.String |
toString()
|
static java.io.File |
writeObjectToFileSystem(java.io.File destination,
java.lang.String name,
java.lang.Object o,
java.lang.String defaultExtension)
Write a specific object to the filesystem this has no access to metadata about the object and so is not particularly clever. |
java.io.File |
writeToFileSystem(java.io.File destination,
java.lang.String name)
Writes the contents of the DataThing into the specified directory using the given name. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static LSIDProvider SYSTEM_DEFAULT_LSID_PROVIDER
public static java.util.Properties mimeTypes
Constructor Detail |
---|
public DataThing(DataThing other)
public DataThing(org.jdom.Element e)
public DataThing(java.lang.Object o)
Method Detail |
---|
public java.util.Map<java.lang.Object,java.lang.String> getLSIDMap()
public void fillLSIDValues()
public void fillLSIDValues(LSIDProvider provider)
public void setLSID(java.lang.Object target, java.lang.String id)
public java.lang.String getLSID(java.lang.Object target)
public java.lang.Object getDataObjectWithLSID(java.lang.String LSID)
public java.lang.String[] getAllLSIDs()
public javax.swing.ImageIcon getIcon()
public SemanticMarkup getMetadata()
public java.lang.Object getDataObject()
public java.lang.String getSyntacticType()
I would imagine that we'll mostly be dealing with types of 'text/plain', lists of same and maybe the occasional 'image/png' or similar, but I think this has enough flexibility to cover most things.
The type string "null" represents and empty DataThing and is the default value returned if the collection is empty.
public java.lang.String getMostInterestingMIMETypeForObject(java.lang.Object o)
public java.lang.String getSyntacticTypeForObject(java.lang.Object o)
public void copyMetadataFrom(DataThing source)
public void linkMetadataFrom(DataThing source)
public SemanticMarkup getMetadataForObject(java.lang.Object theObject, boolean supplyDefault) throws NoMetadataFoundException
NoMetadataFoundException
public org.jdom.Element getElement()
public DataThing extractChild(java.lang.Object child)
public java.util.Iterator<DataThing> childIterator()
public BaclavaIterator iterator(java.lang.String desiredType) throws java.beans.IntrospectionException
java.beans.IntrospectionException
- thrown if the supplied type is not contained within the
current DataThing type.public DataThing drillAndSet(DataThing oldDT, java.lang.String newData)
public java.lang.String toString()
toString
in class java.lang.Object
public java.io.File writeToFileSystem(java.io.File destination, java.lang.String name) throws java.io.IOException
java.io.IOException
public static java.io.File writeObjectToFileSystem(java.io.File destination, java.lang.String name, java.lang.Object o, java.lang.String defaultExtension) throws java.io.IOException
java.io.IOException
public java.lang.Object clone()
clone
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |