Class ItemInfoBuilder.PropertyInfoBuilder
- java.lang.Object
-
- org.apache.jackrabbit.spi.commons.ItemInfoBuilder.PropertyInfoBuilder
-
- Enclosing class:
- ItemInfoBuilder
public static class ItemInfoBuilder.PropertyInfoBuilder extends Object
Builder forPropertyInfos. UseItemInfoBuilder.NodeInfoBuilder.createPropertyInfo(String)to create an instance of this class.
-
-
Method Summary
-
-
-
Method Detail
-
setName
public ItemInfoBuilder.PropertyInfoBuilder setName(Name name)
Set thenameof this property- Parameters:
name-- Returns:
-
setName
public ItemInfoBuilder.PropertyInfoBuilder setName(String localName)
Set thelocalNameof 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 theof 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 avalueto 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.STRINGvalue to this property.- Parameters:
value-- Returns:
this- Throws:
RepositoryExceptionIllegalStateException- 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.DATEvalue to this property.- Parameters:
value-- Returns:
this- Throws:
RepositoryExceptionIllegalStateException- 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.DOUBLEvalue to this property.- Parameters:
value-- Returns:
this- Throws:
RepositoryExceptionIllegalStateException- 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.LONGvalue to this property.- Parameters:
value-- Returns:
this- Throws:
RepositoryExceptionIllegalStateException- 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.BOOLEANvalue to this property.- Parameters:
value-- Returns:
this- Throws:
RepositoryExceptionIllegalStateException- 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.NAMEvalue to this property.- Parameters:
value-- Returns:
this- Throws:
RepositoryExceptionIllegalStateException- 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.PATHvalue to this property.- Parameters:
value-- Returns:
this- Throws:
RepositoryExceptionIllegalStateException- 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.DECIMALvalue to this property.- Parameters:
value-- Returns:
this- Throws:
RepositoryExceptionIllegalStateException- 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.URIvalue to this property.- Parameters:
value-- Returns:
this- Throws:
RepositoryExceptionIllegalStateException- 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.BINARYvalue to this property.- Parameters:
value-- Returns:
this- Throws:
RepositoryExceptionIllegalStateException- 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.BINARYvalue to this property.- Parameters:
value-- Returns:
this- Throws:
RepositoryExceptionIllegalStateException- 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.BINARYvalue to this property.- Parameters:
value-- Returns:
this- Throws:
RepositoryExceptionIllegalStateException- 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.Listeneris associated with this instance, then itsItemInfoBuilder.Listener.createPropertyInfo(PropertyInfo)methods is called.- Returns:
- the parent builder of this builder
- Throws:
RepositoryExceptionIllegalStateException- 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 thePropertyInfowhich has been built by this builder.- Returns:
- Throws:
IllegalStateException- ifbuild()has not been called before.
-
-