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
-
-
-
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 RepositoryException
Add aPropertyType.STRING
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
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 RepositoryException
Add aPropertyType.DATE
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
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 RepositoryException
Add aPropertyType.DOUBLE
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
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 RepositoryException
Add aPropertyType.LONG
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
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 RepositoryException
Add aPropertyType.BOOLEAN
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
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 RepositoryException
Add aPropertyType.NAME
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
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 RepositoryException
Add aPropertyType.PATH
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
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 RepositoryException
Add aPropertyType.DECIMAL
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
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 RepositoryException
Add aPropertyType.URI
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
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 RepositoryException
Add aPropertyType.BINARY
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
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 RepositoryException, java.io.IOException
Add aPropertyType.BINARY
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
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 RepositoryException, java.io.IOException
Add aPropertyType.BINARY
value to this property.- Parameters:
value
-- Returns:
this
- Throws:
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 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:
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.
-
-