|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectfr.obeo.acceleo.gen.template.scripts.imports.services.ENodeServices
public class ENodeServices
System services for ENode elements.
Constructor Summary | |
---|---|
ENodeServices(fr.obeo.acceleo.gen.template.scripts.IScript script)
Constructor. |
Method Summary | |
---|---|
fr.obeo.acceleo.gen.template.eval.ENode |
adapt(fr.obeo.acceleo.gen.template.eval.ENode node,
java.lang.String type)
Returns the adaptive value for the given type short name. |
fr.obeo.acceleo.gen.template.eval.ENode |
cast(fr.obeo.acceleo.gen.template.eval.ENode node,
java.lang.String type)
Deprecated. |
fr.obeo.acceleo.gen.template.eval.ENode |
current(fr.obeo.acceleo.gen.template.eval.ENode node)
Returns the current node. |
fr.obeo.acceleo.gen.template.eval.ENode |
current(fr.obeo.acceleo.gen.template.eval.ENode node,
fr.obeo.acceleo.gen.template.eval.ENode arg)
Returns the current node. |
fr.obeo.acceleo.gen.template.eval.ENode |
debug(fr.obeo.acceleo.gen.template.eval.ENode node)
It prints current node. |
fr.obeo.acceleo.gen.template.eval.ENode |
filter(fr.obeo.acceleo.gen.template.eval.ENode node,
java.lang.String type)
Gets all the nodes whose type is the given type. |
fr.obeo.acceleo.gen.template.eval.ENode |
minimize(fr.obeo.acceleo.gen.template.eval.ENode node)
Deprecated. |
boolean |
nContains(fr.obeo.acceleo.gen.template.eval.ENode node,
fr.obeo.acceleo.gen.template.eval.ENode element)
Returns true if this list contains the specified element. |
fr.obeo.acceleo.gen.template.eval.ENode |
nFirst(fr.obeo.acceleo.gen.template.eval.ENode node)
Returns the first child of the current node. |
fr.obeo.acceleo.gen.template.eval.ENode |
nGet(fr.obeo.acceleo.gen.template.eval.ENode node,
int index)
Returns the child node at the given index in the current node. |
fr.obeo.acceleo.gen.template.eval.ENode |
nGet(fr.obeo.acceleo.gen.template.eval.ENode node,
int begin,
int end)
Returns the children in the given range. |
fr.obeo.acceleo.gen.template.eval.ENode |
nLast(fr.obeo.acceleo.gen.template.eval.ENode node)
Returns the last child of the current node. |
fr.obeo.acceleo.gen.template.eval.ENode |
nMinimize(fr.obeo.acceleo.gen.template.eval.ENode node)
Removes all duplicated nodes. |
fr.obeo.acceleo.gen.template.eval.ENode |
nReverse(fr.obeo.acceleo.gen.template.eval.ENode node)
Reverses the order of the elements of the specified node. |
int |
nSize(fr.obeo.acceleo.gen.template.eval.ENode node)
Returns the size of the node. |
fr.obeo.acceleo.gen.template.eval.ENode |
nSort(fr.obeo.acceleo.gen.template.eval.ENode node)
Sorts the node and its children. |
fr.obeo.acceleo.gen.template.eval.ENode |
nSort(fr.obeo.acceleo.gen.template.eval.ENode current,
java.lang.String call)
Sorts the node and its children. |
fr.obeo.acceleo.gen.template.eval.ENode |
reverse(fr.obeo.acceleo.gen.template.eval.ENode node)
Deprecated. |
fr.obeo.acceleo.gen.template.eval.ENode |
sep(fr.obeo.acceleo.gen.template.eval.ENode node,
java.lang.String separator)
Add a separator between each element of the list. |
fr.obeo.acceleo.gen.template.eval.ENode |
sepStr(fr.obeo.acceleo.gen.template.eval.ENode node,
java.lang.String separator)
Deprecated. |
fr.obeo.acceleo.gen.template.eval.ENode |
sort(fr.obeo.acceleo.gen.template.eval.ENode node)
Deprecated. |
fr.obeo.acceleo.gen.template.eval.ENode |
sort(fr.obeo.acceleo.gen.template.eval.ENode current,
java.lang.String call)
Deprecated. |
fr.obeo.acceleo.gen.template.eval.ENode |
toString(fr.obeo.acceleo.gen.template.eval.ENode node)
Transforms the node into a string. |
fr.obeo.acceleo.gen.template.eval.ENode |
trace(fr.obeo.acceleo.gen.template.eval.ENode node)
It prints current node. |
fr.obeo.acceleo.gen.template.eval.ENode |
trace(fr.obeo.acceleo.gen.template.eval.ENode node,
java.lang.String template)
It prints current node. |
fr.obeo.acceleo.gen.template.eval.ENode |
until(fr.obeo.acceleo.gen.template.eval.ENode node,
java.lang.String link,
java.lang.String type)
Deprecated. |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ENodeServices(fr.obeo.acceleo.gen.template.scripts.IScript script)
script
- is the scriptMethod Detail |
---|
public fr.obeo.acceleo.gen.template.eval.ENode filter(fr.obeo.acceleo.gen.template.eval.ENode node, java.lang.String type) throws fr.obeo.acceleo.gen.template.eval.ENodeCastException, fr.obeo.acceleo.ecore.factories.FactoryException
An element is kept only if it's an EObject whose type is the given type or if it isn't an EObject.
Sample :
If type equals "A" and node is a list {a, "\n", b, c}
the result is a list {a, "\n", b}.
node
- is the listtype
- is the type kept
fr.obeo.acceleo.gen.template.eval.ENodeCastException
- if the given node isn't a list
fr.obeo.acceleo.ecore.factories.FactoryException
public fr.obeo.acceleo.gen.template.eval.ENode cast(fr.obeo.acceleo.gen.template.eval.ENode node, java.lang.String type) throws fr.obeo.acceleo.gen.template.eval.ENodeCastException, fr.obeo.acceleo.ecore.factories.FactoryException
An element is kept only if it's an EObject whose type is the given type or if it isn't an EObject.
Sample :
If type equals "A" and node is a list {a, "\n", b, c}
the result is a list {a, "\n", b}.
node
- is the listtype
- is the type kept
fr.obeo.acceleo.gen.template.eval.ENodeCastException
- if the given node isn't a list
fr.obeo.acceleo.ecore.factories.FactoryException
public fr.obeo.acceleo.gen.template.eval.ENode sep(fr.obeo.acceleo.gen.template.eval.ENode node, java.lang.String separator) throws fr.obeo.acceleo.gen.template.eval.ENodeCastException, fr.obeo.acceleo.ecore.factories.FactoryException
Sample :
If separator equals "\t" and node is a list {a, b, c} the result is a list {a, "\t", b, "\t", c}.
node
- is the listseparator
- is the separator
fr.obeo.acceleo.ecore.factories.FactoryException
fr.obeo.acceleo.gen.template.eval.ENodeCastException
public fr.obeo.acceleo.gen.template.eval.ENode sepStr(fr.obeo.acceleo.gen.template.eval.ENode node, java.lang.String separator) throws fr.obeo.acceleo.gen.template.eval.ENodeCastException, fr.obeo.acceleo.ecore.factories.FactoryException
Sample :
If separator equals "\t" and node is a list {a, b, c} the result is a string : a + "\t" + b + "\t" + c.
node
- is the listseparator
- is the separator
fr.obeo.acceleo.ecore.factories.FactoryException
fr.obeo.acceleo.gen.template.eval.ENodeCastException
public fr.obeo.acceleo.gen.template.eval.ENode until(fr.obeo.acceleo.gen.template.eval.ENode node, java.lang.String link, java.lang.String type) throws fr.obeo.acceleo.gen.template.eval.ENodeCastException, fr.obeo.acceleo.ecore.factories.FactoryException
The given node must be an EObject.
Sample :
until(c,"container","A") returns a
until(b,"container","A") returns a
until(a,"container","A") returns a
until(b,"container","C") returns null
node
- is an EObjectlink
- is the feature nametype
- is the type which stops the recursivity
fr.obeo.acceleo.gen.template.eval.ENodeCastException
- if the given node isn't an EObject
fr.obeo.acceleo.ecore.factories.FactoryException
public fr.obeo.acceleo.gen.template.eval.ENode current(fr.obeo.acceleo.gen.template.eval.ENode node)
node
- is the current node
public fr.obeo.acceleo.gen.template.eval.ENode current(fr.obeo.acceleo.gen.template.eval.ENode node, fr.obeo.acceleo.gen.template.eval.ENode arg) throws fr.obeo.acceleo.gen.template.eval.ENodeCastException
node
- is the current nodelevel
- is the level in the parent hierarchy
fr.obeo.acceleo.gen.template.eval.ENodeCastException
public fr.obeo.acceleo.gen.template.eval.ENode toString(fr.obeo.acceleo.gen.template.eval.ENode node)
node
- is the current node
public fr.obeo.acceleo.gen.template.eval.ENode adapt(fr.obeo.acceleo.gen.template.eval.ENode node, java.lang.String type) throws fr.obeo.acceleo.gen.template.eval.ENodeCastException
node
- is the nodetype
- is the type name : "EObject", "ENodeList", "String",
"boolean", "int", "double", "List", "ENode"
fr.obeo.acceleo.gen.template.eval.ENodeCastException
public fr.obeo.acceleo.gen.template.eval.ENode debug(fr.obeo.acceleo.gen.template.eval.ENode node)
node
- is the current node
public fr.obeo.acceleo.gen.template.eval.ENode trace(fr.obeo.acceleo.gen.template.eval.ENode node)
node
- is the current node
public fr.obeo.acceleo.gen.template.eval.ENode trace(fr.obeo.acceleo.gen.template.eval.ENode node, java.lang.String template)
node
- is the current nodetemplate
- is the template to evaluate for each node
public int nSize(fr.obeo.acceleo.gen.template.eval.ENode node)
node
- is the current node
public fr.obeo.acceleo.gen.template.eval.ENode nGet(fr.obeo.acceleo.gen.template.eval.ENode node, int index) throws fr.obeo.acceleo.gen.template.eval.ENodeCastException, fr.obeo.acceleo.ecore.factories.FactoryException
node
- is the current nodeindex
- is the index of the child
fr.obeo.acceleo.gen.template.eval.ENodeCastException
fr.obeo.acceleo.ecore.factories.FactoryException
public fr.obeo.acceleo.gen.template.eval.ENode nGet(fr.obeo.acceleo.gen.template.eval.ENode node, int begin, int end) throws fr.obeo.acceleo.gen.template.eval.ENodeCastException, fr.obeo.acceleo.ecore.factories.FactoryException
node
- is the current nodebegin
- is the beginning indexbegin
- is the ending index
fr.obeo.acceleo.gen.template.eval.ENodeCastException
fr.obeo.acceleo.ecore.factories.FactoryException
public fr.obeo.acceleo.gen.template.eval.ENode nFirst(fr.obeo.acceleo.gen.template.eval.ENode node) throws fr.obeo.acceleo.gen.template.eval.ENodeCastException, fr.obeo.acceleo.ecore.factories.FactoryException
node
- is the current node
fr.obeo.acceleo.gen.template.eval.ENodeCastException
fr.obeo.acceleo.ecore.factories.FactoryException
public fr.obeo.acceleo.gen.template.eval.ENode nLast(fr.obeo.acceleo.gen.template.eval.ENode node) throws fr.obeo.acceleo.gen.template.eval.ENodeCastException, fr.obeo.acceleo.ecore.factories.FactoryException
node
- is the current node
fr.obeo.acceleo.gen.template.eval.ENodeCastException
fr.obeo.acceleo.ecore.factories.FactoryException
public fr.obeo.acceleo.gen.template.eval.ENode minimize(fr.obeo.acceleo.gen.template.eval.ENode node) throws fr.obeo.acceleo.gen.template.eval.ENodeCastException
node
- is the current node
fr.obeo.acceleo.gen.template.eval.ENodeCastException
public fr.obeo.acceleo.gen.template.eval.ENode nMinimize(fr.obeo.acceleo.gen.template.eval.ENode node) throws fr.obeo.acceleo.gen.template.eval.ENodeCastException
node
- is the current node
fr.obeo.acceleo.gen.template.eval.ENodeCastException
public fr.obeo.acceleo.gen.template.eval.ENode reverse(fr.obeo.acceleo.gen.template.eval.ENode node) throws fr.obeo.acceleo.gen.template.eval.ENodeCastException, fr.obeo.acceleo.ecore.factories.FactoryException
node
- is the node whose elements are to be reversed
fr.obeo.acceleo.gen.template.eval.ENodeCastException
fr.obeo.acceleo.ecore.factories.FactoryException
public fr.obeo.acceleo.gen.template.eval.ENode nReverse(fr.obeo.acceleo.gen.template.eval.ENode node) throws fr.obeo.acceleo.gen.template.eval.ENodeCastException, fr.obeo.acceleo.ecore.factories.FactoryException
node
- is the node whose elements are to be reversed
fr.obeo.acceleo.gen.template.eval.ENodeCastException
fr.obeo.acceleo.ecore.factories.FactoryException
public boolean nContains(fr.obeo.acceleo.gen.template.eval.ENode node, fr.obeo.acceleo.gen.template.eval.ENode element) throws fr.obeo.acceleo.gen.template.eval.ENodeCastException
More formally, returns true if and only if this list contains at least
one element e such that (o==null ? e==null : o.equals(e)).
node
- is the current nodeelement
- is element whose presence in this list is to be tested
fr.obeo.acceleo.gen.template.eval.ENodeCastException
public fr.obeo.acceleo.gen.template.eval.ENode sort(fr.obeo.acceleo.gen.template.eval.ENode node) throws fr.obeo.acceleo.gen.template.eval.ENodeCastException
node
- is the current node
fr.obeo.acceleo.gen.template.eval.ENodeCastException
public fr.obeo.acceleo.gen.template.eval.ENode nSort(fr.obeo.acceleo.gen.template.eval.ENode node) throws fr.obeo.acceleo.gen.template.eval.ENodeCastException
node
- is the current node
fr.obeo.acceleo.gen.template.eval.ENodeCastException
public fr.obeo.acceleo.gen.template.eval.ENode sort(fr.obeo.acceleo.gen.template.eval.ENode current, java.lang.String call) throws fr.obeo.acceleo.gen.template.eval.ENodeCastException
current
- is the current node of generationcall
- is the expression to evaluate for each node
fr.obeo.acceleo.gen.template.eval.ENodeCastException
public fr.obeo.acceleo.gen.template.eval.ENode nSort(fr.obeo.acceleo.gen.template.eval.ENode current, java.lang.String call) throws fr.obeo.acceleo.gen.template.eval.ENodeCastException
current
- is the current node of generationcall
- is the expression to evaluate for each node
fr.obeo.acceleo.gen.template.eval.ENodeCastException
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |