|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectastcentric.structure.basic.DefaultASTLoader
public class DefaultASTLoader
Default AST loader which loads ASTs form
a (virtual) file system specified in a ASTPath.
The loading policy is ask last. Initially there is no
NodeValidator defined for validating an AST after loading.
| Field Summary | |
|---|---|
protected java.util.Map<ASTID,T> |
_cache
|
protected boolean |
_seal
|
| Constructor Summary | |
|---|---|
DefaultASTLoader(ASTLoader loader,
ASTPath astPath,
boolean seal)
Creates an new loader for the specified parent loader and AST path. |
|
DefaultASTLoader(ASTPath astPath,
boolean seal)
Creates an instance for the specified AST path with no parent loader. |
|
| Method Summary | |
|---|---|
VirtualFile |
getASTFile(ASTID astID)
Returns the file associated with specified AST. |
ASTLoader |
getParent()
Returns the parent loader. |
NodeValidator |
getValidator()
Returns the node validator. |
protected void |
handleASTWith(T astWith,
ASTID astID)
|
AST |
loadAST(ASTID astID)
Loads the AST specified by the ID. |
void |
registerASTListenerFor(ASTID id,
ASTListener listener)
Registers the specified listener for the AST specified by its ID. |
void |
setValidator(NodeValidator validator)
Sets the node validator which will be used to validate an AST after loading. |
void |
traverseAllLoadableASTs(ASTInfoHandler handler,
boolean includeAncestors)
Traverses all loadable ASTs. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected final java.util.Map<ASTID,T extends astcentric.structure.basic.ASTWith> _cache
protected final boolean _seal
| Constructor Detail |
|---|
public DefaultASTLoader(ASTPath astPath,
boolean seal)
astPath - AST path. Has to be not null.seal - If true all ASTs loaded by this loader are
sealed. ASTs obtained from the parent can be unsealed.
public DefaultASTLoader(ASTLoader loader,
ASTPath astPath,
boolean seal)
loader - Parent AST loader. Can be null:astPath - AST path. Has to be not null.seal - If true all ASTs loaded by this loader are
sealed. ASTs obtained from the parent can be unsealed.| Method Detail |
|---|
public void traverseAllLoadableASTs(ASTInfoHandler handler,
boolean includeAncestors)
ASTLoaderincludeAnestors == true
also the ASTs loadable from the parent loader and all other
ancestor loaders are traversed.
The specified handler will receive the ASTInfo of all ASTs.
Implementations of this method should not load an
AST completely. Only the AST ID and the name (i.e. the ASTInfo
should be loaded.
public VirtualFile getASTFile(ASTID astID)
astID - ID of the AST.
null if no AST found.public ASTLoader getParent()
ASTLoader
getParent in interface ASTLoadernull if this loader has no parent.public void setValidator(NodeValidator validator)
ASTLoader
setValidator in interface ASTLoadervalidator - Validator or null if validation should be
switched off.public NodeValidator getValidator()
ASTLoader
getValidator in interface ASTLoadernull if undefined.
public void registerASTListenerFor(ASTID id,
ASTListener listener)
ASTLoaderASTLoader.loadAST(ASTID) with the specified AST ID.
After registration the listener will also be registered at the
parent loader.
registerASTListenerFor in interface ASTLoaderid - ID of the AST to whom listener should be
registered as soon as possible.listener - Listener to be registered.public AST loadAST(ASTID astID)
loadAST in interface ASTLoaderastID - The unique ID of the AST to be loaded.
null if no AST for astID could be found.
protected void handleASTWith(T astWith,
ASTID astID)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||