com.evolveum.midpoint.prism
Class PrismReferenceValue

java.lang.Object
  extended by com.evolveum.midpoint.prism.PrismValue
      extended by com.evolveum.midpoint.prism.PrismReferenceValue
All Implemented Interfaces:
Visitable, DebugDumpable, Dumpable, java.io.Serializable

public class PrismReferenceValue
extends PrismValue
implements Dumpable, DebugDumpable, java.io.Serializable

Author:
Radovan Semancik
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.evolveum.midpoint.prism.PrismValue
domElement
 
Fields inherited from interface com.evolveum.midpoint.util.DebugDumpable
INDENT_STRING
 
Constructor Summary
PrismReferenceValue()
           
PrismReferenceValue(java.lang.String oid)
           
PrismReferenceValue(java.lang.String oid, OriginType type, Objectable source)
           
 
Method Summary
 void applyDefinition(ItemDefinition definition, boolean force)
           
 void applyDefinition(PrismReferenceDefinition definition, boolean force)
           
 void checkConsistenceInternal(Itemable rootItem, ItemPath parentPath, boolean requireDefinitions, boolean prohibitRaw)
           
 PrismReferenceValue clone()
           
protected  void copyValues(PrismReferenceValue clone)
           
protected  org.w3c.dom.Element createDomElement()
           
static PrismReferenceValue createFromTarget(PrismObject<?> refTarget)
           
 java.lang.String debugDump()
          Show the content of the object intended for diagnostics by system administrator.
 java.lang.String debugDump(int indent)
           
 java.lang.String dump()
          Show the content of the object intended for diagnostics by developer.
 boolean equals(java.lang.Object obj)
           
 boolean equalsComplex(PrismReferenceValue other, boolean ignoreMetadata, boolean isLiteral)
           
 boolean equalsComplex(PrismValue other, boolean ignoreMetadata, boolean isLiteral)
           
 java.lang.String getDescription()
           
 org.w3c.dom.Element getFilter()
           
 PrismObject getObject()
           
 java.lang.String getOid()
          OID of the object that this reference refers to (reference target).
 javax.xml.namespace.QName getRelation()
           
 javax.xml.namespace.QName getTargetType()
          Returns XSD type of the object that this reference refers to.
 int hashCode()
           
 boolean isEmpty()
           
 boolean isRaw()
          Returns true if the value is raw.
 void recompute(PrismContext prismContext)
           
 boolean representsSameValue(PrismReferenceValue other)
           
 boolean representsSameValue(PrismValue other)
          Returns true if this and other value represent the same value.
 void setDescription(java.lang.String description)
           
 void setFilter(org.w3c.dom.Element filter)
           
 void setObject(PrismObject object)
           
 void setOid(java.lang.String oid)
           
 void setRelation(javax.xml.namespace.QName relation)
           
 void setTargetType(javax.xml.namespace.QName targetType)
           
 PrismReferenceValue toCannonical()
          Returns a version of this value that is cannonical, that means it has the minimal form.
 java.lang.String toString()
           
 
Methods inherited from class com.evolveum.midpoint.prism.PrismValue
accept, applyDefinition, asDomElement, clearDomElement, cloneCollection, cloneValues, containsRealValue, copyValues, diff, diff, equals, equals, equalsRealValue, equalsRealValue, getOriginObject, getOriginType, getParent, getPath, getPrismContext, normalize, recompute, resetParentCollection, revive, setOriginObject, setOriginType, setParent
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrismReferenceValue

public PrismReferenceValue()

PrismReferenceValue

public PrismReferenceValue(java.lang.String oid)

PrismReferenceValue

public PrismReferenceValue(java.lang.String oid,
                           OriginType type,
                           Objectable source)
Method Detail

getOid

public java.lang.String getOid()
OID of the object that this reference refers to (reference target). May return null, but the reference is in that case incomplete and unusable.

Returns:
the target oid

setOid

public void setOid(java.lang.String oid)

getObject

public PrismObject getObject()

setObject

public void setObject(PrismObject object)

getTargetType

public javax.xml.namespace.QName getTargetType()
Returns XSD type of the object that this reference refers to. It may be used in XPath expressions and similar filters. May return null if the type name is not set.

Returns:
the target type name

setTargetType

public void setTargetType(javax.xml.namespace.QName targetType)

getRelation

public javax.xml.namespace.QName getRelation()

setRelation

public void setRelation(javax.xml.namespace.QName relation)

getDescription

public java.lang.String getDescription()

setDescription

public void setDescription(java.lang.String description)

getFilter

public org.w3c.dom.Element getFilter()

setFilter

public void setFilter(org.w3c.dom.Element filter)

isRaw

public boolean isRaw()
Description copied from class: PrismValue
Returns true if the value is raw. Raw value is a semi-parsed value. A value for which we don't have a full definition yet and therefore the parsing could not be finished until the defintion is supplied.

Specified by:
isRaw in class PrismValue

applyDefinition

public void applyDefinition(ItemDefinition definition,
                            boolean force)
                     throws SchemaException
Overrides:
applyDefinition in class PrismValue
Throws:
SchemaException

applyDefinition

public void applyDefinition(PrismReferenceDefinition definition,
                            boolean force)
                     throws SchemaException
Throws:
SchemaException

recompute

public void recompute(PrismContext prismContext)
Specified by:
recompute in class PrismValue

createDomElement

protected org.w3c.dom.Element createDomElement()
Specified by:
createDomElement in class PrismValue

checkConsistenceInternal

public void checkConsistenceInternal(Itemable rootItem,
                                     ItemPath parentPath,
                                     boolean requireDefinitions,
                                     boolean prohibitRaw)
Specified by:
checkConsistenceInternal in class PrismValue

isEmpty

public boolean isEmpty()
Specified by:
isEmpty in class PrismValue

toCannonical

public PrismReferenceValue toCannonical()
Returns a version of this value that is cannonical, that means it has the minimal form. E.g. it will have only OID and no object.


equalsComplex

public boolean equalsComplex(PrismValue other,
                             boolean ignoreMetadata,
                             boolean isLiteral)
Overrides:
equalsComplex in class PrismValue

equalsComplex

public boolean equalsComplex(PrismReferenceValue other,
                             boolean ignoreMetadata,
                             boolean isLiteral)

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class PrismValue

hashCode

public int hashCode()
Overrides:
hashCode in class PrismValue

representsSameValue

public boolean representsSameValue(PrismValue other)
Description copied from class: PrismValue
Returns true if this and other value represent the same value. E.g. if they have the same IDs, OIDs or it is otherwise know that they "belong together" without a deep examination of the values.

Overrides:
representsSameValue in class PrismValue

representsSameValue

public boolean representsSameValue(PrismReferenceValue other)

createFromTarget

public static PrismReferenceValue createFromTarget(PrismObject<?> refTarget)

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

debugDump

public java.lang.String debugDump()
Description copied from interface: DebugDumpable
Show the content of the object intended for diagnostics by system administrator. The out put should be suitable to use in system logs at "debug" level. It may be multi-line, but in that case it should be well indented and quite terse. As it is intended to be used by system administrator, it should not use any developer terms such as class names, exceptions or stack traces.

Specified by:
debugDump in interface DebugDumpable
Returns:
content of the object intended for diagnostics by system administrator.

debugDump

public java.lang.String debugDump(int indent)
Specified by:
debugDump in interface DebugDumpable

dump

public java.lang.String dump()
Description copied from interface: Dumpable
Show the content of the object intended for diagnostics by developer. The content may be multi-line, in case of hierarchical objects it may be intended. The use of this method may not be efficient. It is not supposed to be used in normal operation. However, it is very useful in tests or in case of dumping objects in severe error situations.

Specified by:
dump in interface Dumpable
Returns:
content of the object intended for diagnostics.

clone

public PrismReferenceValue clone()
Specified by:
clone in class PrismValue

copyValues

protected void copyValues(PrismReferenceValue clone)


Copyright © 2012 evolveum. All Rights Reserved.