org.gcube.datatransformation.datatransformationlibrary.dataelements
Class DataElement

java.lang.Object
  extended by org.gcube.datatransformation.datatransformationlibrary.dataelements.DataElement
Direct Known Subclasses:
CompoundDataElement, DataElementImpl, LocalFileDataElement, StrDataElement

public abstract class DataElement
extends Object

Author:
Dimitris Katris, NKUA This class provides the base implementation of each DataElement.

Field Summary
protected  HashMap<String,String> attributes
          The (name, value) attribute pairs
 
Constructor Summary
DataElement()
           
 
Method Summary
 void deleteAttribute(String attrName)
          Deletes an attribute of the DataElement.
abstract  void destroy()
           
 Map<String,String> getAllAttributes()
          Returns a Map which contains all the attributes of the DataElement.
 String getAttributeValue(String attrName)
          Returns the value of the attribute with name attrName.
abstract  InputStream getContent()
          Abstract method which returns the content of the DataElement in a stream.
 ContentType getContentType()
          Returns the ContentType of the DataElement.
 String getId()
          Returns the id of the DataElement.
 void setAttribute(String attrName, String attrVal)
          Puts an attribute in the DataElement.
 void setContentType(ContentType contentType)
          Sets the ContentType of the DataElement.
 void setId(String id)
          Sets the id of the DataElement.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

attributes

protected HashMap<String,String> attributes
The (name, value) attribute pairs

Constructor Detail

DataElement

public DataElement()
Method Detail

getId

public String getId()
Returns the id of the DataElement.

Returns:
The id of the DataElement.

setId

public void setId(String id)
Sets the id of the DataElement.

Parameters:
id - the id of the DataElement.

getContentType

public ContentType getContentType()
Returns the ContentType of the DataElement.

Returns:
The ContentType of the DataElement.

setContentType

public void setContentType(ContentType contentType)
Sets the ContentType of the DataElement.

Parameters:
contentType - The ContentType of the DataElement.

setAttribute

public void setAttribute(String attrName,
                         String attrVal)
Puts an attribute in the DataElement.

Parameters:
attrName - The name of the attribute.
attrVal - The value of the attribute.

deleteAttribute

public void deleteAttribute(String attrName)
Deletes an attribute of the DataElement.

Parameters:
attrName - The name of the attribute which will be deleted.

getAttributeValue

public String getAttributeValue(String attrName)
Returns the value of the attribute with name attrName.

Parameters:
attrName - The name of the attribute whose value will be returned.
Returns:
The value of the attribute.

getAllAttributes

public Map<String,String> getAllAttributes()
Returns a Map which contains all the attributes of the DataElement.

Returns:
The Map with all the attributes of the DataElement.

getContent

public abstract InputStream getContent()
Abstract method which returns the content of the DataElement in a stream.

Returns:
The content of the DataElement.

destroy

public abstract void destroy()


Copyright © 2013. All Rights Reserved.