|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gcube.contentmanagement.gcubemodellibrary.elements.BaseElement
public abstract class BaseElement
Partial implementation of GCubeElement
s.
The implementation is thread-unsafe. Where required, thread-safety is responsibility of clients.
Method Summary | |
---|---|
GCubeElementProperty |
addProperty(GCubeElementProperty property)
Adds a generic property to the element, replacing any property with the same key. |
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. |
boolean |
equals(java.lang.Object obj)
|
int |
hashCode()
|
java.lang.String |
id()
Returns the identifier of the element. |
boolean |
isNew()
Indicates whether the element is new within the system or if it proxies instead an existing 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. |
GCubeElementProperty |
removeProperty(java.lang.String key)
Remove 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. |
void |
setBytestream(byte[] bytes)
Sets the element's bytestream. |
void |
setBytestream(java.io.InputStream stream)
Sets the element's bytestream. |
void |
setBytestream(java.io.Reader stream)
Sets the element's bytestream. |
void |
setBytestreamURI(java.net.URI uri)
Sets the URI of the bytestream. |
void |
setLanguage(java.util.Locale locale)
Sets the language of the element from the corresponding Locale . |
void |
setLenght(java.lang.Long length)
Sets the length; |
void |
setMimeType(java.lang.String type)
Sets the content's Mime type. |
void |
setName(java.lang.String n)
Sets the element name. |
void |
setSchemaName(java.lang.String name)
Sets the descriptive name of the element's schema. |
void |
setSchemaURI(java.net.URI uri)
Sets the URI of the element's schema. |
void |
setType(java.lang.String t)
Sets the element type. |
java.lang.String |
toString()
|
java.lang.String |
type()
Returns the type of the element. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface org.gcube.contentmanagement.gcubemodellibrary.elements.GCubeElement |
---|
uri |
Method Detail |
---|
public boolean isNew()
true
if the element is new, false
if it is a proxy.public java.lang.String id()
id
in interface GCubeElement
public java.util.Calendar creationTime()
creationTime
in interface GCubeElement
public java.util.Calendar lastUpdate()
lastUpdate
in interface GCubeElement
public java.lang.String name()
name
in interface GCubeElement
public void setName(java.lang.String n)
n
- the name.public java.lang.String type()
type
in interface GCubeElement
public void setType(java.lang.String t)
t
- the type.public java.lang.String mimeType()
mimeType
in interface GCubeElement
public void setMimeType(java.lang.String type) throws java.lang.IllegalArgumentException
type
- the Mime type.
java.lang.IllegalArgumentException
public java.net.URI bytestreamURI()
URI
to the element's bytestream.
bytestreamURI
in interface GCubeElement
null
if a URI for the element's bytestream does
not exist or is not included in the element.public void setBytestreamURI(java.net.URI uri)
uri
- the URI.public java.io.InputStream resolveBytestream() throws java.io.IOException
InputStream
over the element's bytestream, resolving it if it is referenced by a URI
.
resolveBytestream
in interface GCubeElement
null
if the element has no bytestream.
java.io.IOException
public byte[] bytestream()
bytestream
in interface GCubeElement
null
if the element has no content or does not include it.public void setBytestream(java.io.InputStream stream) throws java.io.IOException
stream
- an InputStream
from which the bytestream can be read,
or null
to overwrite the current value.
java.io.IOException
- if the stream could not be processed.public void setBytestream(java.io.Reader stream) throws java.io.IOException
stream
- the stream, or null
to unset the current value.
java.io.IOException
- if the stream could not be processed.public void setBytestream(byte[] bytes)
bytes
- the bytes of the stream, or null
to unset the current value.public java.lang.Long length()
length
in interface GCubeElement
public void setLenght(java.lang.Long length)
length.
- public java.lang.String language()
language
in interface GCubeElement
public void setLanguage(java.util.Locale locale)
Locale
.
locale
- the Locale
corresponding to the language.public java.net.URI schemaURI()
schemaURI
in interface GCubeElement
public void setSchemaURI(java.net.URI uri)
uri
- the URI.public java.lang.String schemaName()
schemaName
in interface GCubeElement
public void setSchemaName(java.lang.String name)
name
- the name.public java.util.Map<java.lang.String,GCubeElementProperty> properties()
properties
in interface GCubeElement
public GCubeElementProperty property(java.lang.String key)
property
in interface GCubeElement
null
if the element has no property with the given key.public GCubeElementProperty addProperty(GCubeElementProperty property)
property
- the property.
null
if no such property exists.public GCubeElementProperty removeProperty(java.lang.String key)
key
- the property key.
null
if the element has no property with the given key.public java.lang.String toString()
toString
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |