org.sapia.archie.impl
Class AttributeNode

java.lang.Object
  extended by org.sapia.archie.AbstractNode
      extended by org.sapia.archie.impl.MultiValueNode
          extended by org.sapia.archie.impl.AttributeNode
All Implemented Interfaces:
Node

public class AttributeNode
extends MultiValueNode

Author:
Yanick Duchesne
Copyright:
Copyright © 2002-2003 Sapia Open Source Software. All Rights Reserved.
License:
Read the license.txt file of the jar or visit the license page at the Sapia OSS web site

Field Summary
 
Fields inherited from class org.sapia.archie.impl.MultiValueNode
_valueLists
 
Fields inherited from class org.sapia.archie.AbstractNode
_children, _fac
 
Constructor Summary
protected AttributeNode(java.util.Map children, java.util.Map values, NodeFactory fac)
           
 
Method Summary
 java.lang.Object getValue(NamePart name)
          This method calls onSelect() and onRead() successively, before returning the a value.
protected  boolean isValid(Offer offer)
          This method is called after the onSelectOffer() method is called.
protected  java.lang.Object onSelect(java.util.List offers)
          Cannot be overridden.
protected  Offer onSelectOffer(java.util.List offers)
          Can be overridden to provide custom selection algorithm.
 boolean putValue(NamePart name, java.lang.Object value, boolean overwrite)
          Put a value into this node; overwrites the existing value - if any.
 java.lang.Object removeValue(NamePart name)
          Internally removes the value that this node holds and returns it.
 
Methods inherited from class org.sapia.archie.impl.MultiValueNode
getChildren, getChildrenCount, getChildrenNames, getEntries, getValueCount, getValueNames, onRead, onWrite
 
Methods inherited from class org.sapia.archie.AbstractNode
createChild, getAbsolutePath, getChild, getName, getNameParser, getParent, removeChild, setUp, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

AttributeNode

protected AttributeNode(java.util.Map children,
                        java.util.Map values,
                        NodeFactory fac)
                 throws ProcessingException
Throws:
ProcessingException
Method Detail

getValue

public final java.lang.Object getValue(NamePart name)
Description copied from class: MultiValueNode
This method calls onSelect() and onRead() successively, before returning the a value.

Specified by:
getValue in interface Node
Overrides:
getValue in class MultiValueNode
Returns:
an Object, or null if this node has no value.
See Also:
MultiValueNode.getValue(org.sapia.archie.NamePart)

putValue

public final boolean putValue(NamePart name,
                              java.lang.Object value,
                              boolean overwrite)
Description copied from interface: Node
Put a value into this node; overwrites the existing value - if any.

Specified by:
putValue in interface Node
Overrides:
putValue in class MultiValueNode
Parameters:
name - the name under which to bind the given value.
value - an Object.
overwrite - if true, overwrites the already existing value for the given name - it such is the case.
Returns:
true if the given value was added. Returns false if overwrite is false and a value already exists for the given name.
See Also:
Node.putValue(NamePart, Object, boolean)

removeValue

public final java.lang.Object removeValue(NamePart name)
Description copied from interface: Node
Internally removes the value that this node holds and returns it.

Specified by:
removeValue in interface Node
Overrides:
removeValue in class MultiValueNode
Returns:
an Object, or null if this node has no value.
See Also:
Node.removeValue(org.sapia.archie.NamePart)

onSelect

protected final java.lang.Object onSelect(java.util.List offers)
Cannot be overridden.

Overrides:
onSelect in class MultiValueNode
Parameters:
offers - the list of values to select from.
Returns:
an item from the given list of values.
See Also:
onSelectOffer(List)

onSelectOffer

protected Offer onSelectOffer(java.util.List offers)
Can be overridden to provide custom selection algorithm.

Parameters:
offers - the List of Offers to select from.
Returns:
an Offer

isValid

protected boolean isValid(Offer offer)
This method is called after the onSelectOffer() method is called. It can be overriden to provide custom validation behavior.

Parameters:
offer - the Offer to validate.
Returns:
true if the offer is valid.
See Also:
onSelectOffer(List)


Copyright © 2010 Sapia OSS. All Rights Reserved.