Package org.tentackle.persist.wurblet
Class WurbletArgumentParser
- java.lang.Object
-
- org.tentackle.persist.wurblet.WurbletArgumentParser
-
public class WurbletArgumentParser extends java.lang.ObjectParses the wurblet arguments.
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 foo
A complete wurblet example:@wurblet selectUpTo PdoSelectList --remote processed:=:null or processed:>= +id *address
- Author:
- harald
-
-
Constructor Summary
Constructors Constructor Description WurbletArgumentParser(org.tentackle.model.Entity entity, boolean argumentGroupingEnabled, java.util.List<java.lang.String> arguments)Creates a parser.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description WurbletArgumentcreateArgument(java.lang.String arg, boolean expressionFinished, boolean argumentGroupingEnabled)Creates a wurblet argument.java.util.List<WurbletArgument>getAllArguments()Gets all arguments.org.tentackle.model.EntitygetEntity()Gets the entity the wurblet is applied to.WurbletArgumentExpressiongetExpression()Gets the where expression.java.util.List<WurbletArgument>getExpressionArguments()Gets all arguments part of the expression.java.util.List<WurbletArgument>getExtraArguments()Gets the extra arguments.
Those are not part of the expression and not sorting arguments.java.util.List<WurbletArgument>getJoinArguments()Gets the join arguments.java.util.List<JoinPath>getJoinPaths()Gets the consolidated relation paths for the join arguments.java.util.List<WurbletArgument>getMethodArguments()Gets the method arguments.java.util.List<WurbletArgument>getSortingArguments()Gets the sorting arguments.java.lang.StringtoString()
-
-
-
Constructor Detail
-
WurbletArgumentParser
public WurbletArgumentParser(org.tentackle.model.Entity entity, boolean argumentGroupingEnabled, java.util.List<java.lang.String> arguments) throws org.wurbelizer.wurbel.WurbelExceptionCreates 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 Detail
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
getEntity
public org.tentackle.model.Entity getEntity()
Gets the entity the wurblet is applied to.- Returns:
- the entity
-
getExpression
public WurbletArgumentExpression getExpression()
Gets the where expression.- Returns:
- the expression
-
getExpressionArguments
public java.util.List<WurbletArgument> getExpressionArguments()
Gets all arguments part of the expression.- Returns:
- the expression arguments
-
getExtraArguments
public java.util.List<WurbletArgument> getExtraArguments()
Gets the extra arguments.
Those are not part of the expression and not sorting arguments.- Returns:
- the extra arguments
-
getSortingArguments
public java.util.List<WurbletArgument> getSortingArguments()
Gets the sorting arguments.- Returns:
- the sorting arguments
-
getJoinArguments
public java.util.List<WurbletArgument> getJoinArguments()
Gets the join arguments.- Returns:
- the joins
-
getJoinPaths
public java.util.List<JoinPath> getJoinPaths()
Gets the consolidated relation paths for the join arguments.- Returns:
- the join paths
-
getMethodArguments
public java.util.List<WurbletArgument> getMethodArguments()
Gets the method arguments.- Returns:
- all arguments
-
getAllArguments
public java.util.List<WurbletArgument> getAllArguments()
Gets all arguments.- Returns:
- all arguments
-
createArgument
public WurbletArgument createArgument(java.lang.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
-
-