Class PropertyImpl
- java.lang.Object
-
- org.apache.jackrabbit.oak.jcr.session.PropertyImpl
-
-
Field Summary
Fields Modifier and Type Field Description protected T
dlg
static String
ITEM_SAVE_DOES_SESSION_SAVE
static int
MV_PROPERTY_WARN_THRESHOLD
static boolean
SAVE_SESSION
The value of this flag determines the behaviour ofItem.save()
.protected SessionContext
sessionContext
protected SessionDelegate
sessionDelegate
-
Fields inherited from interface javax.jcr.Property
JCR_ACTIVITY, JCR_AUTOCREATED, JCR_BASE_VERSION, JCR_CHILD_VERSION_HISTORY, JCR_CONFIGURATION, JCR_CONTENT, JCR_COPIED_FROM, JCR_CREATED, JCR_CREATED_BY, JCR_CURRENT_LIFECYCLE_STATE, JCR_DATA, JCR_DEFAULT_PRIMARY_TYPE, JCR_DEFAULT_VALUES, JCR_DESCRIPTION, JCR_ENCODING, JCR_FROZEN_MIXIN_TYPES, JCR_FROZEN_PRIMARY_TYPE, JCR_FROZEN_UUID, JCR_HAS_ORDERABLE_CHILD_NODES, JCR_HOST, JCR_ID, JCR_IS_ABSTRACT, JCR_IS_CHECKED_OUT, JCR_IS_MIXIN, JCR_LANGUAGE, JCR_LAST_MODIFIED, JCR_LAST_MODIFIED_BY, JCR_LIFECYCLE_POLICY, JCR_LOCK_IS_DEEP, JCR_LOCK_OWNER, JCR_MANDATORY, JCR_MERGE_FAILED, JCR_MIMETYPE, JCR_MIXIN_TYPES, JCR_MULTIPLE, JCR_NAME, JCR_NODE_TYPE_NAME, JCR_ON_PARENT_VERSION, JCR_PATH, JCR_PORT, JCR_PREDECESSORS, JCR_PRIMARY_ITEM_NAME, JCR_PRIMARY_TYPE, JCR_PROTECTED, JCR_PROTOCOL, JCR_REPOSITORY, JCR_REQUIRED_PRIMARY_TYPES, JCR_REQUIRED_TYPE, JCR_ROOT, JCR_SAME_NAME_SIBLINGS, JCR_STATEMENT, JCR_SUCCESSORS, JCR_SUPERTYPES, JCR_TITLE, JCR_UUID, JCR_VALUE_CONSTRAINTS, JCR_VERSION_HISTORY, JCR_VERSIONABLE_UUID, JCR_WORKSPACE
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
accept(ItemVisitor visitor)
protected @NotNull PropertyState
createMultiState(String oakName, List<Value> values, Type<?> type)
protected @NotNull PropertyState
createSingleState(String oakName, Value value, Type<?> type)
Item
getAncestor(int depth)
@NotNull Binary
getBinary()
boolean
getBoolean()
@NotNull Calendar
getDate()
@NotNull BigDecimal
getDecimal()
@NotNull PropertyDefinition
getDefinition()
int
getDepth()
double
getDouble()
long
getLength()
@org.jetbrains.annotations.NotNull long[]
getLengths()
long
getLong()
@NotNull String
getName()
@NotNull Node
getNode()
@NotNull Node
getParent()
@NotNull String
getPath()
@NotNull Property
getProperty()
@NotNull Session
getSession()
@NotNull InputStream
getStream()
@NotNull String
getString()
int
getType()
@NotNull Value
getValue()
@NotNull Value[]
getValues()
boolean
isModified()
boolean
isMultiple()
boolean
isNew()
boolean
isNode()
boolean
isSame(Item otherItem)
protected <U> U
perform(@NotNull SessionOperation<U> op)
Perform the passedSessionOperation
.void
refresh(boolean keepChanges)
void
remove()
void
save()
void
setValue(boolean value)
void
setValue(double value)
void
setValue(long value)
void
setValue(InputStream value)
void
setValue(String value)
void
setValue(String[] strings)
void
setValue(BigDecimal value)
void
setValue(Calendar value)
void
setValue(Binary value)
void
setValue(Node value)
void
setValue(Value value)
void
setValue(Value[] values)
String
toString()
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface javax.jcr.Item
getAncestor, getDepth, getName, getPath, getSession, isSame, refresh, save
-
-
-
-
Field Detail
-
ITEM_SAVE_DOES_SESSION_SAVE
public static final String ITEM_SAVE_DOES_SESSION_SAVE
- See Also:
- Constant Field Values
-
MV_PROPERTY_WARN_THRESHOLD
public static final int MV_PROPERTY_WARN_THRESHOLD
- See Also:
- Constant Field Values
-
SAVE_SESSION
public static final boolean SAVE_SESSION
The value of this flag determines the behaviour ofItem.save()
. Iffalse
, save will throw aUnsupportedRepositoryOperationException
if the sub tree rooted at this item does not contain all transient changes. Iftrue
, save will delegate toSession.save()
.
-
sessionContext
protected final SessionContext sessionContext
-
dlg
protected final T extends ItemDelegate dlg
-
sessionDelegate
protected final SessionDelegate sessionDelegate
-
-
Method Detail
-
getParent
@NotNull public @NotNull Node getParent() throws RepositoryException
- Specified by:
getParent
in interfaceItem
- Throws:
RepositoryException
-
isModified
public boolean isModified()
- Specified by:
isModified
in interfaceItem
-
remove
public void remove() throws RepositoryException
- Specified by:
remove
in interfaceItem
- Throws:
RepositoryException
-
accept
public void accept(ItemVisitor visitor) throws RepositoryException
- Specified by:
accept
in interfaceItem
- Throws:
RepositoryException
-
setValue
public void setValue(Value value) throws RepositoryException
- Specified by:
setValue
in interfaceProperty
- Throws:
RepositoryException
-
setValue
public void setValue(Value[] values) throws RepositoryException
- Specified by:
setValue
in interfaceProperty
- Throws:
RepositoryException
-
setValue
public void setValue(String value) throws RepositoryException
- Specified by:
setValue
in interfaceProperty
- Throws:
RepositoryException
-
setValue
public void setValue(String[] strings) throws RepositoryException
- Specified by:
setValue
in interfaceProperty
- Throws:
RepositoryException
-
setValue
public void setValue(InputStream value) throws RepositoryException
- Specified by:
setValue
in interfaceProperty
- Throws:
RepositoryException
-
setValue
public void setValue(Binary value) throws RepositoryException
- Specified by:
setValue
in interfaceProperty
- Throws:
RepositoryException
-
setValue
public void setValue(long value) throws RepositoryException
- Specified by:
setValue
in interfaceProperty
- Throws:
RepositoryException
-
setValue
public void setValue(double value) throws RepositoryException
- Specified by:
setValue
in interfaceProperty
- Throws:
RepositoryException
-
setValue
public void setValue(BigDecimal value) throws RepositoryException
- Specified by:
setValue
in interfaceProperty
- Throws:
RepositoryException
-
setValue
public void setValue(Calendar value) throws RepositoryException
- Specified by:
setValue
in interfaceProperty
- Throws:
RepositoryException
-
setValue
public void setValue(boolean value) throws RepositoryException
- Specified by:
setValue
in interfaceProperty
- Throws:
RepositoryException
-
setValue
public void setValue(Node value) throws RepositoryException
- Specified by:
setValue
in interfaceProperty
- Throws:
RepositoryException
-
getValue
@NotNull public @NotNull Value getValue() throws RepositoryException
- Specified by:
getValue
in interfaceProperty
- Throws:
RepositoryException
-
getValues
@NotNull public @NotNull Value[] getValues() throws RepositoryException
- Specified by:
getValues
in interfaceProperty
- Throws:
RepositoryException
-
getString
@NotNull public @NotNull String getString() throws RepositoryException
- Specified by:
getString
in interfaceProperty
- Throws:
RepositoryException
-
getStream
@NotNull public @NotNull InputStream getStream() throws RepositoryException
- Specified by:
getStream
in interfaceProperty
- Throws:
RepositoryException
-
getBinary
@NotNull public @NotNull Binary getBinary() throws RepositoryException
- Specified by:
getBinary
in interfaceProperty
- Throws:
RepositoryException
-
getLong
public long getLong() throws RepositoryException
- Specified by:
getLong
in interfaceProperty
- Throws:
RepositoryException
-
getDouble
public double getDouble() throws RepositoryException
- Specified by:
getDouble
in interfaceProperty
- Throws:
RepositoryException
-
getDecimal
@NotNull public @NotNull BigDecimal getDecimal() throws RepositoryException
- Specified by:
getDecimal
in interfaceProperty
- Throws:
RepositoryException
-
getDate
@NotNull public @NotNull Calendar getDate() throws RepositoryException
- Specified by:
getDate
in interfaceProperty
- Throws:
RepositoryException
-
getBoolean
public boolean getBoolean() throws RepositoryException
- Specified by:
getBoolean
in interfaceProperty
- Throws:
RepositoryException
-
getNode
@NotNull public @NotNull Node getNode() throws RepositoryException
- Specified by:
getNode
in interfaceProperty
- Throws:
RepositoryException
-
getProperty
@NotNull public @NotNull Property getProperty() throws RepositoryException
- Specified by:
getProperty
in interfaceProperty
- Throws:
RepositoryException
-
getLength
public long getLength() throws RepositoryException
- Specified by:
getLength
in interfaceProperty
- Throws:
RepositoryException
-
getLengths
@NotNull public @org.jetbrains.annotations.NotNull long[] getLengths() throws RepositoryException
- Specified by:
getLengths
in interfaceProperty
- Throws:
RepositoryException
-
getDefinition
@NotNull public @NotNull PropertyDefinition getDefinition() throws RepositoryException
- Specified by:
getDefinition
in interfaceProperty
- Throws:
RepositoryException
-
getType
public int getType() throws RepositoryException
- Specified by:
getType
in interfaceProperty
- Throws:
RepositoryException
-
isMultiple
public boolean isMultiple() throws RepositoryException
- Specified by:
isMultiple
in interfaceProperty
- Throws:
RepositoryException
-
perform
@NotNull protected final <U> U perform(@NotNull @NotNull SessionOperation<U> op) throws RepositoryException
Perform the passedSessionOperation
.- Type Parameters:
U
- return type of the operation- Parameters:
op
- operation to perform- Returns:
- the result of
op.perform()
- Throws:
RepositoryException
- as thrown byop.perform()
.
-
getName
@NotNull public @NotNull String getName() throws RepositoryException
- Specified by:
getName
in interfaceItem
- Throws:
RepositoryException
- See Also:
Item.getName()
-
getPath
@NotNull public @NotNull String getPath() throws RepositoryException
- Specified by:
getPath
in interfaceItem
- Throws:
RepositoryException
- See Also:
Item.getPath()
-
getSession
@NotNull public @NotNull Session getSession()
- Specified by:
getSession
in interfaceItem
-
getAncestor
public Item getAncestor(int depth) throws RepositoryException
- Specified by:
getAncestor
in interfaceItem
- Throws:
RepositoryException
-
getDepth
public int getDepth() throws RepositoryException
- Specified by:
getDepth
in interfaceItem
- Throws:
RepositoryException
-
isSame
public boolean isSame(Item otherItem) throws RepositoryException
- Specified by:
isSame
in interfaceItem
- Throws:
RepositoryException
- See Also:
Item.isSame(javax.jcr.Item)
-
save
public void save() throws RepositoryException
This implementation delegates toSession.save()
ifSAVE_SESSION
istrue
. Otherwise it only performs the save if the subtree rooted at this item contains all transient changes. That is, if callingSession.save()
would have the same effect as calling this method. In all other cases this method will throw anUnsupportedRepositoryOperationException
- Specified by:
save
in interfaceItem
- Throws:
RepositoryException
- See Also:
Item.save()
-
refresh
public void refresh(boolean keepChanges) throws RepositoryException
- Specified by:
refresh
in interfaceItem
- Throws:
RepositoryException
- See Also:
Item.refresh(boolean)
-
createSingleState
@NotNull protected @NotNull PropertyState createSingleState(String oakName, Value value, Type<?> type) throws RepositoryException
- Throws:
RepositoryException
-
createMultiState
@NotNull protected @NotNull PropertyState createMultiState(String oakName, List<Value> values, Type<?> type) throws RepositoryException
- Throws:
RepositoryException
-
-