org.gcube.datatransformation.datatransformationlibrary.model
Class ContentType

java.lang.Object
  extended by org.gcube.datatransformation.datatransformationlibrary.model.ContentType
Direct Known Subclasses:
TNode

public class ContentType
extends Object

Author:
Dimitris Katris, NKUA

ContentType is the class representing the format of the payload of a DataElement.


Constructor Summary
ContentType()
          Simple constructor.
ContentType(String mimeType, List<Parameter> contentTypeParameters)
          Instantiates a ContentType by setting the mimetype and the content type parameters.
 
Method Summary
 void addContentTypeParameters(Parameter... contentTypeParameters)
          Sets the content type parameters.
 ContentType clone()
           
 boolean equals(Object obj)
           
 void fromDOM(Element contentTypeElement)
          Creates this ContentType from a dom element representing it.
protected  void fromXML(String xml)
           
static boolean gensupport(ContentType supported, ContentType ifsupported)
          This method implements the generic support consistency level for the ContentTypes.
static boolean gensupport(List<Parameter> supported, List<Parameter> ifsupported)
          This method implements the generic support consistency level only for the parameters.
 List<Parameter> getContentTypeParameters()
          Returns the content type parameters.
 String getMimeType()
          Returns the mimetype of the ContentType.
 int hashCode()
           
 void setContentTypeParameters(List<Parameter> contentTypeParameters)
          Sets the content type parameters.
 void setMimeType(String mimeType)
          Sets the mimetype of the ContentType.
static boolean support(ContentType supported, ContentType ifsupported)
          This method implements the support consistency level for the ContentTypes.
static boolean support(List<Parameter> supported, List<Parameter> ifsupported)
          This method implements the support consistency level only for the parameters.
static List<Parameter> supportAndFillUnbound(List<Parameter> supported, List<Parameter> ifsupported)
          This method fills the unbound parameters of the supported content type parameters if they are supported.
 void toDOM(Element parent)
           
 String toString()
           
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ContentType

public ContentType()
Simple constructor.


ContentType

public ContentType(String mimeType,
                   List<Parameter> contentTypeParameters)
Instantiates a ContentType by setting the mimetype and the content type parameters.

Parameters:
mimeType - The mimetype of the ContentType.
contentTypeParameters - The parameters of the ContentType.
Method Detail

getContentTypeParameters

public List<Parameter> getContentTypeParameters()
Returns the content type parameters.

Returns:
The content type parameters.

setContentTypeParameters

public void setContentTypeParameters(List<Parameter> contentTypeParameters)
Sets the content type parameters.

Parameters:
contentTypeParameters - The content type parameters.

addContentTypeParameters

public void addContentTypeParameters(Parameter... contentTypeParameters)
Sets the content type parameters.

Parameters:
contentTypeParameters - The content type parameters.

getMimeType

public String getMimeType()
Returns the mimetype of the ContentType.

Returns:
The mimetype of the ContentType.

setMimeType

public void setMimeType(String mimeType)
Sets the mimetype of the ContentType.

Parameters:
mimeType - The mimetype of the ContentType.

fromDOM

public void fromDOM(Element contentTypeElement)
Creates this ContentType from a dom element representing it.

Parameters:
contentTypeElement - The dom element of the content type.

fromXML

protected void fromXML(String xml)
                throws Exception
Throws:
Exception

toDOM

public void toDOM(Element parent)

equals

public boolean equals(Object obj)
Overrides:
equals in class Object
Parameters:
obj - The object to be checked.
Returns:
True if this and the parameter object are equal.
See Also:
Object.equals(java.lang.Object)

support

public static boolean support(List<Parameter> supported,
                              List<Parameter> ifsupported)
This method implements the support consistency level only for the parameters.

Parameters:
supported - The supported parameters
ifsupported - The parameters to be checked.
Returns:
True if the ifsupported parameters are supported by supported parameters.

support

public static boolean support(ContentType supported,
                              ContentType ifsupported)
This method implements the support consistency level for the ContentTypes.

Parameters:
supported - The supported ContentType.
ifsupported - The ContentType to be checked.
Returns:
True if the ifsupported ContentType is supported by supported ContentType.

gensupport

public static boolean gensupport(List<Parameter> supported,
                                 List<Parameter> ifsupported)
This method implements the generic support consistency level only for the parameters.

Parameters:
supported - The supported parameters
ifsupported - The parameters to be checked.
Returns:
True if the ifsupported parameters are generically supported by supported parameters.

gensupport

public static boolean gensupport(ContentType supported,
                                 ContentType ifsupported)
This method implements the generic support consistency level for the ContentTypes.

Parameters:
supported - The supported ContentType.
ifsupported - The ContentType to be checked.
Returns:
True if the ifsupported ContentType is generically supported by supported ContentType.

toString

public String toString()
Overrides:
toString in class Object
Returns:
The string representation of the ContentType.
See Also:
Object.toString()

supportAndFillUnbound

public static List<Parameter> supportAndFillUnbound(List<Parameter> supported,
                                                    List<Parameter> ifsupported)
This method fills the unbound parameters of the supported content type parameters if they are supported. Otherwise null.

Parameters:
supported - The supported parameters
ifsupported - The parameters to be checked.
Returns:
The filled parameters if supported. Otherwise null.

hashCode

public int hashCode()
Overrides:
hashCode in class Object
Returns:
The hashcode of the ContentType.
See Also:
Object.hashCode()

clone

public ContentType clone()
Overrides:
clone in class Object
Returns:
The ContentType cloned.
See Also:
Object.clone()


Copyright © 2013. All Rights Reserved.