org.gcube.data.gml.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.
 URI bytestreamURI()
          Returns a URI to the element's bytestream.
 Calendar creationTime()
          Returns the creation time of the element.
 String id()
          Returns the identifier of the element.
 String language()
          Returns the language of the element.
 Calendar lastUpdate()
          Returns the time of last update of the element.
 Long length()
          Returns the length of the element's bytestream.
 String mimeType()
          Returns the Mime type of the element.
 String name()
          Returns the descriptive name of the element.
 Map<String,GCubeElementProperty> properties()
          Returns the generic properties of the element.
 GCubeElementProperty property(String key)
          Returns a generic property of the element.
 InputStream resolveBytestream()
          Returns an InputStream over the element's bytestream, resolving it if it is referenced by a URI.
 String schemaName()
          Returns the descriptive name of the element's schema.
 URI schemaURI()
          Return the URI of the element's schema.
 String type()
          Returns the type of the element.
 URI uri()
          Returns the storage URI of the element.
 

Method Detail

id

String id()
Returns the identifier of the element.

Returns:
the identifier.

name

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

Returns:
the name.

type

String type()
Returns the type of the element.

Returns:
the name.

creationTime

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

Returns:
the creation time.

lastUpdate

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

Returns:
the last update time.

mimeType

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

Returns:
the Mime type.

length

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

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

InputStream resolveBytestream()
                              throws 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:
IOException

uri

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

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

language

String language()
Returns the language of the element.

Returns:
the language.

schemaURI

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

Returns:
the URI.

schemaName

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

Returns:
the name.

property

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

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

properties

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

Returns:
the properties.


Copyright © 2012. All Rights Reserved.