com.evolveum.midpoint.prism
Class PrismObject<T extends Objectable>

java.lang.Object
  extended by com.evolveum.midpoint.prism.Item<PrismContainerValue<V>>
      extended by com.evolveum.midpoint.prism.PrismContainer<T>
          extended by com.evolveum.midpoint.prism.PrismObject<T>
All Implemented Interfaces:
Itemable, PrismContainerable<T>, Visitable, DebugDumpable, Dumpable, java.io.Serializable

public class PrismObject<T extends Objectable>
extends PrismContainer<T>

Common supertype for all identity objects. Defines basic properties that each object must have to live in our system (identifier, name). Objects consists of identifier and name (see definition below) and a set of properties represented as XML elements in the object's body. The attributes are represented as first-level XML elements (tags) of the object XML representation and may be also contained in other tags (e.g. extension, attributes). The QName (namespace and local name) of the element holding the property is considered to be a property name. This class is named MidPointObject instead of Object to avoid confusion with java.lang.Object.

Author:
Radovan Semancik
See Also:
Serialized Form

Field Summary
protected  java.lang.String oid
           
protected  java.lang.String version
           
 
Fields inherited from class com.evolveum.midpoint.prism.PrismContainer
compileTimeClass
 
Fields inherited from class com.evolveum.midpoint.prism.Item
definition, name, parent, prismContext
 
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
 
Constructor Summary
PrismObject(javax.xml.namespace.QName name, java.lang.Class<T> compileTimeClass)
           
PrismObject(javax.xml.namespace.QName name, PrismObjectDefinition<T> definition, PrismContext prismContext)
           
 
Method Summary
protected  java.lang.String additionalDumpDescription()
           
 void addReplaceExisting(Item<?> item)
           
 void applyDefinition(ItemDefinition definition)
           
 org.w3c.dom.Element asDomElement()
          Returns a live DOM representation of the object.
 T asObjectable()
           
 PrismObject<T> clone()
           
protected  void copyValues(PrismObject<T> clone)
           
 ObjectDelta<T> createAddDelta()
           
 ObjectDelta<T> createDeleteDelta()
           
 ObjectDelta<T> createDelta(ChangeType changeType)
           
 ObjectDelta<T> diff(PrismObject<T> other)
           
 ObjectDelta<T> diff(PrismObject<T> other, boolean ignoreMetadata, boolean isLiteral)
           
 boolean equals(java.lang.Object obj)
          Note: hashcode and equals compare the objects in the "java way".
 boolean equivalent(java.lang.Object obj)
          this method ignores some part of the object during comparison (e.g.
 Item<?> findItem(ItemPath path)
           
<I extends Item<?>>
I
findItem(ItemPath path, java.lang.Class<I> type)
           
protected  java.lang.String getDebugDumpClassName()
          Return a human readable name of this class suitable for logs.
 PrismObjectDefinition<T> getDefinition()
          Returns applicable property container definition.
 PrismContainer<?> getExtension()
           
 java.lang.String getOid()
          Returns Object ID (OID).
 PrismValue getParent()
           
 ItemPath getPath(ItemPath pathPrefix)
           
 java.lang.String getVersion()
           
 int hashCode()
          Note: hashcode and equals compare the objects in the "java way".
<I extends Item<?>>
void
removeItem(ItemPath path, java.lang.Class<I> itemType)
           
 void setOid(java.lang.String oid)
           
 void setParent(PrismValue parentValue)
           
 void setVersion(java.lang.String version)
           
 java.lang.String toDebugName()
          Returns short string representing identity of this object.
 java.lang.String toDebugType()
          Returns short string identification of object type.
 java.lang.String toString()
           
 
Methods inherited from class com.evolveum.midpoint.prism.PrismContainer
add, assertDefinitions, canRepresent, checkConsistenceInternal, checkDefinition, containsEquivalentValue, copyValues, createDelta, createNewValue, debugDump, dump, findContainer, findContainer, findItem, findItem, findOrCreateContainer, findOrCreateContainer, findOrCreateItem, findOrCreateItem, findOrCreateProperty, findOrCreateProperty, findOrCreateReference, findOrCreateReference, findProperty, findProperty, findReference, findReference, findReferenceByCompositeObjectElementName, getCompileTimeClass, getNextValue, getPreviousValue, getPropertyRealValue, getValue, getValue, getValues, hasCompleteDefinition, isEmpty, mergeValue, mergeValues, mergeValues, remove, removeContainer, removeContainer, removeProperty, removeProperty, removeReference, removeReference, setDefinition, setPropertyRealValue, setValue, trim
 
Methods inherited from class com.evolveum.midpoint.prism.Item
accept, add, addAll, applyDefinition, asDomElements, assertDefinitions, assertDefinitions, checkConsistence, checkConsistence, checkConsistence, clear, cloneCollection, contains, contains, containsRealValue, copyValues, createNewDefinitionlessItem, debugDump, diff, diff, diff, diffInternal, equalsRealValue, findValue, fixupDelta, getClonedValues, getDisplayName, getHelp, getName, getPrismContext, getUserData, getUserData, getValue, hasRaw, hasRealValue, hasValue, hasValue, isRaw, normalize, remove, remove, removeAll, replace, replaceAll, resetParentCollection, revive, setDefinition, setName, setPrismContext, setUserData, size
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.evolveum.midpoint.prism.Itemable
getName, getPrismContext
 

Field Detail

oid

protected java.lang.String oid

version

protected java.lang.String version
Constructor Detail

PrismObject

public PrismObject(javax.xml.namespace.QName name,
                   java.lang.Class<T> compileTimeClass)

PrismObject

public PrismObject(javax.xml.namespace.QName name,
                   PrismObjectDefinition<T> definition,
                   PrismContext prismContext)
Method Detail

getOid

public java.lang.String getOid()
Returns Object ID (OID). May return null if the object does not have an OID.

Returns:
Object ID (OID)

setOid

public void setOid(java.lang.String oid)

getVersion

public java.lang.String getVersion()

setVersion

public void setVersion(java.lang.String version)

getDefinition

public PrismObjectDefinition<T> getDefinition()
Description copied from class: PrismContainer
Returns applicable property container definition.

May return null if no definition is applicable or the definition is not know.

Specified by:
getDefinition in interface Itemable
Specified by:
getDefinition in interface PrismContainerable<T extends Objectable>
Overrides:
getDefinition in class PrismContainer<T extends Objectable>
Returns:
applicable property container definition

asObjectable

public T asObjectable()

getExtension

public PrismContainer<?> getExtension()

applyDefinition

public void applyDefinition(ItemDefinition definition)
                     throws SchemaException
Overrides:
applyDefinition in class PrismContainer<T extends Objectable>
Throws:
SchemaException

findItem

public <I extends Item<?>> I findItem(ItemPath path,
                                      java.lang.Class<I> type)
Overrides:
findItem in class PrismContainer<T extends Objectable>

findItem

public Item<?> findItem(ItemPath path)
Overrides:
findItem in class PrismContainer<T extends Objectable>

removeItem

public <I extends Item<?>> void removeItem(ItemPath path,
                                           java.lang.Class<I> itemType)
Overrides:
removeItem in class PrismContainer<T extends Objectable>

addReplaceExisting

public void addReplaceExisting(Item<?> item)
                        throws SchemaException
Throws:
SchemaException

clone

public PrismObject<T> clone()
Overrides:
clone in class PrismContainer<T extends Objectable>

copyValues

protected void copyValues(PrismObject<T> clone)

diff

public ObjectDelta<T> diff(PrismObject<T> other)

diff

public ObjectDelta<T> diff(PrismObject<T> other,
                           boolean ignoreMetadata,
                           boolean isLiteral)

createDelta

public ObjectDelta<T> createDelta(ChangeType changeType)

createAddDelta

public ObjectDelta<T> createAddDelta()

createDeleteDelta

public ObjectDelta<T> createDeleteDelta()

setParent

public void setParent(PrismValue parentValue)
Overrides:
setParent in class Item<PrismContainerValue<T extends Objectable>>

getParent

public PrismValue getParent()
Overrides:
getParent in class Item<PrismContainerValue<T extends Objectable>>

getPath

public ItemPath getPath(ItemPath pathPrefix)
Specified by:
getPath in interface Itemable
Overrides:
getPath in class Item<PrismContainerValue<T extends Objectable>>

asDomElement

public org.w3c.dom.Element asDomElement()
Returns a live DOM representation of the object. Although the representation should be DOM-compliant, current implementation is only somehow compliant. E.g. it cannot provide owner document and the parent links may be broken in JAXB objects. But it may be good for some uses. For a full DOM representation see PrismJaxbProcessor (serializeToDom).


hashCode

public int hashCode()
Note: hashcode and equals compare the objects in the "java way". That means the objects must be almost preciselly equal to match (e.g. including source demarcation in values and other "annotations"). For a method that compares the "meaningful" parts of the objects see equivalent().

Overrides:
hashCode in class PrismContainer<T extends Objectable>

equals

public boolean equals(java.lang.Object obj)
Note: hashcode and equals compare the objects in the "java way". That means the objects must be almost preciselly equal to match (e.g. including source demarcation in values and other "annotations"). For a method that compares the "meaningful" parts of the objects see equivalent().

Overrides:
equals in class PrismContainer<T extends Objectable>

equivalent

public boolean equivalent(java.lang.Object obj)
this method ignores some part of the object during comparison (e.g. source demarkation in values) These methods compare the "meaningful" parts of the objects.

Overrides:
equivalent in class PrismContainer<T extends Objectable>

toString

public java.lang.String toString()
Overrides:
toString in class PrismContainer<T extends Objectable>

toDebugName

public java.lang.String toDebugName()
Returns short string representing identity of this object. It should container object type, OID and name. It should be presented in a form suitable for log and diagnostic messages (understandable for system administrator).


toDebugType

public java.lang.String toDebugType()
Returns short string identification of object type. It should be in a form suitable for log messages. There is no requirement for the type name to be unique, but it rather has to be compact. E.g. short element names are preferred to long QNames or URIs.

Returns:

getDebugDumpClassName

protected java.lang.String getDebugDumpClassName()
Return a human readable name of this class suitable for logs.

Overrides:
getDebugDumpClassName in class PrismContainer<T extends Objectable>

additionalDumpDescription

protected java.lang.String additionalDumpDescription()
Overrides:
additionalDumpDescription in class PrismContainer<T extends Objectable>


Copyright © 2012 evolveum. All Rights Reserved.