|
||||||||||
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<String,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 |
Constructor Summary | |
---|---|
DefaultMappedObject()
|
Method Summary | |
---|---|
boolean |
containsKey(String key)
Returns true if this map contains the named property. |
Object |
get(String key)
Returns the value of the indexed property. |
ArrayList<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. |
String |
getPath()
Returns the path of this mapped object. |
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. |
Object |
put(String key,
Object value)
Sets the value of the indexed property. |
void |
setMixinTypes(ArrayList<String> mixinTypes)
Sets the mixin node types of the underlying node. |
void |
setPath(String path)
Sets the path of this mapped object. |
void |
setPrimaryType(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 Object get(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 Object put(String key, 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 Map<String,Object>
put
in class HashMap<String,Object>
key
- The index of the property to setvalue
- The value of the property to set.
null
if the
property is new.
ClassCastException
- If the type of the value
is
ManagedHashMap
for the properties
property.public boolean containsKey(String key)
true
if this map contains the named property.
public void setPath(String path)
public 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(String type)
This method should only be called by the Graffito Mapper to set the type read from the node.
public String getPrimaryType()
null
for new objects.
public void setMixinTypes(ArrayList<String> mixinTypes)
This method should only be called by the Graffito Mapper to set the types read from the node.
public ArrayList<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 |