Class ItemInfoBuilder.PropertyInfoBuilder
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.ItemInfoBuilder.PropertyInfoBuilder
-
- Enclosing class:
- ItemInfoBuilder
public static class ItemInfoBuilder.PropertyInfoBuilder extends java.lang.Object
Builder forPropertyInfo
s. UseItemInfoBuilder.NodeInfoBuilder.createPropertyInfo(String)
to create an instance of this class.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ItemInfoBuilder.PropertyInfoBuilder
addValue(boolean value)
Add aPropertyType.BOOLEAN
value to this property.ItemInfoBuilder.PropertyInfoBuilder
addValue(byte[] value)
Add aPropertyType.BINARY
value to this property.ItemInfoBuilder.PropertyInfoBuilder
addValue(double value)
Add aPropertyType.DOUBLE
value to this property.ItemInfoBuilder.PropertyInfoBuilder
addValue(long value)
Add aPropertyType.LONG
value to this property.ItemInfoBuilder.PropertyInfoBuilder
addValue(java.io.File value)
Add aPropertyType.BINARY
value to this property.ItemInfoBuilder.PropertyInfoBuilder
addValue(java.io.InputStream value)
Add aPropertyType.BINARY
value to this property.ItemInfoBuilder.PropertyInfoBuilder
addValue(java.lang.String value)
Add aPropertyType.STRING
value to this property.ItemInfoBuilder.PropertyInfoBuilder
addValue(java.math.BigDecimal value)
Add aPropertyType.DECIMAL
value to this property.ItemInfoBuilder.PropertyInfoBuilder
addValue(java.net.URI value)
Add aPropertyType.URI
value to this property.ItemInfoBuilder.PropertyInfoBuilder
addValue(java.util.Calendar value)
Add aPropertyType.DATE
value to this property.ItemInfoBuilder.PropertyInfoBuilder
addValue(Name value)
Add aPropertyType.NAME
value to this property.ItemInfoBuilder.PropertyInfoBuilder
addValue(Path value)
Add aPropertyType.PATH
value to this property.ItemInfoBuilder.PropertyInfoBuilder
addValue(QValue value)
Add avalue
to this property.ItemInfoBuilder.NodeInfoBuilder
build()
Build thePropertyInfo
.ItemInfoBuilder.NodeInfoBuilder
getParent()
PropertyInfo
getPropertyInfo()
Returns thePropertyInfo
which has been built by this builder.ItemInfoBuilder.PropertyInfoBuilder
setMultivalued(boolean on)
Set this property to multi-values.ItemInfoBuilder.PropertyInfoBuilder
setName(java.lang.String localName)
Set thelocalName
of this propertyItemInfoBuilder.PropertyInfoBuilder
setName(Name name)
Set thename
of this propertyItemInfoBuilder.PropertyInfoBuilder
setNamespace(java.lang.String namespace)
Set the namespaceItemInfoBuilder.PropertyInfoBuilder
setType(int type)
Set the
of this propertytype
-
-
-
Method Detail
-
setName
public ItemInfoBuilder.PropertyInfoBuilder setName(Name name)
Set thename
of this property- Parameters:
name
-- Returns:
-
setName
public ItemInfoBuilder.PropertyInfoBuilder setName(java.lang.String localName)
Set thelocalName
of this property- Parameters:
localName
-- Returns:
-
setNamespace
public ItemInfoBuilder.PropertyInfoBuilder setNamespace(java.lang.String namespace)
Set the namespace- Parameters:
namespace
-- Returns:
-
setType
public ItemInfoBuilder.PropertyInfoBuilder setType(int type)
Set the
of this propertytype
- Parameters:
type
-- Returns:
this
- Throws:
java.lang.IllegalStateException
- if a property of a different type has been added before.
-
addValue
public ItemInfoBuilder.PropertyInfoBuilder addValue(QValue value)
Add avalue
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:
java.lang.IllegalStateException
- if the type of the value does not match the type of this property
-
addValue
public ItemInfoBuilder.PropertyInfoBuilder addValue(java.lang.String value) throws javax.jcr.RepositoryException
Add aPropertyType.STRING
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
javax.jcr.RepositoryException
java.lang.IllegalStateException
- if the type of the value does not match the type of this property
-
addValue
public ItemInfoBuilder.PropertyInfoBuilder addValue(java.util.Calendar value) throws javax.jcr.RepositoryException
Add aPropertyType.DATE
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
javax.jcr.RepositoryException
java.lang.IllegalStateException
- if the type of the value does not match the type of this property
-
addValue
public ItemInfoBuilder.PropertyInfoBuilder addValue(double value) throws javax.jcr.RepositoryException
Add aPropertyType.DOUBLE
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
javax.jcr.RepositoryException
java.lang.IllegalStateException
- if the type of the value does not match the type of this property
-
addValue
public ItemInfoBuilder.PropertyInfoBuilder addValue(long value) throws javax.jcr.RepositoryException
Add aPropertyType.LONG
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
javax.jcr.RepositoryException
java.lang.IllegalStateException
- if the type of the value does not match the type of this property
-
addValue
public ItemInfoBuilder.PropertyInfoBuilder addValue(boolean value) throws javax.jcr.RepositoryException
Add aPropertyType.BOOLEAN
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
javax.jcr.RepositoryException
java.lang.IllegalStateException
- if the type of the value does not match the type of this property
-
addValue
public ItemInfoBuilder.PropertyInfoBuilder addValue(Name value) throws javax.jcr.RepositoryException
Add aPropertyType.NAME
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
javax.jcr.RepositoryException
java.lang.IllegalStateException
- if the type of the value does not match the type of this property
-
addValue
public ItemInfoBuilder.PropertyInfoBuilder addValue(Path value) throws javax.jcr.RepositoryException
Add aPropertyType.PATH
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
javax.jcr.RepositoryException
java.lang.IllegalStateException
- if the type of the value does not match the type of this property
-
addValue
public ItemInfoBuilder.PropertyInfoBuilder addValue(java.math.BigDecimal value) throws javax.jcr.RepositoryException
Add aPropertyType.DECIMAL
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
javax.jcr.RepositoryException
java.lang.IllegalStateException
- if the type of the value does not match the type of this property
-
addValue
public ItemInfoBuilder.PropertyInfoBuilder addValue(java.net.URI value) throws javax.jcr.RepositoryException
Add aPropertyType.URI
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
javax.jcr.RepositoryException
java.lang.IllegalStateException
- if the type of the value does not match the type of this property
-
addValue
public ItemInfoBuilder.PropertyInfoBuilder addValue(byte[] value) throws javax.jcr.RepositoryException
Add aPropertyType.BINARY
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
javax.jcr.RepositoryException
java.lang.IllegalStateException
- if the type of the value does not match the type of this property
-
addValue
public ItemInfoBuilder.PropertyInfoBuilder addValue(java.io.InputStream value) throws javax.jcr.RepositoryException, java.io.IOException
Add aPropertyType.BINARY
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
javax.jcr.RepositoryException
java.lang.IllegalStateException
- if the type of the value does not match the type of this propertyjava.io.IOException
-
addValue
public ItemInfoBuilder.PropertyInfoBuilder addValue(java.io.File value) throws javax.jcr.RepositoryException, java.io.IOException
Add aPropertyType.BINARY
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
javax.jcr.RepositoryException
java.lang.IllegalStateException
- if the type of the value does not match the type of this propertyjava.io.IOException
-
setMultivalued
public ItemInfoBuilder.PropertyInfoBuilder setMultivalued(boolean on)
Set this property to multi-values.- Parameters:
on
-- Returns:
this
- Throws:
java.lang.IllegalStateException
- if this property does not contain exactly on value
-
build
public ItemInfoBuilder.NodeInfoBuilder build() throws javax.jcr.RepositoryException
Build thePropertyInfo
. If aItemInfoBuilder.Listener
is associated with this instance, then itsItemInfoBuilder.Listener.createPropertyInfo(PropertyInfo)
methods is called.- Returns:
- the parent builder of this builder
- Throws:
javax.jcr.RepositoryException
java.lang.IllegalStateException
- if build has been called beforejava.lang.IllegalStateException
- if the type is not set
-
getParent
public ItemInfoBuilder.NodeInfoBuilder getParent()
- Returns:
- the parent builder of this builder
-
getPropertyInfo
public PropertyInfo getPropertyInfo()
Returns thePropertyInfo
which has been built by this builder.- Returns:
- Throws:
java.lang.IllegalStateException
- ifbuild()
has not been called before.
-
-