org.apache.sling.jcr.resource
Class JcrPropertyMap
java.lang.Object
org.apache.sling.jcr.resource.JcrPropertyMap
- All Implemented Interfaces:
- java.util.Map<java.lang.String,java.lang.Object>, ValueMap
- Direct Known Subclasses:
- JcrModifiablePropertyMap
public class JcrPropertyMap
- extends java.lang.Object
- implements ValueMap
Nested classes/interfaces inherited from interface java.util.Map |
java.util.Map.Entry<K,V> |
Field Summary |
protected java.util.Map<java.lang.String,java.lang.Object> |
cache
|
protected boolean |
fullyRead
|
Fields inherited from interface org.apache.sling.api.resource.ValueMap |
EMPTY |
Method Summary |
void |
clear()
|
boolean |
containsKey(java.lang.Object key)
|
boolean |
containsValue(java.lang.Object value)
|
java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> |
entrySet()
|
java.lang.Object |
get(java.lang.Object key)
|
|
get(java.lang.String name,
java.lang.Class<T> type)
Get a named property and convert it into the given type. |
|
get(java.lang.String name,
T defaultValue)
Get a named property and convert it into the given type. |
protected javax.jcr.Node |
getNode()
|
java.lang.String |
getPath()
Return the path of the current node. |
boolean |
isEmpty()
|
java.util.Set<java.lang.String> |
keySet()
|
java.lang.Object |
put(java.lang.String key,
java.lang.Object value)
|
void |
putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> t)
|
protected java.lang.Object |
read(java.lang.String key)
|
protected void |
readFully()
|
java.lang.Object |
remove(java.lang.Object key)
|
int |
size()
|
java.util.Collection<java.lang.Object> |
values()
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface java.util.Map |
equals, hashCode |
cache
protected final java.util.Map<java.lang.String,java.lang.Object> cache
fullyRead
protected boolean fullyRead
JcrPropertyMap
public JcrPropertyMap(javax.jcr.Node node)
getNode
protected javax.jcr.Node getNode()
get
public <T> T get(java.lang.String name,
java.lang.Class<T> type)
- Description copied from interface:
ValueMap
- Get a named property and convert it into the given type.
- Specified by:
get
in interface ValueMap
- Parameters:
name
- The name of the propertytype
- The class of the type
- Returns:
- Return named value converted to type T or
null
if
non existing or can't be converted.
get
public <T> T get(java.lang.String name,
T defaultValue)
- Description copied from interface:
ValueMap
- Get a named property and convert it into the given type.
- Specified by:
get
in interface ValueMap
- Parameters:
name
- The name of the propertydefaultValue
- The default value to use if the named property does
not exist or cannot be converted to the requested type. The
default value is also used to define the type to convert the
value to. If this is null
any existing propert is
not converted.
- Returns:
- Return named value converted to type T or the default value if
non existing or can't be converted.
get
public java.lang.Object get(java.lang.Object key)
- Specified by:
get
in interface java.util.Map<java.lang.String,java.lang.Object>
containsKey
public boolean containsKey(java.lang.Object key)
- Specified by:
containsKey
in interface java.util.Map<java.lang.String,java.lang.Object>
- See Also:
Map.containsKey(java.lang.Object)
containsValue
public boolean containsValue(java.lang.Object value)
- Specified by:
containsValue
in interface java.util.Map<java.lang.String,java.lang.Object>
- See Also:
Map.containsValue(java.lang.Object)
isEmpty
public boolean isEmpty()
- Specified by:
isEmpty
in interface java.util.Map<java.lang.String,java.lang.Object>
- See Also:
Map.isEmpty()
size
public int size()
- Specified by:
size
in interface java.util.Map<java.lang.String,java.lang.Object>
- See Also:
Map.size()
entrySet
public java.util.Set<java.util.Map.Entry<java.lang.String,java.lang.Object>> entrySet()
- Specified by:
entrySet
in interface java.util.Map<java.lang.String,java.lang.Object>
- See Also:
Map.entrySet()
keySet
public java.util.Set<java.lang.String> keySet()
- Specified by:
keySet
in interface java.util.Map<java.lang.String,java.lang.Object>
- See Also:
Map.keySet()
values
public java.util.Collection<java.lang.Object> values()
- Specified by:
values
in interface java.util.Map<java.lang.String,java.lang.Object>
- See Also:
Map.values()
getPath
public java.lang.String getPath()
- Return the path of the current node.
- Throws:
java.lang.IllegalStateException
- If a repository exception occurs
read
protected java.lang.Object read(java.lang.String key)
readFully
protected void readFully()
clear
public void clear()
- Specified by:
clear
in interface java.util.Map<java.lang.String,java.lang.Object>
put
public java.lang.Object put(java.lang.String key,
java.lang.Object value)
- Specified by:
put
in interface java.util.Map<java.lang.String,java.lang.Object>
putAll
public void putAll(java.util.Map<? extends java.lang.String,? extends java.lang.Object> t)
- Specified by:
putAll
in interface java.util.Map<java.lang.String,java.lang.Object>
remove
public java.lang.Object remove(java.lang.Object key)
- Specified by:
remove
in interface java.util.Map<java.lang.String,java.lang.Object>
Copyright © 2007-2009. All Rights Reserved.