public class ValidationFragmentDependencyProcessor extends Object
This class enables the type checker to determine a processing order, because fragment types cannot determined until types of properties referenced within them are clear.
The class also detects circular fragment references. Here is how to use it:
addDeclaration(IDeclaration) repeatedly
resolve() and abort if necessary
getOrderedDeclarations()
| Constructor and Description |
|---|
ValidationFragmentDependencyProcessor() |
| Modifier and Type | Method and Description |
|---|---|
void |
addDeclaration(IDeclaration decl) |
void |
addDeclaration(IValidationFragmentDeclaration decl) |
void |
addDeclarations(IRuleFile file) |
protected Collection<net.sourceforge.nrl.parser.ast.constraints.impl.ValidationFragmentDependencyProcessor.DependencyNode> |
buildDependencyGraph()
Build the graph of DependencyNode objects.
|
protected void |
depthFirst(net.sourceforge.nrl.parser.ast.constraints.impl.ValidationFragmentDependencyProcessor.DependencyNode root,
Collection<net.sourceforge.nrl.parser.ast.constraints.impl.ValidationFragmentDependencyProcessor.DependencyNode> removalList)
Traverse from a node, and add all encountered nodes to the orderedDeclarations list.
|
List<IDeclaration> |
getOrderedDeclarations() |
protected List<IDeclaration> |
getReferencedDeclarations(IDeclaration decl)
Given a declaration, return a list of declarations it references.
|
List<NRLError> |
resolve() |
public ValidationFragmentDependencyProcessor()
public void addDeclaration(IValidationFragmentDeclaration decl)
public void addDeclaration(IDeclaration decl)
public void addDeclarations(IRuleFile file)
protected void depthFirst(net.sourceforge.nrl.parser.ast.constraints.impl.ValidationFragmentDependencyProcessor.DependencyNode root,
Collection<net.sourceforge.nrl.parser.ast.constraints.impl.ValidationFragmentDependencyProcessor.DependencyNode> removalList)
root - the root noderemovalList - the list to remove fromprotected Collection<net.sourceforge.nrl.parser.ast.constraints.impl.ValidationFragmentDependencyProcessor.DependencyNode> buildDependencyGraph()
protected List<IDeclaration> getReferencedDeclarations(IDeclaration decl)
decl - the declarationspublic List<IDeclaration> getOrderedDeclarations()
Copyright © 2006-2013. All Rights Reserved.