|
SmartFrog 3.10.000 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.smartfrog.sfcore.reference.ReferenceResolverHelperImpl
org.smartfrog.sfcore.componentdescription.ComponentDescriptionImpl
public class ComponentDescriptionImpl
Defines the context class used by Components. Context implementations need to respect the ordering and copying requirements imposed by Components.
| Field Summary | |
|---|---|
boolean |
eager
Whether this description is eager or lazy. |
ComponentDescription |
parent
Parent of this description. |
Prim |
primParent
PrimParent of this description. |
Context |
sfContext
Context of attributes (key value pairs). |
| Constructor Summary | |
|---|---|
ComponentDescriptionImpl(ComponentDescription parent,
Context cxt,
boolean eager)
Constucts ComponentDescriptionImpl with parent component and context. |
|
| Method Summary | |
|---|---|
static ComponentDescription |
addSystemProperties(java.lang.String startWith,
ComponentDescription compDesc)
Adds system properties to component description using parser.sfParsePrimitiveValue() for conversion using 'sf' language. |
static ComponentDescription |
addSystemProperties(java.lang.String startWith,
ComponentDescription compDesc,
java.lang.String language)
Adds system properties to component description using parser.sfParsePrimitiveValue() for conversion. |
java.lang.Object |
clone()
Gets the clone of the ComponentDescription. |
java.lang.Object |
copy()
Creates a deep copy of the compiled component. |
static ComponentDescription |
getClassComponentDescription(java.lang.Object obj,
boolean addSystemProperties,
java.util.Vector newPhases)
Gets configuration description for Obj class using "sf" language. |
static ComponentDescription |
getClassComponentDescription(java.lang.Object obj,
boolean addSystemProperties,
java.util.Vector newPhases,
java.lang.String languageExtension)
Gets configuration description for Obj class using the right parser for language. |
boolean |
getEager()
Gets the eager flag for description. |
static void |
initLog(LogSF newlog)
Special method to be used only by LogFactory to initialize log in ComponentDescription. |
Context |
setContext(Context cxt)
Sets the context for this description. |
boolean |
setEager(boolean e)
Sets eager flag for description. |
ComponentDescription |
setParent(ComponentDescription newparent)
Sets parent for this component. |
Prim |
setPrimParent(Prim newparent)
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)
Adds an attribute to this component description under given name. |
java.lang.Object |
sfAttributeKeyFor(java.lang.Object value)
Returns the attribute key given a value. |
java.util.Iterator |
sfAttributes()
Returns an ordered iterator over the attribute names in the context. |
Reference |
sfCompleteName()
Returns the complete name for this component from the root of the application. |
Reference |
sfCompleteNameSafe()
Returns the complete name for this ComponentDescription and does not throw any exception. |
static ComponentDescription |
sfComponentDescription(java.lang.String url)
Utility method that gets Component Description for URL after applying default parser phases |
static ComponentDescription |
sfComponentDescription(java.lang.String url,
java.lang.String language,
java.util.Vector phases,
Reference ref)
Utility method that gets Component Description for URL after applying some parser phases |
static ComponentDescription |
sfComponentDescription(java.lang.String url,
java.lang.String language,
java.util.Vector phases,
Reference ref,
java.lang.String codebase)
Utility method that gets Component Description for URL after applying some parser phases |
static ComponentDescription |
sfComponentDescription(java.lang.String url,
java.util.Vector phases,
Reference ref)
Utility method that gets Component Description for URL after applying some parser phases |
static ComponentDescription |
sfComponentDescriptionFromStr(java.io.InputStream description,
java.lang.String language,
java.util.Vector phases,
Reference ref)
Utility method that gets Component Description for a String after applying some parser phases |
static ComponentDescription |
sfComponentDescriptionFromStr(java.io.InputStream description,
java.lang.String language,
java.util.Vector phases,
Reference ref,
java.lang.String codebase)
Utility method that gets Component Description for a String after applying some parser phases |
static ComponentDescription |
sfComponentDescriptionFromStr(java.lang.String description,
java.lang.String language,
java.util.Vector phases,
Reference ref)
Utility method that gets Component Description for a String after applying some parser phases |
static ComponentDescription |
sfComponentDescriptionFromStr(java.lang.String description,
java.lang.String language,
java.util.Vector phases,
Reference ref,
java.lang.String codebase)
Utility method that gets Component Description for a String after applying some parser phases |
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. |
ComponentDescription |
sfDiagnosticsReport()
Creates diagnostics report |
LogSF |
sfLog()
To log into sfCore logger. |
ComponentDescription |
sfParent()
Gets the parent for this description. |
void |
sfParentageChanged()
Parentage changed in component hierachy. |
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)
Removes an attribute from this component. |
java.lang.Object |
sfReplaceAttribute(java.lang.Object name,
java.lang.Object value)
Replace named attribute in component context. |
java.lang.Object |
sfResolve(Reference r)
Resolve a given reference. |
java.lang.Object |
sfResolve(Reference r,
int index)
Resolves a refererence starting at given index. |
java.lang.Object |
sfResolveHere(java.lang.Object name)
Find an attribute in this component context. |
java.lang.Object |
sfResolveHere(java.lang.Object name,
boolean mandatory)
Find an attribute in this context. |
java.lang.Object |
sfResolveParent()
Resolves to the parent of this description. |
java.util.Iterator |
sfValues()
Returns an ordered iterator over the values in the context. |
protected void |
tabPad(java.io.Writer ps,
int amount)
Internal method to pad out a writer. |
java.lang.String |
toString()
Returns a string representation of the component. |
void |
visit(CDVisitor action,
boolean topDown)
Visit every node in the tree, applying an action to that node. |
void |
visit(CDVisitor action,
boolean topDown,
boolean includeLazy)
Visit every node in the tree, applying an action to that node. |
void |
visit(CDVisitor action,
boolean topDown,
boolean includeLazy,
java.util.Stack path)
Visit every node in the tree from path downwards, applying an action to that node. |
void |
visit(CDVisitor action,
boolean topDown,
java.util.Stack path)
Visit every node in the tree from path downwards, applying an action to that node. |
void |
writeOn(java.io.Writer ps)
Writes this component description on a writer. |
void |
writeOn(java.io.Writer ps,
int indent)
Writes this component description on a writer. |
| Methods inherited from class org.smartfrog.sfcore.reference.ReferenceResolverHelperImpl |
|---|
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, sfResolveWithParser |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| 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, sfResolveWithParser |
| Field Detail |
|---|
public Context sfContext
public ComponentDescription parent
public Prim primParent
public boolean eager
| Constructor Detail |
|---|
public ComponentDescriptionImpl(ComponentDescription parent,
Context cxt,
boolean eager)
parent - parent componentcxt - context for descriptioneager - eager flag| Method Detail |
|---|
public Reference sfCompleteNameSafe()
sfCompleteNameSafe in class ReferenceResolverHelperImplpublic Reference sfCompleteName()
sfCompleteName in interface ComponentDescriptionpublic void sfParentageChanged()
public java.lang.Object sfAddAttribute(java.lang.Object name,
java.lang.Object value)
throws SmartFrogRuntimeException
sfAddAttribute in interface ComponentDescriptionname - name of attributevalue - value of attribute
SmartFrogRuntimeException - when name or value are null
public java.lang.Object sfRemoveAttribute(java.lang.Object name)
throws SmartFrogRuntimeException
sfRemoveAttribute in interface ComponentDescriptionname - of attribute to be removed
SmartFrogRuntimeException - when name is null
public java.lang.Object sfReplaceAttribute(java.lang.Object name,
java.lang.Object value)
throws SmartFrogRuntimeException
sfReplaceAttribute in interface ComponentDescriptionname - of attribute to replacevalue - value to add or replace
SmartFrogRuntimeException - when name or value are nullpublic java.lang.Object sfAttributeKeyFor(java.lang.Object value)
sfAttributeKeyFor in interface ComponentDescriptionvalue - value to look up key for
public boolean sfContainsValue(java.lang.Object value)
sfContainsValue in interface ComponentDescriptionvalue - object to check
public boolean sfContainsAttribute(java.lang.Object attribute)
sfContainsAttribute in interface ComponentDescriptionattribute - to check
public java.util.Iterator sfAttributes()
sfAttributes in interface ComponentDescriptionpublic java.util.Iterator sfValues()
sfValues in interface ComponentDescriptionpublic Context sfContext()
sfContext in interface ComponentDescriptionsetContext(org.smartfrog.sfcore.common.Context)public Context setContext(Context cxt)
setContext in interface ComponentDescriptioncxt - new context
sfContextpublic ComponentDescription sfParent()
sfParent in interface ComponentDescriptionsetParent(org.smartfrog.sfcore.componentdescription.ComponentDescription)public ComponentDescription setParent(ComponentDescription newparent)
setParent in interface ComponentDescriptionnewparent - new parent component
sfParent()public Prim sfPrimParent()
sfPrimParent in interface ComponentDescriptionsetPrimParent(Prim)public Prim setPrimParent(Prim newparent)
setPrimParent in interface ComponentDescriptionnewparent - new parent component
sfPrimParent()public boolean getEager()
getEager in interface ComponentDescriptionsetEager(boolean)public boolean setEager(boolean e)
setEager in interface ComponentDescriptione - new eager flag
getEager()
public java.lang.Object sfResolveHere(java.lang.Object name)
throws SmartFrogResolutionException
sfResolveHere in interface ReferenceResolvername - attribute key to resolve
SmartFrogResolutionException - failed to find attribute
public java.lang.Object sfResolveHere(java.lang.Object name,
boolean mandatory)
throws SmartFrogResolutionException
sfResolveHere in interface ReferenceResolversfResolveHere in interface ReferenceResolverHelpername - attribute key to resolvemandatory - boolean that indicates if this attribute must be
present in the description. If it is mandatory and not found it
throws a SmartFrogResolutionException
SmartFrogResolutionException - failed to find attributepublic java.lang.Object sfResolveParent()
sfResolveParent in interface ReferenceResolver
public java.lang.Object sfResolve(Reference r)
throws SmartFrogResolutionException
sfResolve in interface ReferenceResolversfResolve in class ReferenceResolverHelperImplr - reference to resolve
SmartFrogResolutionException - occurred while resolving
public java.lang.Object sfResolve(Reference r,
int index)
throws SmartFrogResolutionException
sfResolve in interface ReferenceResolversfResolve in class ReferenceResolverHelperImplr - reference to resolveindex - index in reference to start to resolve
SmartFrogResolutionException - failure while resolving referencepublic java.lang.Object copy()
copy in interface Copyingpublic java.lang.Object clone()
clone in interface Copyingclone in class java.lang.Objectpublic java.lang.String toString()
toString in interface ComponentDescriptiontoString in class java.lang.Object
public void writeOn(java.io.Writer ps)
throws java.io.IOException
writeOn in interface PrettyPrintingwriteOn in interface ComponentDescriptionps - writer to write on
java.io.IOException - failure while writing
public void writeOn(java.io.Writer ps,
int indent)
throws java.io.IOException
writeOn in interface PrettyPrintingps - writer to write onindent - the indent to use for printing offset
java.io.IOException - failure while writing
protected void tabPad(java.io.Writer ps,
int amount)
throws java.io.IOException
ps - writer to tab toamount - amount to tab
java.io.IOException - failure while writing
public void visit(CDVisitor action,
boolean topDown)
throws java.lang.Exception
visit in interface ComponentDescriptionaction - the action to applytopDown - true if top-down, false if bottom-up
java.lang.Exception - error during applying an action
public void visit(CDVisitor action,
boolean topDown,
boolean includeLazy)
throws java.lang.Exception
visit in interface ComponentDescriptionaction - the action to applytopDown - true if top-down, false if bottom-upincludeLazy - whether to visit into sub-nodes tagged LAZY
java.lang.Exception - error during applying an action
public void visit(CDVisitor action,
boolean topDown,
java.util.Stack path)
throws java.lang.Exception
visit in interface ComponentDescriptionaction - the action to applytopDown - true if top-down, false if bottom-uppath - the path through the CD hierarchy taken to get here
java.lang.Exception - error during applying an action
public void visit(CDVisitor action,
boolean topDown,
boolean includeLazy,
java.util.Stack path)
throws java.lang.Exception
visit in interface ComponentDescriptionaction - the action to applytopDown - true if top-down, false if bottom-upincludeLazy - whether to visit into sub-nodes tagged LAZYpath - the path through the CD hierarchy taken to get here
java.lang.Exception - error during applying an action
public static ComponentDescription sfComponentDescription(java.lang.String url)
throws SmartFrogException
url - URL to convert to ComponentDescription
SmartFrogException - In case of SmartFrog system error
public static ComponentDescription sfComponentDescription(java.lang.String url,
java.util.Vector phases,
Reference ref)
throws SmartFrogException
url - to convert to ComponentDescription. The url is used to
select the parser selecting any ending after the last '.'phases - parser phases to apply. If the vector is null, then all
the default phases are appliedref - reference to resolve in Description.
SmartFrogException - In case of SmartFrog system error
public static ComponentDescription sfComponentDescription(java.lang.String url,
java.lang.String language,
java.util.Vector phases,
Reference ref)
throws SmartFrogException
url - URL to convert to ComponentDescriptionlanguage - language to select appropriate parserphases - phases to apply. If the vector is null, then all
the default phases are appliedref - reference to resolve in ComponentDescription.
If ref is null the whole result ComponentDescription is returned.
SmartFrogException - In case of SmartFrog system error
public static ComponentDescription sfComponentDescription(java.lang.String url,
java.lang.String language,
java.util.Vector phases,
Reference ref,
java.lang.String codebase)
throws SmartFrogException
url - URL to convert to ComponentDescriptionlanguage - language to select appropriate parserphases - phases to apply. If the vector is null, then all
the default phases are appliedref - reference to resolve in ComponentDescription.
If ref is null the whole result ComponentDescription is returned.codebase - suggested codebase for the classloader
SmartFrogException - In case of SmartFrog system error
public static ComponentDescription sfComponentDescriptionFromStr(java.io.InputStream description,
java.lang.String language,
java.util.Vector phases,
Reference ref)
throws SmartFrogException
description - to parse into ComponentDescriptionlanguage - to select appropriate parser ('sf')phases - phases to apply. If the vector is null, then all
the default phases are appliedref - reference to resolve in ComponentDescription.
If ref is null the whole result ComponentDescription is returned.
SmartFrogException - In case of SmartFrog system error
public static ComponentDescription sfComponentDescriptionFromStr(java.io.InputStream description,
java.lang.String language,
java.util.Vector phases,
Reference ref,
java.lang.String codebase)
throws SmartFrogException
description - to parse into ComponentDescriptionlanguage - to select appropriate parser ('sf')phases - phases to apply. If the vector is null, then all
the default phases are appliedref - reference to resolve in ComponentDescription.
If ref is null the whole result ComponentDescription is returned.codebase - suggested codebase for the classloader
SmartFrogException - In case of SmartFrog system error
public static ComponentDescription sfComponentDescriptionFromStr(java.lang.String description,
java.lang.String language,
java.util.Vector phases,
Reference ref)
throws SmartFrogException
description - to parse into ComponentDescriptionlanguage - to select appropriate parser ('sf')phases - phases to apply. If the vector is null, then all
the default phases are appliedref - reference to resolve in ComponentDescription.
If ref is null the whole result ComponentDescription is returned.
SmartFrogException - In case of SmartFrog system error
public static ComponentDescription sfComponentDescriptionFromStr(java.lang.String description,
java.lang.String language,
java.util.Vector phases,
Reference ref,
java.lang.String codebase)
throws SmartFrogException
description - to parse into ComponentDescriptionlanguage - to select appropriate parser ('sf')phases - phases to apply. If the vector is null, then all
the default phases are appliedref - reference to resolve in ComponentDescription.
If ref is null the whole result ComponentDescription is returned.codebase - suggested codebase for the classloader
SmartFrogException - In case of SmartFrog system error
public static ComponentDescription addSystemProperties(java.lang.String startWith,
ComponentDescription compDesc)
startWith - system property label (ex. org.smartfrog)compDesc - configuration description where to add system properties.
public static ComponentDescription addSystemProperties(java.lang.String startWith,
ComponentDescription compDesc,
java.lang.String language)
startWith - system property label (ex. org.smartfrog)compDesc - configuration description where to add system properties.language - language extension to use.
public static ComponentDescription getClassComponentDescription(java.lang.Object obj,
boolean addSystemProperties,
java.util.Vector newPhases)
throws SmartFrogException
obj - which class Component description has to be read (or java.lang.String)addSystemProperties - to select if to add system propertiesnewPhases - parser phases to apply to component description
languageExtension provide extenstion for the language used (ex. sf by default)
Takes default when vector is null. Default: type, link, function, predicate.
SmartFrogException - In case of SmartFrog system error
public static ComponentDescription getClassComponentDescription(java.lang.Object obj,
boolean addSystemProperties,
java.util.Vector newPhases,
java.lang.String languageExtension)
throws SmartFrogException
obj - which class Component description has to be read (or java.lang.String)addSystemProperties - to select if to add system propertiesnewPhases - parser phases to apply to component descriptionlanguageExtension - provide extenstion for the language used (ex. sf by default)
Takes default when vector is null. Default: type, link, function, predicate.
SmartFrogException - In case of SmartFrog system errorpublic static void initLog(LogSF newlog)
newlog - new logpublic LogSF sfLog()
sfLog in interface ComponentDescriptionpublic ComponentDescription sfDiagnosticsReport()
|
SmartFrog CORE 3.10.000 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||