public interface IContext extends Deque<IBlock>, IBlock, IBlockFactory
| Modifier and Type | Field and Description |
|---|---|
static String |
UPACCESS
String to label variable up context access.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addMetadata()
Add metadata from block context.
|
void |
clearGlobal(String global)
Removes a variable name from global context.
|
void |
clearLocal(String local)
Removes a variable name from local context.
|
void |
clearScoped(String scope,
String local)
Removes a scoped variable.
|
void |
clearStrict(String name)
Clear the context peek mapping from name.
|
IBlock |
getByElement(Class<? extends nu.xom.Node> type)
Search a block by element type.
|
Object |
getByName(String name)
Search a value by its name, from the most restricted block to the
outermost (i.e.
|
IBlock |
getByPlugin(Class<? extends IPlugin> type)
Search a block by plugin type.
|
ISource |
getCurrentSource()
Get current source.
|
Map<String,Object> |
getObjects()
A map of all objects in context.
|
IBlock |
getParentByElement(Class<? extends nu.xom.Node> type)
Strict parent search by element type.
|
Object |
getParentByName(String name)
A strict parent search a value by its name, from the most restricted
block to the outermost (i.e.
|
IBlock |
getParentByPlugin(Class<? extends IPlugin> type)
Strict parent search by plugin type.
|
IRunner |
getRunner()
The runner related to the context.
|
Deque<ISource> |
getSources()
Queue of sources.
|
boolean |
hasName(String name)
Check if name is present in context.
|
void |
saveGlobal(String global,
Object obj)
Saves a variable with the given name to the global context (outermost
block).
|
void |
saveLocal(String local,
Object obj)
Saves a variable with the given name to the local context.
|
void |
saveScoped(String scope,
String local,
Object obj)
Saves a variable to the given scope.
|
void |
saveStrict(String name,
Object value)
Save the value to the current context peek, no matter what type of node
it is.
|
add, addFirst, addLast, contains, descendingIterator, element, getFirst, getLast, iterator, offer, offerFirst, offerLast, peek, peekFirst, peekLast, poll, pollFirst, pollLast, pop, push, remove, remove, removeFirst, removeFirstOccurrence, removeLast, removeLastOccurrence, sizeaddAll, clear, containsAll, equals, hashCode, isEmpty, removeAll, retainAll, toArray, toArraygetMap, getNode, getPlugin, hasChildren, hasMap, hasNode, hasPlugin, isChanged, isValid, setChanged, setMap, setNode, setPluginnewBlock, newBlockstatic final String UPACCESS
_$index,
look for first index access, if found, move context down an look for the
occurrence.Deque<ISource> getSources()
ISource getCurrentSource()
IRunner getRunner()
void saveGlobal(String global, Object obj)
global - The variable name.obj - The value.void clearGlobal(String global)
global - The variable name.void saveLocal(String local, Object obj)
local - The variable name.obj - The value.void clearLocal(String local)
local - The variable name.void saveStrict(String name, Object value)
name - The name.value - The value.void clearStrict(String name)
name - The name.void saveScoped(String scope, String local, Object obj)
scope - Indicates where to bind the value, i.e. when
saveScope("body","name","value") is used in a "span" tag, this
method searches for the "body" backward tag to add variable.local - The variable name.obj - The value.void clearScoped(String scope, String local)
scope - The scope to unbound.local - The variable name.IBlock getByElement(Class<? extends nu.xom.Node> type)
type - The type.IBlock getParentByElement(Class<? extends nu.xom.Node> type)
type - The type.IBlock getByPlugin(Class<? extends IPlugin> type)
type - The type.IBlock getParentByPlugin(Class<? extends IPlugin> type)
type - The type.boolean hasName(String name)
name - Context.Object getByName(String name)
name - The name.Object getParentByName(String name)
name - The name.Map<String,Object> getObjects()
void addMetadata()
Copyright © 2016. All rights reserved.