com.ibm.pim.attribute
Interface LocationAttributeInstance

All Superinterfaces:
AttributeInstance

public interface LocationAttributeInstance
extends AttributeInstance

This interface represents an instance of a location specific attribute on an item.

Since:
6.0.0

Field Summary
 
Fields inherited from interface com.ibm.pim.attribute.AttributeInstance
copyright, OCCURRENCE_DELIMITER, PATH_DELIMITER
 
Method Summary
 java.util.List<LocationAttributeInstance> getChildren()
          Exactly the same as super.getChildren(), except for that children are of type LocationAttributeInstance and the children of a multi-occurrence attribute instance may come from another location.
 java.util.List<LocationAttributeInstance> getInheritedChildren()
          Get the inherited children which contains multi-occurrence children that apply if the "own" multi-occurrence attribute instance has no children.
 InheritedValue getInheritedValue()
          Returns the inherited value for this attribute, which provides both the inherited value and where it came from.
 Category getLocation()
          Returns the LocationData object this LocationDataAttributeInstance belongs to.
 java.util.List<LocationAttributeInstance> getNonInheritedChildren()
          This method is exactly like getChildren, except that inherited children are ignored.
 java.lang.Object getNonInheritedValue()
          Returns the "own" value for this attribute.
 ExtendedAttributeOwner getOwner()
          Same as super.getOwner(), except returns a more specific type.
 LocationAttributeInstance getParent()
          The parent attribute instance of an attribute instance is the attribute instance that contains this attribute instance and would return this attribute instance when getChildren() is called.
 boolean hasInheritedValue()
          Identifies if this locationdata attribute has a non null inherited value.
 boolean hasNonInheritedValue()
          Identifies if this locationdata attribute has a non null, non inherited value.
 boolean isInheriting()
          Identifies if this locationdata attribute inherits
 void useInheritance(boolean flag)
          Sets this location attribute (either value or multi-occurrence), to either override inheritance or to inherit from its parent without providing any values.
 
Methods inherited from interface com.ibm.pim.attribute.AttributeInstance
addOccurrence, canAddOccurrence, getAttributeDefinition, getDisplayValue, getLinkedItem, getOccurrenceIndex, getPath, getPossibleValues, getValue, isGrouping, isMultiOccurrence, isValue, removeOccurrence, setValue, setValue, setValue, setValueByExecutingNonPersistedAttributeRule
 

Method Detail

getOwner

ExtendedAttributeOwner getOwner()
Same as super.getOwner(), except returns a more specific type.

Specified by:
getOwner in interface AttributeInstance
Returns:
the AttributeOwner associated with this AttributeInstance
Throws:
PIMInternalException - If an internal error occurs

getLocation

Category getLocation()
Returns the LocationData object this LocationDataAttributeInstance belongs to.

Returns:
LocationData object
Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use

getParent

LocationAttributeInstance getParent()
The parent attribute instance of an attribute instance is the attribute instance that contains this attribute instance and would return this attribute instance when getChildren() is called.

For the 3 different types of AttributeInstance:

 1. Value:
   If max occurrence of the value is one, then the parent is definitely a directory.
   If the max occurrence of the value is greater than one, then the parent is a multi-occurrence container.
 2. Directory: The parent of a directory is ALWAYS a multi-occurrence container
 3. Multi-Occurrence Container: The parent of a multi-occurrence container is always a directory
 

Specified by:
getParent in interface AttributeInstance
Returns:
the AttributeInstance containing this attribute instance.
Throws:
PIMInternalException - If an internal error occurs

getChildren

java.util.List<LocationAttributeInstance> getChildren()
Exactly the same as super.getChildren(), except for that children are of type LocationAttributeInstance and the children of a multi-occurrence attribute instance may come from another location. I.e., getLocation() does not always give the location from the origination of the request, due to inheritance rules.

Specified by:
getChildren in interface AttributeInstance
Returns:
the child AttributeInstances contained within this instance of a directory or multi-occurrence container attribute
Throws:
java.lang.UnsupportedOperationException - if this is a value instance (cannot have children)
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use

isInheriting

boolean isInheriting()
Identifies if this locationdata attribute inherits

Returns:
true if this locationdata attribute inherits
Throws:
PIMInternalException - If an internal error occurs

hasInheritedValue

boolean hasInheritedValue()
Identifies if this locationdata attribute has a non null inherited value.

Returns:
true if this locationdata attribute has a non-null inherited value
Throws:
PIMInternalException - if an internal error occurs

hasNonInheritedValue

boolean hasNonInheritedValue()
Identifies if this locationdata attribute has a non null, non inherited value.

Returns:
true if this locationdata attribute has a non-null, non inherited value
Throws:
PIMInternalException - if an internal error occurs

getInheritedValue

InheritedValue getInheritedValue()
Returns the inherited value for this attribute, which provides both the inherited value and where it came from.

Returns:
the inherited value for this attribute
Throws:
java.lang.UnsupportedOperationException - if this attribute is not inheriting a value
PIMInternalException - If an internal error occurs

getNonInheritedValue

java.lang.Object getNonInheritedValue()
Returns the "own" value for this attribute. This essentially ignores any inheritance rules. Compare to getValue() which use inheritance if necessary.

Returns:
the "own" value for this attribute
Throws:
java.lang.UnsupportedOperationException - if this attribute is not inheriting a value

getInheritedChildren

java.util.List<LocationAttributeInstance> getInheritedChildren()
Get the inherited children which contains multi-occurrence children that apply if the "own" multi-occurrence attribute instance has no children.

Returns:
List of the multi-occurrence children from another location.
Throws:
PIMInternalException - If an internal error occurs

getNonInheritedChildren

java.util.List<LocationAttributeInstance> getNonInheritedChildren()
This method is exactly like getChildren, except that inherited children are ignored.

Note, that this only applies to getting children for MultiOccurrence attribute instances, because inheritance for individual values occurs inside the value AttributeInstance. In other words, getNonINheritedChildren returns the same exact result as getChildren() except in the case of:

     1. Calling getOwnChildren() on a MultiOccurrence AttributeInstance<p/>
     2. The AttributeInstance has no child occurrences (children) of it's own<p/>
     3. A parent location does have child occurrences.
 

Returns:
List of child occurrences that definitely comes from the AttributeInstance's own location, rather than a parent location.
Throws:
PIMInternalException - If an internal error occurs

useInheritance

void useInheritance(boolean flag)
Sets this location attribute (either value or multi-occurrence), to either override inheritance or to inherit from its parent without providing any values.

In other words, an attribute instance can contain a special null value which means no value, but don't inherit.

If the attribute already does not inherit (has a value or child occurrences), then this method has no effect. Note This method unsets the value if it is set to inherited If this is called on an attribute that has a value, nothing is done.

Throws:
PIMInternalException - If an internal error occurs
PIMAuthorizationException - Reserved for future use
java.lang.UnsupportedOperationException - if called on a grouping attribute instance or a value attribute instance that can have multiple occurrences. Permission.CATALOG_MODIFY_ITEMS