SmartFrog 3.10.000

org.smartfrog.sfcore.componentdescription
Interface ComponentDescription

All Superinterfaces:
Copying, PrettyPrinting, ReferenceResolver, ReferenceResolverHelper
All Known Subinterfaces:
CSFComponentDescription, Phases, SFComponentDescription
All Known Implementing Classes:
ComponentDescriptionImpl, CSFComponentDescriptionImpl, SFComponentDescriptionImpl

public interface ComponentDescription
extends PrettyPrinting, Copying, ReferenceResolver, ReferenceResolverHelper

Defines the context interface used by Components. Context implementations need to respect the ordering and copying requirements imposed by Components.

See Also:
Copying

Method Summary
 boolean getEager()
          Gets the eager flag for description.
 Context setContext(Context cxt)
          Sets the context for this description.
 boolean setEager(boolean eager)
          Sets eager flag for description.
 ComponentDescription setParent(ComponentDescription parent)
          Sets parent for this component.
 Prim setPrimParent(Prim parent)
          When a component description is held as an attribute in a Prim, the parent is no longer a ComponentDescription, but the Prim itself.
 java.lang.Object sfAddAttribute(java.lang.Object name, java.lang.Object value)
          Add an attribute to the component description context.
 java.lang.Object sfAttributeKeyFor(java.lang.Object value)
          Returns the attribute key for a given value.
 java.util.Iterator sfAttributes()
          Returns an ordered iterator over the attribute names in the context.
 Reference sfCompleteName()
          Get complete name for this description.
 boolean sfContainsAttribute(java.lang.Object attribute)
          Returns true if the context contains attribute.
 boolean sfContainsValue(java.lang.Object value)
          Returns true if the context contains value.
 Context sfContext()
          Gets the context for this description.
 LogSF sfLog()
          To log into sfCore logger.
 ComponentDescription sfParent()
          Gets the parent for this description.
 Prim sfPrimParent()
          When a component description is held as an attribute in a Prim, the parent is no longer a ComponentDescription, but the Prim itself.
 java.lang.Object sfRemoveAttribute(java.lang.Object name)
          Remove named attribute from component description context.
 java.lang.Object sfReplaceAttribute(java.lang.Object name, java.lang.Object value)
          Replace named attribute in component description context.
 java.util.Iterator sfValues()
          Returns an ordered iterator over the values in the context.
 java.lang.String toString()
          Returns stringified version of description.
 void visit(CDVisitor action, boolean topDown)
          Visit every node in the tree using this as the root, applying an action to the nodes.
 void visit(CDVisitor action, boolean topDown, boolean includeLazy)
          Visit every node in the tree using this as the root, applying an action to the nodes.
 void visit(CDVisitor action, boolean topDown, boolean includeLazy, java.util.Stack path)
          Visit every node in the tree from this node, applying an action to the nodes.
 void visit(CDVisitor action, boolean topDown, java.util.Stack path)
          Visit every node in the tree from this node, applying an action to the nodes.
 void writeOn(java.io.Writer w)
          Write the component description on a writer.
 
Methods inherited from interface org.smartfrog.sfcore.common.PrettyPrinting
writeOn
 
Methods inherited from interface org.smartfrog.sfcore.common.Copying
clone, copy
 
Methods inherited from interface org.smartfrog.sfcore.reference.ReferenceResolver
sfResolve, sfResolve, sfResolveHere, sfResolveHere, sfResolveParent
 
Methods inherited from interface org.smartfrog.sfcore.reference.ReferenceResolverHelper
sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolve, sfResolveHere, sfResolveWithParser
 

Method Detail

sfAddAttribute

java.lang.Object sfAddAttribute(java.lang.Object name,
                                java.lang.Object value)
                                throws SmartFrogRuntimeException
Add an attribute to the component description context. Values should be marshallable types if they are to be referenced remotely at run-time. If an attribute with this name already exists it is not replaced.

Parameters:
name - name of attribute
value - object to be added in context
Returns:
value if successfull, null otherwise
Throws:
SmartFrogRuntimeException - when name or value are null

sfRemoveAttribute

java.lang.Object sfRemoveAttribute(java.lang.Object name)
                                   throws SmartFrogRuntimeException
Remove named attribute from component description context. Non present attribute names are ignored.

Parameters:
name - name of attribute to be removed
Returns:
the removed value if successfull, null otherwise
Throws:
SmartFrogRuntimeException - when name is null

sfAttributeKeyFor

java.lang.Object sfAttributeKeyFor(java.lang.Object value)
Returns the attribute key for a given value.

Parameters:
value - value to look up the key for
Returns:
key for given value or null if not found

sfContainsValue

boolean sfContainsValue(java.lang.Object value)
Returns true if the context contains value.

Parameters:
value - object to check
Returns:
true if context contains value, false otherwise

sfContainsAttribute

boolean sfContainsAttribute(java.lang.Object attribute)
Returns true if the context contains attribute.

Parameters:
attribute - to check
Returns:
true if context contains key, false otherwise

sfReplaceAttribute

java.lang.Object sfReplaceAttribute(java.lang.Object name,
                                    java.lang.Object value)
                                    throws SmartFrogRuntimeException
Replace named attribute in component description context. If attribute is not present it is added to the context.

Parameters:
name - of attribute to replace
value - attribute value to replace or add
Returns:
the old value if present, null otherwise
Throws:
SmartFrogRuntimeException - when name or value are null

sfAttributes

java.util.Iterator sfAttributes()
Returns an ordered iterator over the attribute names in the context. The remove operation of this Iterator won't affect the contents of ConponentDescription

Returns:
iterator

sfValues

java.util.Iterator sfValues()
Returns an ordered iterator over the values in the context. The remove operation of this Iterator won't affect the contents of ConponentDescription

Returns:
iterator

sfCompleteName

Reference sfCompleteName()
Get complete name for this description. This is a reference all the way down from the root of the containment tree.

Returns:
reference for complete name of description

sfContext

Context sfContext()
Gets the context for this description.

Returns:
context
See Also:
setContext(org.smartfrog.sfcore.common.Context)

setContext

Context setContext(Context cxt)
Sets the context for this description.

Parameters:
cxt - new context
Returns:
old context
See Also:
sfContext()

sfParent

ComponentDescription sfParent()
Gets the parent for this description.

Returns:
component parent description
See Also:
setParent(org.smartfrog.sfcore.componentdescription.ComponentDescription)

setParent

ComponentDescription setParent(ComponentDescription parent)
Sets parent for this component.

Parameters:
parent - new parent component
Returns:
old parent for description
See Also:
sfParent()

sfPrimParent

Prim sfPrimParent()
When a component description is held as an attribute in a Prim, the parent is no longer a ComponentDescription, but the Prim itself. This is so that attribute resolution works through the component description in to the Prim hierarchy. For typenig reasons, the PrimParent has to be handled specially and not through the normal interface (due to RemoteExceptions in the interface). Gets the parent for this description.

Returns:
component parent description
See Also:
setPrimParent(org.smartfrog.sfcore.prim.Prim)

setPrimParent

Prim setPrimParent(Prim parent)
When a component description is held as an attribute in a Prim, the parent is no longer a ComponentDescription, but the Prim itself. This is so that attribute resolution works through the component description in to the Prim hierarchy. For typenig reasons, the PrimParent has to be handled specially and not through the normal interface (due to RemoteExceptions in the interface). Sets parent for this component.

Parameters:
parent - new parent component
Returns:
old parent for description
See Also:
sfPrimParent()

getEager

boolean getEager()
Gets the eager flag for description.

Returns:
true if description eager, false if lazy
See Also:
setEager(boolean)

setEager

boolean setEager(boolean eager)
Sets eager flag for description.

Parameters:
eager - new eager flag
Returns:
old eager flag
See Also:
getEager()

toString

java.lang.String toString()
Returns stringified version of description. Overrides Object.toString.

Overrides:
toString in class java.lang.Object
Returns:
string of description

writeOn

void writeOn(java.io.Writer w)
             throws java.io.IOException
Write the component description on a writer.

Specified by:
writeOn in interface PrettyPrinting
Parameters:
w - writer to write on
Throws:
java.io.IOException - failure while writing

visit

void visit(CDVisitor action,
           boolean topDown)
           throws java.lang.Exception
Visit every node in the tree using this as the root, applying an action to the nodes. The nodes may be visited top-down or bottom-up

Parameters:
action - the action to apply
topDown - true if top-down, false if bottom-up
Throws:
java.lang.Exception - error during applying an action

visit

void visit(CDVisitor action,
           boolean topDown,
           boolean includeLazy)
           throws java.lang.Exception
Visit every node in the tree using this as the root, applying an action to the nodes. The nodes may be visited top-down or bottom-up

Parameters:
action - the action to apply
topDown - true if top-down, false if bottom-up
includeLazy - whether to visit into sub-nodes tagged LAZY
Throws:
java.lang.Exception - error during applying an action

visit

void visit(CDVisitor action,
           boolean topDown,
           java.util.Stack path)
           throws java.lang.Exception
Visit every node in the tree from this node, applying an action to the nodes. The nodes may be visited top-down or bottom-up. Used if there is a previous set of ancestor nodes that have been visited

Parameters:
action - the action to apply
topDown - true if top-down, false if bottom-up
path - the path of nodes visited before this one, from the root
Throws:
java.lang.Exception - error during applying an action

visit

void visit(CDVisitor action,
           boolean topDown,
           boolean includeLazy,
           java.util.Stack path)
           throws java.lang.Exception
Visit every node in the tree from this node, applying an action to the nodes. The nodes may be visited top-down or bottom-up. Used if there is a previous set of ancestor nodes that have been visited

Parameters:
action - the action to apply
topDown - true if top-down, false if bottom-up
includeLazy - whether to visit into sub-nodes tagged LAZY
path - the path of nodes visited before this one, from the root
Throws:
java.lang.Exception - error during applying an action

sfLog

LogSF sfLog()
To log into sfCore logger. This method should be used to log Core messages

Returns:
Logger implementing LogSF and Log

SmartFrog CORE 3.10.000

(C) Copyright 1998-2006 Hewlett-Packard Development Company, LP