|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object java.util.AbstractMap<K,V> java.util.HashMap<java.lang.String,java.lang.Object> org.apache.sling.jcr.ocm.DefaultMappedObject
public class DefaultMappedObject
The DefaultMappedObject
is used by the JCR based resource
manager implemented by this bundle as a default to map JCR nodes. This class
has the following features:
nt:unstructured
without any mixin types is created
Map
style using the HashMap.get(Object)
and
put(String, Object)
methods.
java.util.List
instances.
Reserved Properties
The following is a list of reserved properties and their meanings. These properties should not be modified through the getters and setters.
path
primaryType
mixinTypes
properties
Mapping JCR Property types
Property type to Java types | |
---|---|
JCR Type | Java Type |
STRING | String |
DATE | String |
BINARY | java.io.InputStream |
DOUBLE | java.lang.Double |
LONG | java.lang.Long |
BOOLEAN | java.lang.Boolean |
NAME | String |
PATH | String |
REFERENCE | String |
Java type to Property type | |
Java Type | JCR Type |
String | STRING |
java.util.Date | DATE |
java.util.Calendar | DATE |
java.util.GregorianCalendar | DATE |
java.io.InputStream | BINARY |
java.lang.Double | DOUBLE |
java.lang.Long | LONG |
java.lang.Integer | LONG |
java.lang.Boolean | BOOLEAN |
Nested Class Summary |
---|
Nested classes/interfaces inherited from class java.util.AbstractMap |
---|
java.util.AbstractMap.SimpleEntry<K,V>, java.util.AbstractMap.SimpleImmutableEntry<K,V> |
Constructor Summary | |
---|---|
DefaultMappedObject()
|
Method Summary | |
---|---|
boolean |
containsKey(java.lang.String key)
Returns true if this map contains the named property. |
java.lang.Object |
get(java.lang.String key)
Returns the value of the indexed property. |
java.util.ArrayList<java.lang.String> |
getMixinTypes()
Returns a list of the mixin node typse of the underlying node or null for new objects or if the node has no mixin node
types. |
java.lang.String |
getPath()
Returns the path of this mapped object. |
java.lang.String |
getPrimaryType()
Returns the primary node type of the underlying node or null
for new objects. |
org.apache.jackrabbit.ocm.manager.collectionconverter.ManageableMap |
getProperties()
Returns the properties of this content to be written to the properties of the repository node. |
java.lang.Object |
put(java.lang.String key,
java.lang.Object value)
Sets the value of the indexed property. |
void |
setMixinTypes(java.util.ArrayList<java.lang.String> mixinTypes)
Sets the mixin node types of the underlying node. |
void |
setPath(java.lang.String path)
Sets the path of this mapped object. |
void |
setPrimaryType(java.lang.String type)
Sets the primary node type of the underlying node. |
void |
setProperties(org.apache.jackrabbit.ocm.manager.collectionconverter.ManageableMap contents)
Sets the properties of this content object as read from the properties of the repository node. |
Methods inherited from class java.util.HashMap |
---|
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, putAll, remove, size, values |
Methods inherited from class java.util.AbstractMap |
---|
equals, hashCode, toString |
Methods inherited from class java.lang.Object |
---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
Methods inherited from interface java.util.Map |
---|
equals, hashCode |
Constructor Detail |
---|
public DefaultMappedObject()
Method Detail |
---|
public java.lang.Object get(java.lang.String key)
For the special property properties
the
getProperties()
method is called to return a copy of this map
instead of looking in the map itself.
key
- The index of the property to return.
null
if the map does not
contain it.public java.lang.Object put(java.lang.String key, java.lang.Object value)
For the special property properties
the
#setProperties(ManagedHashMap)
method is called to insert all
elements of the value
which must be a Map
into this map.
put
in interface java.util.Map<java.lang.String,java.lang.Object>
put
in class java.util.HashMap<java.lang.String,java.lang.Object>
key
- The index of the property to setvalue
- The value of the property to set.
null
if the
property is new.
java.lang.ClassCastException
- If the type of the value
is
ManagedHashMap
for the properties
property.public boolean containsKey(java.lang.String key)
true
if this map contains the named property.
public void setPath(java.lang.String path)
public java.lang.String getPath()
public void setProperties(org.apache.jackrabbit.ocm.manager.collectionconverter.ManageableMap contents)
This method copies the properties of the contents
map into
this map instance.
public org.apache.jackrabbit.ocm.manager.collectionconverter.ManageableMap getProperties()
The contents of the returned map replace all non-protected properties of the repository. That is, existing properties not contained in the map will be removed.
This method returns a new instance of a ManagedHashMap
containing a copy of the current properties on each call.
public void setPrimaryType(java.lang.String type)
This method should only be called by the Graffito Mapper to set the type read from the node.
public java.lang.String getPrimaryType()
null
for new objects.
public void setMixinTypes(java.util.ArrayList<java.lang.String> mixinTypes)
This method should only be called by the Graffito Mapper to set the types read from the node.
public java.util.ArrayList<java.lang.String> getMixinTypes()
null
for new objects or if the node has no mixin node
types.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |