org.apache.jackrabbit.rmi.client
Class ClientProperty

java.lang.Object
  extended by org.apache.jackrabbit.rmi.client.ClientObject
      extended by org.apache.jackrabbit.rmi.client.ClientItem
          extended by org.apache.jackrabbit.rmi.client.ClientProperty
All Implemented Interfaces:
javax.jcr.Item, javax.jcr.Property

public class ClientProperty
extends ClientItem
implements javax.jcr.Property

Local adapter for the JCR-RMI RemoteProperty interface. This class makes a remote property locally available using the JCR Property interface.

See Also:
Property, RemoteProperty

Field Summary
 
Fields inherited from interface javax.jcr.Property
JCR_ACTIVITY, JCR_AUTOCREATED, JCR_BASE_VERSION, JCR_CHILD_VERSION_HISTORY, JCR_CONFIGURATION, JCR_CONTENT, JCR_COPIED_FROM, JCR_CREATED, JCR_CREATED_BY, JCR_CURRENT_LIFECYCLE_STATE, JCR_DATA, JCR_DEFAULT_PRIMARY_TYPE, JCR_DEFAULT_VALUES, JCR_DESCRIPTION, JCR_ENCODING, JCR_FROZEN_MIXIN_TYPES, JCR_FROZEN_PRIMARY_TYPE, JCR_FROZEN_UUID, JCR_HAS_ORDERABLE_CHILD_NODES, JCR_HOST, JCR_ID, JCR_IS_ABSTRACT, JCR_IS_CHECKED_OUT, JCR_IS_MIXIN, JCR_LANGUAGE, JCR_LAST_MODIFIED, JCR_LAST_MODIFIED_BY, JCR_LIFECYCLE_POLICY, JCR_LOCK_IS_DEEP, JCR_LOCK_OWNER, JCR_MANDATORY, JCR_MERGE_FAILED, JCR_MIMETYPE, JCR_MIXIN_TYPES, JCR_MULTIPLE, JCR_NAME, JCR_NODE_TYPE_NAME, JCR_ON_PARENT_VERSION, JCR_PATH, JCR_PORT, JCR_PREDECESSORS, JCR_PRIMARY_ITEM_NAME, JCR_PRIMARY_TYPE, JCR_PROTECTED, JCR_PROTOCOL, JCR_REPOSITORY, JCR_REQUIRED_PRIMARY_TYPES, JCR_REQUIRED_TYPE, JCR_ROOT, JCR_SAME_NAME_SIBLINGS, JCR_STATEMENT, JCR_SUCCESSORS, JCR_SUPERTYPES, JCR_TITLE, JCR_UUID, JCR_VALUE_CONSTRAINTS, JCR_VERSION_HISTORY, JCR_VERSIONABLE_UUID, JCR_WORKSPACE
 
Constructor Summary
ClientProperty(javax.jcr.Session session, RemoteProperty remote, LocalAdapterFactory factory)
          Creates a local adapter for the given remote property.
 
Method Summary
 void accept(javax.jcr.ItemVisitor visitor)
          Calls the ItemVisitor.visit(Property method of the given visitor.
 javax.jcr.Binary getBinary()
          Returns the binary value of this property.
 boolean getBoolean()
          Returns the boolean value of this property.
 java.util.Calendar getDate()
          Returns the date value of this property.
 java.math.BigDecimal getDecimal()
          Returns the decimal value of this property.
 javax.jcr.nodetype.PropertyDefinition getDefinition()
          
 double getDouble()
          Returns the double value of this property.
 long getLength()
          
 long[] getLengths()
          
 long getLong()
          Returns the long value of this property.
 javax.jcr.Node getNode()
          Returns the reference value of this property.
 javax.jcr.Property getProperty()
          
 java.io.InputStream getStream()
          Returns the binary value of this property.
 java.lang.String getString()
          Returns the string value of this property.
 int getType()
          
 javax.jcr.Value getValue()
          
 javax.jcr.Value[] getValues()
          
 boolean isMultiple()
          
 void setValue(java.math.BigDecimal value)
          Sets the decimal value of this property.
 void setValue(javax.jcr.Binary value)
          Sets the binary value of this property.
 void setValue(boolean value)
          Sets the boolean value of this property.
 void setValue(java.util.Calendar value)
          Sets the date value of this property.
 void setValue(double value)
          Sets the double value of this property.
 void setValue(java.io.InputStream value)
          Sets the binary value of this property.
 void setValue(long value)
          Sets the long value of this property.
 void setValue(javax.jcr.Node value)
          Sets the reference value of this property.
 void setValue(java.lang.String value)
          Sets the string value of this property.
 void setValue(java.lang.String[] strings)
          
 void setValue(javax.jcr.Value value)
          
 void setValue(javax.jcr.Value[] values)
          
 
Methods inherited from class org.apache.jackrabbit.rmi.client.ClientItem
getAncestor, getDepth, getName, getParent, getPath, getSession, isModified, isNew, isNode, isSame, refresh, remove, save
 
Methods inherited from class org.apache.jackrabbit.rmi.client.ClientObject
getFactory, getItem, getNode, getNodeTypeArray
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.jcr.Item
getAncestor, getDepth, getName, getParent, getPath, getSession, isModified, isNew, isNode, isSame, refresh, remove, save
 

Constructor Detail

ClientProperty

public ClientProperty(javax.jcr.Session session,
                      RemoteProperty remote,
                      LocalAdapterFactory factory)
Creates a local adapter for the given remote property.

Parameters:
session - current session
remote - remote property
factory - local adapter factory
Method Detail

accept

public void accept(javax.jcr.ItemVisitor visitor)
            throws javax.jcr.RepositoryException
Calls the ItemVisitor.visit(Property method of the given visitor. Does not contact the remote property, but the visitor may invoke other methods that do contact the remote property. Accepts the visitor to visit this item. Node and Property subclasses should override this method to call the appropriate ItemVisitor methods, as the default implementation does nothing.

Specified by:
accept in interface javax.jcr.Item
Overrides:
accept in class ClientItem
Throws:
javax.jcr.RepositoryException

getBoolean

public boolean getBoolean()
                   throws javax.jcr.RepositoryException
Returns the boolean value of this property. Implemented as getValue().getBoolean().

Specified by:
getBoolean in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

getDate

public java.util.Calendar getDate()
                           throws javax.jcr.RepositoryException
Returns the date value of this property. Implemented as getValue().getDate().

Specified by:
getDate in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

getDouble

public double getDouble()
                 throws javax.jcr.RepositoryException
Returns the double value of this property. Implemented as getValue().getDouble().

Specified by:
getDouble in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

getLong

public long getLong()
             throws javax.jcr.RepositoryException
Returns the long value of this property. Implemented as getValue().getLong().

Specified by:
getLong in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

getBinary

public javax.jcr.Binary getBinary()
                           throws javax.jcr.RepositoryException
Returns the binary value of this property. Implemented as getValue().getBinary().

Specified by:
getBinary in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

getDecimal

public java.math.BigDecimal getDecimal()
                                throws javax.jcr.RepositoryException
Returns the decimal value of this property. Implemented as getValue().getDecimal().

Specified by:
getDecimal in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

getStream

public java.io.InputStream getStream()
                              throws javax.jcr.RepositoryException
Returns the binary value of this property. Implemented as getValue().getStream().

Specified by:
getStream in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

getString

public java.lang.String getString()
                           throws javax.jcr.RepositoryException
Returns the string value of this property. Implemented as getValue().getString().

Specified by:
getString in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

getValue

public javax.jcr.Value getValue()
                         throws javax.jcr.RepositoryException

Specified by:
getValue in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

getValues

public javax.jcr.Value[] getValues()
                            throws javax.jcr.RepositoryException

Specified by:
getValues in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

setValue

public void setValue(boolean value)
              throws javax.jcr.RepositoryException
Sets the boolean value of this property. Implemented as setValue(new BooleanValue(value)).

Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

setValue

public void setValue(java.util.Calendar value)
              throws javax.jcr.RepositoryException
Sets the date value of this property. Implemented as setValue(new DateValue(value)).

Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

setValue

public void setValue(double value)
              throws javax.jcr.RepositoryException
Sets the double value of this property. Implemented as setValue(new DoubleValue(value)).

Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

setValue

public void setValue(java.io.InputStream value)
              throws javax.jcr.RepositoryException
Sets the binary value of this property. Implemented as setValue(new BinaryValue(value)).

Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

setValue

public void setValue(long value)
              throws javax.jcr.RepositoryException
Sets the long value of this property. Implemented as setValue(new LongValue(value)).

Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

setValue

public void setValue(javax.jcr.Binary value)
              throws javax.jcr.RepositoryException
Sets the binary value of this property.

Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

setValue

public void setValue(java.math.BigDecimal value)
              throws javax.jcr.RepositoryException
Sets the decimal value of this property.

Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

setValue

public void setValue(javax.jcr.Node value)
              throws javax.jcr.RepositoryException
Sets the reference value of this property. Implemented as setValue(new ReferenceValue(value)).

Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

setValue

public void setValue(java.lang.String value)
              throws javax.jcr.RepositoryException
Sets the string value of this property. Implemented as setValue(new StringValue(value)).

Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

setValue

public void setValue(java.lang.String[] strings)
              throws javax.jcr.RepositoryException

Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

setValue

public void setValue(javax.jcr.Value value)
              throws javax.jcr.RepositoryException

Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

setValue

public void setValue(javax.jcr.Value[] values)
              throws javax.jcr.RepositoryException

Specified by:
setValue in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

getNode

public javax.jcr.Node getNode()
                       throws javax.jcr.RepositoryException
Returns the reference value of this property. Implemented by converting the reference value to an UUID string and using the current session to look up the referenced node.

Specified by:
getNode in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

getProperty

public javax.jcr.Property getProperty()
                               throws javax.jcr.RepositoryException

Specified by:
getProperty in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

getLength

public long getLength()
               throws javax.jcr.RepositoryException

Specified by:
getLength in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

getLengths

public long[] getLengths()
                  throws javax.jcr.RepositoryException

Specified by:
getLengths in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

getDefinition

public javax.jcr.nodetype.PropertyDefinition getDefinition()
                                                    throws javax.jcr.RepositoryException

Specified by:
getDefinition in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

getType

public int getType()
            throws javax.jcr.RepositoryException

Specified by:
getType in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException

isMultiple

public boolean isMultiple()
                   throws javax.jcr.RepositoryException

Specified by:
isMultiple in interface javax.jcr.Property
Throws:
javax.jcr.RepositoryException


Copyright © 2004-2010 Apache Software Foundation. All Rights Reserved.