|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.apache.jackrabbit.commons.AbstractItem
org.apache.jackrabbit.commons.AbstractProperty
public abstract class AbstractProperty
Abstract base class for implementing the JCR Property interface.
Item methods without a default implementation:
Item.getName()Item.getParent()Item.getSession()Item.isModified()Item.isNew()Item.isSame(Item)Item.refresh(boolean)Item.save()
Property methods without a default implementation:
Property.getDefinition()Property.getValue()Property.getValues()
NOTE: Many of the default method implementations in
this base class rely on the parent node being accessible through the
Item.getParent() call. It is possible (though unlikely) that
access controls deny access to a containing node even though a property
is accessible. In such cases the default method implementations in this
class will not work.
| Constructor Summary | |
|---|---|
AbstractProperty()
|
|
| Method Summary | |
|---|---|
void |
accept(javax.jcr.ItemVisitor visitor)
Accepts the given item visitor. |
boolean |
getBoolean()
Returns the boolean value of this property. |
java.util.Calendar |
getDate()
Returns the date value of this property. |
double |
getDouble()
Returns the double value of this property. |
long |
getLength()
Returns the length of the value of this property. |
long[] |
getLengths()
Returns the lengths of the values of this property. |
long |
getLong()
Returns the long value of this property. |
javax.jcr.Node |
getNode()
Returns the node referenced by this property. |
java.lang.String |
getPath()
Returns the path of this property. |
java.io.InputStream |
getStream()
Returns the binary value of this property. |
java.lang.String |
getString()
Returns the string value of this property. |
int |
getType()
Returns the type of this property. |
boolean |
isNode()
Returns false. |
void |
remove()
Removes this property. |
void |
setValue(boolean value)
Sets the value of this property. |
void |
setValue(java.util.Calendar value)
Sets the value of this property. |
void |
setValue(double value)
Sets the value of this property. |
void |
setValue(java.io.InputStream value)
Sets the value of this property. |
void |
setValue(long value)
Sets the value of this property. |
void |
setValue(javax.jcr.Node value)
Sets the value of this property. |
void |
setValue(java.lang.String value)
Sets the value of this property. |
void |
setValue(java.lang.String[] values)
Sets the values of this property. |
void |
setValue(javax.jcr.Value value)
Sets the value of this property. |
void |
setValue(javax.jcr.Value[] values)
Sets the values of this property. |
| Methods inherited from class org.apache.jackrabbit.commons.AbstractItem |
|---|
getAncestor, getDepth, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Methods inherited from interface javax.jcr.Property |
|---|
getDefinition, getValue, getValues |
| Methods inherited from interface javax.jcr.Item |
|---|
getAncestor, getDepth, getName, getParent, getSession, isModified, isNew, isSame, refresh, save |
| Constructor Detail |
|---|
public AbstractProperty()
| Method Detail |
|---|
public void accept(javax.jcr.ItemVisitor visitor)
throws javax.jcr.RepositoryException
The default implementation calls ItemVisitor.visit(Property)
on the given visitor with this property as the argument.
accept in interface javax.jcr.Itemvisitor - item visitor
javax.jcr.RepositoryException - if an error occurs
public java.lang.String getPath()
throws javax.jcr.RepositoryException
The default implementation constructs the path from the path of the parent node and the name of this property.
getPath in interface javax.jcr.Itemjavax.jcr.RepositoryException - if an error occurspublic boolean isNode()
false.
isNode in interface javax.jcr.Itemfalse
public void remove()
throws javax.jcr.RepositoryException
The default implementation calls Node.setProperty(String, Value)
with a null value on the parent node.
remove in interface javax.jcr.Itemjavax.jcr.RepositoryException - if an error occurs
public boolean getBoolean()
throws javax.jcr.RepositoryException
The default implementation forwards the method call to the
Value instance returned by the generic
Property.getValue() method.
getBoolean in interface javax.jcr.Propertyjavax.jcr.RepositoryException - if an error occurs
public java.util.Calendar getDate()
throws javax.jcr.RepositoryException
The default implementation forwards the method call to the
Value instance returned by the generic
Property.getValue() method.
getDate in interface javax.jcr.Propertyjavax.jcr.RepositoryException - if an error occurs
public double getDouble()
throws javax.jcr.RepositoryException
The default implementation forwards the method call to the
Value instance returned by the generic
Property.getValue() method.
getDouble in interface javax.jcr.Propertyjavax.jcr.RepositoryException - if an error occurs
public long getLength()
throws javax.jcr.RepositoryException
The default implementation measures the length of the Value
instance returned by the generic Property.getValue() method.
getLength in interface javax.jcr.Propertyjavax.jcr.RepositoryException - if an error occurs
public long[] getLengths()
throws javax.jcr.RepositoryException
The default implementation measures the lengths of the Value
instances returned by the generic Property.getValues() method.
getLengths in interface javax.jcr.Propertyjavax.jcr.RepositoryException - if an error occurs
public long getLong()
throws javax.jcr.RepositoryException
The default implementation forwards the method call to the
Value instance returned by the generic
Property.getValue() method.
getLong in interface javax.jcr.Propertyjavax.jcr.RepositoryException - if an error occurs
public javax.jcr.Node getNode()
throws javax.jcr.RepositoryException
The default implementation checks that this property is a reference
property (or tries to convert the property value to a reference) and
uses Session.getNodeByUUID(String) to retrieve the
referenced node.
getNode in interface javax.jcr.Propertyjavax.jcr.RepositoryException - if an error occurs
public java.io.InputStream getStream()
throws javax.jcr.RepositoryException
The default implementation forwards the method call to the
Value instance returned by the generic
Property.getValue() method.
getStream in interface javax.jcr.Propertyjavax.jcr.RepositoryException - if an error occurs
public java.lang.String getString()
throws javax.jcr.RepositoryException
The default implementation forwards the method call to the
Value instance returned by the generic
Property.getValue() method.
getString in interface javax.jcr.Propertyjavax.jcr.RepositoryException - if an error occurs
public int getType()
throws javax.jcr.RepositoryException
The default implementation forwards the method call to the
Value instance returned by the generic
Property.getValue() method.
getType in interface javax.jcr.Propertyjavax.jcr.RepositoryException - if an error occurs
public void setValue(javax.jcr.Value value)
throws javax.jcr.RepositoryException
The default implementation forwards the call to the
Node.setProperty(String, Value) method of the parent node
using the name of this property.
setValue in interface javax.jcr.Propertyvalue - passed through
javax.jcr.RepositoryException - if an error occurs
public void setValue(javax.jcr.Value[] values)
throws javax.jcr.RepositoryException
The default implementation forwards the call to the
Node.setProperty(String, Value[]) method of the parent node
using the name of this property.
setValue in interface javax.jcr.Propertyvalues - passed through
javax.jcr.RepositoryException - if an error occurs
public void setValue(java.lang.String value)
throws javax.jcr.RepositoryException
The default implementation forwards the call to the
Node.setProperty(String, String) method of the parent node
using the name of this property.
setValue in interface javax.jcr.Propertyvalue - passed through
javax.jcr.RepositoryException - if an error occurs
public void setValue(java.lang.String[] values)
throws javax.jcr.RepositoryException
The default implementation forwards the call to the
Node.setProperty(String, String[]) method of the parent node
using the name of this property.
setValue in interface javax.jcr.Propertyvalues - passed through
javax.jcr.RepositoryException - if an error occurs
public void setValue(java.io.InputStream value)
throws javax.jcr.RepositoryException
The default implementation forwards the call to the
Node.setProperty(String, InputStream) method of the parent node
using the name of this property.
setValue in interface javax.jcr.Propertyvalue - passed through
javax.jcr.RepositoryException - if an error occurs
public void setValue(long value)
throws javax.jcr.RepositoryException
The default implementation forwards the call to the
Node.setProperty(String, long) method of the parent node
using the name of this property.
setValue in interface javax.jcr.Propertyvalue - passed through
javax.jcr.RepositoryException - if an error occurs
public void setValue(double value)
throws javax.jcr.RepositoryException
The default implementation forwards the call to the
Node.setProperty(String, double) method of the parent node
using the name of this property.
setValue in interface javax.jcr.Propertyvalue - passed through
javax.jcr.RepositoryException - if an error occurs
public void setValue(java.util.Calendar value)
throws javax.jcr.RepositoryException
The default implementation forwards the call to the
Node.setProperty(String, Calendar) method of the parent node
using the name of this property.
setValue in interface javax.jcr.Propertyvalue - passed through
javax.jcr.RepositoryException - if an error occurs
public void setValue(boolean value)
throws javax.jcr.RepositoryException
The default implementation forwards the call to the
Node.setProperty(String, boolean) method of the parent node
using the name of this property.
setValue in interface javax.jcr.Propertyvalue - passed through
javax.jcr.RepositoryException - if an error occurs
public void setValue(javax.jcr.Node value)
throws javax.jcr.RepositoryException
The default implementation forwards the call to the
Node.setProperty(String, Node) method of the parent node
using the name of this property.
setValue in interface javax.jcr.Propertyvalue - passed through
javax.jcr.RepositoryException - if an error occurs
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||