com.mysema.query.types
Class TemplateExpressionImpl<T>

java.lang.Object
  extended by com.mysema.query.types.ExpressionBase<T>
      extended by com.mysema.query.types.TemplateExpressionImpl<T>
Type Parameters:
T - expression type
All Implemented Interfaces:
Expression<T>, TemplateExpression<T>, Serializable
Direct Known Subclasses:
NullExpression, PredicateTemplate

public class TemplateExpressionImpl<T>
extends ExpressionBase<T>
implements TemplateExpression<T>

Default implementation of the TemplateExpression interface

Author:
tiwe
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.mysema.query.types.ExpressionBase
type
 
Constructor Summary
TemplateExpressionImpl(Class<? extends T> type, Template template, Expression<?>... args)
           
TemplateExpressionImpl(Class<? extends T> type, Template template, List<Expression<?>> args)
           
 
Method Summary
<R,C> R
accept(Visitor<R,C> v, C context)
          Accept the visitor with the given context
static
<C> Expression<C>
create(Class<C> cl, String template, Expression<?>... args)
          Create a new TemplateExpression with the given template in String form and template arguments
static
<C> Expression<C>
create(Class<C> cl, Template template, Expression<?>... args)
          Create a new TemplateExpression with the given template and template arguments
 boolean equals(Object o)
           
 Expression<?> getArg(int index)
          Get the argument with the given index
 List<Expression<?>> getArgs()
          Get the arguments of the custom expression
 Template getTemplate()
          Get the serialization template for this custom expression
 int hashCode()
           
 
Methods inherited from class com.mysema.query.types.ExpressionBase
getType, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.mysema.query.types.Expression
getType
 

Constructor Detail

TemplateExpressionImpl

public TemplateExpressionImpl(Class<? extends T> type,
                              Template template,
                              Expression<?>... args)

TemplateExpressionImpl

public TemplateExpressionImpl(Class<? extends T> type,
                              Template template,
                              List<Expression<?>> args)
Method Detail

create

public static <C> Expression<C> create(Class<C> cl,
                                       String template,
                                       Expression<?>... args)
Create a new TemplateExpression with the given template in String form and template arguments

Type Parameters:
C -
Parameters:
cl -
template -
args -
Returns:

create

public static <C> Expression<C> create(Class<C> cl,
                                       Template template,
                                       Expression<?>... args)
Create a new TemplateExpression with the given template and template arguments

Type Parameters:
C -
Parameters:
cl -
template -
args -
Returns:

getArg

public Expression<?> getArg(int index)
Description copied from interface: TemplateExpression
Get the argument with the given index

Specified by:
getArg in interface TemplateExpression<T>
Returns:

getArgs

public List<Expression<?>> getArgs()
Description copied from interface: TemplateExpression
Get the arguments of the custom expression

Specified by:
getArgs in interface TemplateExpression<T>
Returns:

getTemplate

public Template getTemplate()
Description copied from interface: TemplateExpression
Get the serialization template for this custom expression

Specified by:
getTemplate in interface TemplateExpression<T>
Returns:

equals

public boolean equals(Object o)
Overrides:
equals in class Object

hashCode

public int hashCode()
Overrides:
hashCode in class Object

accept

public <R,C> R accept(Visitor<R,C> v,
                      C context)
Description copied from interface: Expression
Accept the visitor with the given context

Specified by:
accept in interface Expression<T>
Type Parameters:
R - return type
C - context type
Parameters:
v - visitor
context - context of visit
Returns:


Copyright © 2007-2011 Mysema Ltd. All Rights Reserved.