org.gcube.contentmanagement.gcubemodellibrary.elements
Interface GCubeElement

All Known Subinterfaces:
GCubeInnerElement
All Known Implementing Classes:
BaseElement, BaseInnerElement, GCubeAlternative, GCubeAnnotation, GCubeDocument, GCubeMetadata, GCubePart

public interface GCubeElement

The read-only interface of all elements of the gCube Document Model, including GCubeDocuments and their inner elements.

Author:
Federico De Faveri defaveri@isti.cnr.it, Fabio Simeoni (University of Strathclyde)

Method Summary
 byte[] bytestream()
          Returns the element's bytestream.
 java.net.URI bytestreamURI()
          Returns a URI to the element's bytestream.
 java.util.Calendar creationTime()
          Returns the creation time of the element.
 java.lang.String id()
          Returns the identifier of the element.
 java.lang.String language()
          Returns the language of the element.
 java.util.Calendar lastUpdate()
          Returns the time of last update of the element.
 java.lang.Long length()
          Returns the length of the element's bytestream.
 java.lang.String mimeType()
          Returns the Mime type of the element.
 java.lang.String name()
          Returns the descriptive name of the element.
 java.util.Map<java.lang.String,GCubeElementProperty> properties()
          Returns the generic properties of the element.
 GCubeElementProperty property(java.lang.String key)
          Returns a generic property of the element.
 java.io.InputStream resolveBytestream()
          Returns an InputStream over the element's bytestream, resolving it if it is referenced by a URI.
 java.lang.String schemaName()
          Returns the descriptive name of the element's schema.
 java.net.URI schemaURI()
          Return the URI of the element's schema.
 java.lang.String type()
          Returns the type of the element.
 java.net.URI uri()
          Returns the storage URI of the element.
 

Method Detail

id

java.lang.String id()
Returns the identifier of the element.

Returns:
the identifier.

name

java.lang.String name()
Returns the descriptive name of the element.

Returns:
the name.

type

java.lang.String type()
Returns the type of the element.

Returns:
the name.

creationTime

java.util.Calendar creationTime()
Returns the creation time of the element.

Returns:
the creation time.

lastUpdate

java.util.Calendar lastUpdate()
Returns the time of last update of the element.

Returns:
the last update time.

mimeType

java.lang.String mimeType()
Returns the Mime type of the element.

Returns:
the Mime type.

length

java.lang.Long length()
Returns the length of the element's bytestream.

Returns:
the length.

bytestream

byte[] bytestream()
Returns the element's bytestream.

Returns:
the bytestream, or null if the element has no content or does not include it.

bytestreamURI

java.net.URI bytestreamURI()
Returns a URI to the element's bytestream.

Returns:
the URI, or null if a URI for the element's bytestream does not exist or is not included in the element.

resolveBytestream

java.io.InputStream resolveBytestream()
                                      throws java.io.IOException
Returns an InputStream over the element's bytestream, resolving it if it is referenced by a URI.

Returns:
the stream, or null if the element has no bytestream.
Throws:
java.io.IOException

uri

java.net.URI uri()
                 throws java.lang.IllegalStateException,
                        java.net.URISyntaxException
Returns the storage URI of the element.

Returns:
the URI.
Throws:
java.lang.IllegalStateException - if the element has no identifier or is not bound to a document.
java.net.URISyntaxException - if the identifier of the element or its document cannot be used in a URI.

language

java.lang.String language()
Returns the language of the element.

Returns:
the language.

schemaURI

java.net.URI schemaURI()
Return the URI of the element's schema.

Returns:
the URI.

schemaName

java.lang.String schemaName()
Returns the descriptive name of the element's schema.

Returns:
the name.

property

GCubeElementProperty property(java.lang.String key)
Returns a generic property of the element.

Parameters:
name - the property key.
Returns:
the property value, or null if the element has no property with the given key.

properties

java.util.Map<java.lang.String,GCubeElementProperty> properties()
Returns the generic properties of the element.

Returns:
the properties.