|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.modeshape.graph.connector.federation.ProjectionParser
@ThreadSafe public class ProjectionParser
A parser library for projections
and projection rules
.
Constructor Summary | |
---|---|
ProjectionParser()
|
Method Summary | |
---|---|
void |
addRuleParser(Class<?> clazz,
String methodName)
Add a static method that can be used to parse rule definition
strings . |
void |
addRuleParser(ClassLoader classLoader,
String className,
String methodName)
Add a static method that can be used to parse rule definition
strings . |
void |
addRuleParser(Method method)
Add a static method that can be used to parse rule definition
strings . |
static ProjectionParser |
getInstance()
Get the shared projection parser, which is by default populated with the standard parser rules. |
boolean |
removeRuleParser(Method method)
Remove the rule parser method. |
boolean |
removeRuleParser(String declaringClassName,
String methodName)
Remove the rule parser method. |
Projection.Rule |
ruleFromString(String definition,
ExecutionContext context)
Parse the string form of a rule definition and return the rule |
Projection.Rule[] |
rulesFromString(ExecutionContext context,
String definitions)
Parse a single string containing one or more string forms of rule definitions, and return the rules. |
Projection.Rule[] |
rulesFromStrings(ExecutionContext context,
String... definitions)
Parse string forms of an arry of rule definitions and return the rules |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ProjectionParser()
Method Detail |
---|
public static ProjectionParser getInstance()
public void addRuleParser(Method method)
rule definition
strings
. These methods must be static, must accept a String
definition as the first parameter and an
ExecutionContext
environment reference as the second parameter, and should return the resulting Projection.Rule
(or
null if the definition format could not be understood by the method. Any exceptions during
invocation
will be logged at the
trace
level.
method
- the method to be addedaddRuleParser(ClassLoader, String, String)
public void addRuleParser(Class<?> clazz, String methodName) throws SecurityException, NoSuchMethodException
rule definition
strings
. These methods must be static, must accept a String
definition as the first parameter and an
ExecutionContext
environment reference as the second parameter, and should return the resulting Projection.Rule
(or
null if the definition format could not be understood by the method. Any exceptions during
invocation
will be logged at the
trace
level.
clazz
- the class on which the static method is defined; may not be nullmethodName
- the name of the method
SecurityException
- if there is a security exception while loading the class or getting the method
NoSuchMethodException
- if the method does not exist on the class
IllegalArgumentException
- if the class loader reference is null, or if the class name or method name are null or
emptyaddRuleParser(Method)
public void addRuleParser(ClassLoader classLoader, String className, String methodName) throws SecurityException, NoSuchMethodException, ClassNotFoundException
rule definition
strings
. These methods must be static, must accept a String
definition as the first parameter and an
ExecutionContext
environment reference as the second parameter, and should return the resulting Projection.Rule
(or
null if the definition format could not be understood by the method. Any exceptions during
invocation
will be logged at the
trace
level.
classLoader
- the class loader that should be used to load the class on which the method is defined; may not be nullclassName
- the name of the class on which the static method is defined; may not be nullmethodName
- the name of the method
SecurityException
- if there is a security exception while loading the class or getting the method
NoSuchMethodException
- if the method does not exist on the class
ClassNotFoundException
- if the class could not be found given the supplied class loader
IllegalArgumentException
- if the class loader reference is null, or if the class name or method name are null or
emptyaddRuleParser(Method)
public boolean removeRuleParser(Method method)
method
- the method to remove
public boolean removeRuleParser(String declaringClassName, String methodName)
declaringClassName
- the name of the class on which the static method is defined; may not be nullmethodName
- the name of the method
IllegalArgumentException
- if the class loader reference is null, or if the class name or method name are null or
emptypublic Projection.Rule ruleFromString(String definition, ExecutionContext context)
definition
- the definition of the rule that is to be parsedcontext
- the environment in which this method is being executed; may not be null
public Projection.Rule[] rulesFromStrings(ExecutionContext context, String... definitions)
context
- the environment in which this method is being executed; may not be nulldefinitions
- the definition of the rules that are to be parsed
public Projection.Rule[] rulesFromString(ExecutionContext context, String definitions)
context
- the environment in which this method is being executed; may not be nulldefinitions
- the definitions of the rules that are to be parsed, each definition separated by a newline character.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |