|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.outerj.daisy.query.model.Literal
public final class Literal
Constructor Summary | |
---|---|
Literal(java.lang.String value,
java.lang.String originalToken)
|
Method Summary | |
---|---|
static int |
bindLiteral(java.sql.PreparedStatement stmt,
int bindPos,
QValueType valueType,
java.lang.Object value)
Utility method for use by other classes. |
int |
bindPreConditions(java.sql.PreparedStatement stmt,
int bindPos)
|
int |
bindValueExpr(java.sql.PreparedStatement stmt,
int bindPos,
QValueType valueType,
org.outerj.daisy.repository.query.EvaluationContext evaluationContext)
|
boolean |
canTestAppliesTo()
|
java.lang.Object |
evaluate(QValueType valueType)
|
java.lang.Object |
evaluate(QValueType valueType,
org.outerj.daisy.repository.Document document,
org.outerj.daisy.repository.Version version,
org.outerj.daisy.repository.query.EvaluationContext evaluationContext)
Evaluates this expression for the given document and/or version. |
java.lang.Object |
evaluate(QValueType valueType,
org.outerj.daisy.repository.query.EvaluationContext evaluationContext)
Evaluates the expression without access to document information. |
void |
generateSqlValueExpr(java.lang.StringBuffer sql,
SqlGenerationContext context)
Generates the SQL for this expression. |
int |
getColumn()
|
java.lang.String |
getExpression()
Get a textual representation of this expression, i.e. |
int |
getLine()
|
java.lang.String |
getLocation()
|
java.lang.Object |
getOutputValue(org.outerj.daisy.repository.Document document,
org.outerj.daisy.repository.Version version,
org.outerj.daisy.repository.query.EvaluationContext evaluationContext)
Returns the output value of this identifier for the given document and version. |
QValueType |
getOutputValueType()
Identifies the type of data returned from the ValueExpr.getOutputValue(org.outerj.daisy.repository.Document, org.outerj.daisy.repository.Version, EvaluationContext) method. |
java.lang.String |
getSqlPreConditions(SqlGenerationContext context)
Generates any SQL conditions needed outside of the main value expression (which is generated using ValueExpr.generateSqlValueExpr(StringBuffer, SqlGenerationContext) ). |
java.lang.String |
getTitle(java.util.Locale locale)
|
QValueType |
getValueType()
Returns the ValueType of this expression, or null if undetermined. |
AclConditionViolation |
isAclAllowed()
Returns non-null if this ValueExpr is not fitted for use in ACL document selection expressions. |
boolean |
isMultiValue()
|
boolean |
isOutputOnly()
Returns true for ValueExpr's which cannot be searched on (i.e. |
boolean |
isSymbolicIdentifier()
Returns true if this ValueExpr represents a symbolic identifier. |
void |
prepare(QueryContext context)
A method that should be called before any of the others. |
void |
setLocation(int line,
int column)
|
java.lang.Object |
translateSymbolic(ValueExpr valueExpr,
org.outerj.daisy.repository.query.EvaluationContext evaluationContext)
See ValueExpr.isSymbolicIdentifier() . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Literal(java.lang.String value, java.lang.String originalToken)
Method Detail |
---|
public void setLocation(int line, int column)
setLocation
in interface Expression
public java.lang.String getLocation()
getLocation
in interface Expression
public int getLine()
getLine
in interface Expression
public int getColumn()
getColumn
in interface Expression
public java.lang.Object evaluate(QValueType valueType, org.outerj.daisy.repository.query.EvaluationContext evaluationContext) throws org.outerj.daisy.repository.query.QueryException
ValueExpr
evaluate
in interface ValueExpr
valueType
- Indicates the type of object to return. This parameter only matters when
org.outerj.daisy.repository.query.QueryException
public java.lang.Object evaluate(QValueType valueType) throws org.outerj.daisy.repository.query.QueryException
org.outerj.daisy.repository.query.QueryException
public java.lang.Object evaluate(QValueType valueType, org.outerj.daisy.repository.Document document, org.outerj.daisy.repository.Version version, org.outerj.daisy.repository.query.EvaluationContext evaluationContext) throws org.outerj.daisy.repository.query.QueryException
ValueExpr
evaluate
in interface ValueExpr
org.outerj.daisy.repository.query.QueryException
public boolean isMultiValue()
isMultiValue
in interface ValueExpr
public void prepare(QueryContext context)
ValueExpr
prepare
in interface ValueExpr
public boolean isOutputOnly()
ValueExpr
isOutputOnly
in interface ValueExpr
public AclConditionViolation isAclAllowed()
ValueExpr
isAclAllowed
in interface ValueExpr
public java.lang.String getSqlPreConditions(SqlGenerationContext context)
ValueExpr
ValueExpr.generateSqlValueExpr(StringBuffer, SqlGenerationContext)
).
Should throw an exception if this is an output-only ValueExpr.
getSqlPreConditions
in interface ValueExpr
public void generateSqlValueExpr(java.lang.StringBuffer sql, SqlGenerationContext context)
ValueExpr
Should throw an exception if this is an output-only ValueExpr.
generateSqlValueExpr
in interface ValueExpr
public int bindPreConditions(java.sql.PreparedStatement stmt, int bindPos)
bindPreConditions
in interface ValueExpr
public int bindValueExpr(java.sql.PreparedStatement stmt, int bindPos, QValueType valueType, org.outerj.daisy.repository.query.EvaluationContext evaluationContext) throws java.sql.SQLException, org.outerj.daisy.repository.query.QueryException
bindValueExpr
in interface ValueExpr
java.sql.SQLException
org.outerj.daisy.repository.query.QueryException
public static int bindLiteral(java.sql.PreparedStatement stmt, int bindPos, QValueType valueType, java.lang.Object value) throws java.sql.SQLException
java.sql.SQLException
public QValueType getValueType()
ValueExpr
getValueType
in interface ValueExpr
public boolean isSymbolicIdentifier()
ValueExpr
If this method returns true, then ValueExpr.translateSymbolic(org.outerj.daisy.query.model.ValueExpr, org.outerj.daisy.repository.query.EvaluationContext)
can
be called to convert the symbolic value to the test value.
isSymbolicIdentifier
in interface ValueExpr
public java.lang.Object translateSymbolic(ValueExpr valueExpr, org.outerj.daisy.repository.query.EvaluationContext evaluationContext) throws org.outerj.daisy.repository.query.QueryException
ValueExpr
ValueExpr.isSymbolicIdentifier()
. This method should only be called
if ValueExpr.isSymbolicIdentifier()
returns true.
translateSymbolic
in interface ValueExpr
org.outerj.daisy.repository.query.QueryException
public java.lang.String getTitle(java.util.Locale locale)
getTitle
in interface ValueExpr
public java.lang.String getExpression()
ValueExpr
getExpression
in interface ValueExpr
public QValueType getOutputValueType()
ValueExpr
ValueExpr.getOutputValue(org.outerj.daisy.repository.Document, org.outerj.daisy.repository.Version, EvaluationContext)
method.
getOutputValueType
in interface ValueExpr
public java.lang.Object getOutputValue(org.outerj.daisy.repository.Document document, org.outerj.daisy.repository.Version version, org.outerj.daisy.repository.query.EvaluationContext evaluationContext)
ValueExpr
ValueExpr.evaluate(QValueType, org.outerj.daisy.repository.Document, org.outerj.daisy.repository.Version, EvaluationContext)
.
The version is allowed to be null.
getOutputValue
in interface ValueExpr
public boolean canTestAppliesTo()
canTestAppliesTo
in interface ValueExpr
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |