org.apache.jackrabbit.spi.commons
Class ItemInfoBuilder.PropertyInfoBuilder

java.lang.Object
  extended by org.apache.jackrabbit.spi.commons.ItemInfoBuilder.PropertyInfoBuilder
Enclosing class:
ItemInfoBuilder

public static class ItemInfoBuilder.PropertyInfoBuilder
extends Object

Builder for PropertyInfos. Use ItemInfoBuilder.NodeInfoBuilder.createPropertyInfo(String) to create an instance of this class.


Method Summary
 ItemInfoBuilder.PropertyInfoBuilder addValue(BigDecimal value)
          Add a PropertyType.DECIMAL value to this property.
 ItemInfoBuilder.PropertyInfoBuilder addValue(boolean value)
          Add a PropertyType.BOOLEAN value to this property.
 ItemInfoBuilder.PropertyInfoBuilder addValue(byte[] value)
          Add a PropertyType.BINARY value to this property.
 ItemInfoBuilder.PropertyInfoBuilder addValue(Calendar value)
          Add a PropertyType.DATE value to this property.
 ItemInfoBuilder.PropertyInfoBuilder addValue(double value)
          Add a PropertyType.DOUBLE value to this property.
 ItemInfoBuilder.PropertyInfoBuilder addValue(File value)
          Add a PropertyType.BINARY value to this property.
 ItemInfoBuilder.PropertyInfoBuilder addValue(InputStream value)
          Add a PropertyType.BINARY value to this property.
 ItemInfoBuilder.PropertyInfoBuilder addValue(long value)
          Add a PropertyType.LONG value to this property.
 ItemInfoBuilder.PropertyInfoBuilder addValue(Name value)
          Add a PropertyType.NAME value to this property.
 ItemInfoBuilder.PropertyInfoBuilder addValue(Path value)
          Add a PropertyType.PATH value to this property.
 ItemInfoBuilder.PropertyInfoBuilder addValue(QValue value)
          Add a value to this property.
 ItemInfoBuilder.PropertyInfoBuilder addValue(String value)
          Add a PropertyType.STRING value to this property.
 ItemInfoBuilder.PropertyInfoBuilder addValue(URI value)
          Add a PropertyType.URI value to this property.
 ItemInfoBuilder.NodeInfoBuilder build()
          Build the PropertyInfo.
 PropertyInfo getPropertyInfo()
          Returns the PropertyInfo which has been built by this builder.
 ItemInfoBuilder.PropertyInfoBuilder setMultivalued(boolean on)
          Set this property to multi-values.
 ItemInfoBuilder.PropertyInfoBuilder setType(int type)
          Set the type of this property
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

setType

public ItemInfoBuilder.PropertyInfoBuilder setType(int type)
Set the type of this property

Parameters:
type -
Returns:
this
Throws:
IllegalStateException - if a property of a different type has been added before.

addValue

public ItemInfoBuilder.PropertyInfoBuilder addValue(QValue value)
Add a value to this property. Sets this property to single valued if this is the first value. Otherwise sets this property to multi-valued.

Parameters:
value -
Returns:
this
Throws:
IllegalStateException - if the type of the value does not match the type of this property

addValue

public ItemInfoBuilder.PropertyInfoBuilder addValue(String value)
                                             throws RepositoryException
Add a PropertyType.STRING value to this property.

Parameters:
value -
Returns:
this
Throws:
RepositoryException
IllegalStateException - if the type of the value does not match the type of this property

addValue

public ItemInfoBuilder.PropertyInfoBuilder addValue(Calendar value)
                                             throws RepositoryException
Add a PropertyType.DATE value to this property.

Parameters:
value -
Returns:
this
Throws:
RepositoryException
IllegalStateException - if the type of the value does not match the type of this property

addValue

public ItemInfoBuilder.PropertyInfoBuilder addValue(double value)
                                             throws RepositoryException
Add a PropertyType.DOUBLE value to this property.

Parameters:
value -
Returns:
this
Throws:
RepositoryException
IllegalStateException - if the type of the value does not match the type of this property

addValue

public ItemInfoBuilder.PropertyInfoBuilder addValue(long value)
                                             throws RepositoryException
Add a PropertyType.LONG value to this property.

Parameters:
value -
Returns:
this
Throws:
RepositoryException
IllegalStateException - if the type of the value does not match the type of this property

addValue

public ItemInfoBuilder.PropertyInfoBuilder addValue(boolean value)
                                             throws RepositoryException
Add a PropertyType.BOOLEAN value to this property.

Parameters:
value -
Returns:
this
Throws:
RepositoryException
IllegalStateException - if the type of the value does not match the type of this property

addValue

public ItemInfoBuilder.PropertyInfoBuilder addValue(Name value)
                                             throws RepositoryException
Add a PropertyType.NAME value to this property.

Parameters:
value -
Returns:
this
Throws:
RepositoryException
IllegalStateException - if the type of the value does not match the type of this property

addValue

public ItemInfoBuilder.PropertyInfoBuilder addValue(Path value)
                                             throws RepositoryException
Add a PropertyType.PATH value to this property.

Parameters:
value -
Returns:
this
Throws:
RepositoryException
IllegalStateException - if the type of the value does not match the type of this property

addValue

public ItemInfoBuilder.PropertyInfoBuilder addValue(BigDecimal value)
                                             throws RepositoryException
Add a PropertyType.DECIMAL value to this property.

Parameters:
value -
Returns:
this
Throws:
RepositoryException
IllegalStateException - if the type of the value does not match the type of this property

addValue

public ItemInfoBuilder.PropertyInfoBuilder addValue(URI value)
                                             throws RepositoryException
Add a PropertyType.URI value to this property.

Parameters:
value -
Returns:
this
Throws:
RepositoryException
IllegalStateException - if the type of the value does not match the type of this property

addValue

public ItemInfoBuilder.PropertyInfoBuilder addValue(byte[] value)
                                             throws RepositoryException
Add a PropertyType.BINARY value to this property.

Parameters:
value -
Returns:
this
Throws:
RepositoryException
IllegalStateException - if the type of the value does not match the type of this property

addValue

public ItemInfoBuilder.PropertyInfoBuilder addValue(InputStream value)
                                             throws RepositoryException,
                                                    IOException
Add a PropertyType.BINARY value to this property.

Parameters:
value -
Returns:
this
Throws:
RepositoryException
IllegalStateException - if the type of the value does not match the type of this property
IOException

addValue

public ItemInfoBuilder.PropertyInfoBuilder addValue(File value)
                                             throws RepositoryException,
                                                    IOException
Add a PropertyType.BINARY value to this property.

Parameters:
value -
Returns:
this
Throws:
RepositoryException
IllegalStateException - if the type of the value does not match the type of this property
IOException

setMultivalued

public ItemInfoBuilder.PropertyInfoBuilder setMultivalued(boolean on)
Set this property to multi-values.

Parameters:
on -
Returns:
this
Throws:
IllegalStateException - if this property does not contain exactly on value

build

public ItemInfoBuilder.NodeInfoBuilder build()
                                      throws RepositoryException
Build the PropertyInfo. If a ItemInfoBuilder.Listener is associated with this instance, then its ItemInfoBuilder.Listener.createPropertyInfo(PropertyInfo) methods is called.

Returns:
the parent builder of this builder
Throws:
RepositoryException
IllegalStateException - if build has been called before
IllegalStateException - if the type is not set

getPropertyInfo

public PropertyInfo getPropertyInfo()
Returns the PropertyInfo which has been built by this builder.

Returns:
Throws:
IllegalStateException - if build() has not been called before.


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