Class ItemInfoBuilder.PropertyInfoBuilder
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.ItemInfoBuilder.PropertyInfoBuilder
-
- Enclosing class:
- ItemInfoBuilder
public static class ItemInfoBuilder.PropertyInfoBuilder extends 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(String localName)
Set thelocalName
of this property- Parameters:
localName
-- Returns:
-
setNamespace
public ItemInfoBuilder.PropertyInfoBuilder setNamespace(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:
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:
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 aPropertyType.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 aPropertyType.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 aPropertyType.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 aPropertyType.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 aPropertyType.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 aPropertyType.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 aPropertyType.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 aPropertyType.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 aPropertyType.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 aPropertyType.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 aPropertyType.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 propertyIOException
-
addValue
public ItemInfoBuilder.PropertyInfoBuilder addValue(File value) throws RepositoryException, IOException
Add aPropertyType.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 propertyIOException
-
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 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
IllegalStateException
- if build has been called beforeIllegalStateException
- 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:
IllegalStateException
- ifbuild()
has not been called before.
-
-