Package org.tentackle.wurblet
Class WurbletArgumentParser
java.lang.Object
org.tentackle.wurblet.WurbletArgumentParser
Parses the wurblet arguments.
The parser analyzes all regular wurblet arguments, i.e. without the options (starting with --). The arguments consist of:
Some examples:
The parser analyzes all regular wurblet arguments, i.e. without the options (starting with --). The arguments consist of:
- a logical expression describing the WHERE clause
- optional extra arguments, e.g. for attributes to be updated
- optional sorting criteria
- optional load joins
An expression consists of operands (which may be arguments or nested expressions) connected via logical operators. There are 3 kinds of operators:
ANDORNOT
AND.Some examples:
fee fie (foe or foo) and (voice or plugh) ((fee or fie) and foe) or fooA complete wurblet example:
@wurblet selectUpTo PdoSelectList --remote processed:=:null or processed:>= +id *address
- Author:
- harald
-
Constructor Summary
ConstructorsConstructorDescriptionWurbletArgumentParser(Entity entity, boolean argumentGroupingEnabled, List<String> arguments) Creates a parser. -
Method Summary
Modifier and TypeMethodDescriptioncreateArgument(String arg, boolean expressionFinished, boolean argumentGroupingEnabled) Creates a wurblet argument.Gets all arguments.Gets the entity the wurblet is applied to.Gets the where expression.Gets all arguments part of the expression.Gets the extra arguments.
Those are not part of the expression and not sorting arguments.Gets the join arguments.Gets the consolidated relation paths for the join arguments.Gets the method arguments.Gets the sorting arguments.toString()
-
Constructor Details
-
WurbletArgumentParser
public WurbletArgumentParser(Entity entity, boolean argumentGroupingEnabled, List<String> arguments) throws org.wurbelizer.wurbel.WurbelException Creates a parser.- Parameters:
entity- the entity the wurblet is applied toargumentGroupingEnabled- true if pipe character separates expression from extra argumentsarguments- the wurblet arguments- Throws:
org.wurbelizer.wurbel.WurbelException- if parsing failed
-
-
Method Details
-
toString
-
getEntity
Gets the entity the wurblet is applied to.- Returns:
- the entity
-
getExpression
Gets the where expression.- Returns:
- the expression
-
getExpressionArguments
Gets all arguments part of the expression.- Returns:
- the expression arguments
-
getExtraArguments
Gets the extra arguments.
Those are not part of the expression and not sorting arguments.- Returns:
- the extra arguments
-
getSortingArguments
Gets the sorting arguments.- Returns:
- the sorting arguments
-
getJoinArguments
Gets the join arguments.- Returns:
- the joins
-
getJoinPaths
Gets the consolidated relation paths for the join arguments.- Returns:
- the join paths
-
getMethodArguments
Gets the method arguments.- Returns:
- all arguments
-
getAllArguments
Gets all arguments.- Returns:
- all arguments
-
createArgument
public WurbletArgument createArgument(String arg, boolean expressionFinished, boolean argumentGroupingEnabled) throws org.wurbelizer.wurbel.WurbelException Creates a wurblet argument.- Parameters:
arg- the argument stringexpressionFinished- true if expression is finishedargumentGroupingEnabled- true if argument grouping is enabled- Returns:
- the created argument
- Throws:
org.wurbelizer.wurbel.WurbelException- if parsing arg failed
-