Package com.mysema.query.types

Examples of com.mysema.query.types.Template$StaticText


            List<Object> args = new ArrayList<Object>(2);
            if (path.getMetadata().getParent() != null) {
                args.add((Expression<?>)path.getMetadata().getParent());
            }
            args.add(path.getMetadata().getElement());
            final Template template = getTemplate(pathType);
            for (Template.Element element : template.getElements()) {
                Object rv = element.convert(args);
                if (rv instanceof Expression) {                   
                    ((Expression)rv).accept(this, context);
                } else if (element.isString()) {   
                    append(rv.toString());
View Full Code Here


    }

    @Override
    public Void visit(Path<?> path, Void context) {
        final PathType pathType = path.getMetadata().getPathType();
        final Template template = templates.getTemplate(pathType);
        final Object element = path.getMetadata().getElement();       
        List<Object> args;
        if (path.getMetadata().getParent() != null) {
            args = ImmutableList.of(path.getMetadata().getParent(), element);
        } else {
View Full Code Here

        handleTemplate(template, args);
        return null;
    }
   
    protected void visitOperation(Class<?> type, Operator<?> operator, final List<? extends Expression<?>> args) {
        final Template template = templates.getTemplate(operator);
        if (template != null) {
            final int precedence = templates.getPrecedence(operator);       
            for (final Template.Element element : template.getElements()) {
                final Object rv = element.convert(args);
                if (rv instanceof Expression) {
                    final Expression<?> expr = (Expression<?>) rv;
                    if (precedence > -1 && expr instanceof Operation) {
                        if (precedence < templates.getPrecedence(((Operation<?>) expr).getOperator())) {
View Full Code Here

public class TemplateExpressionTest {

    @Test
    public void Constructors() {
        Templates templates = new JavaTemplates();
        Template template = TemplateFactory.DEFAULT.create("{0}");
        ImmutableList<Expression<?>> args = ImmutableList.<Expression<?>>of(new StringPath("a"));
        List<TemplateExpression<?>> customs = Arrays.<TemplateExpression<?>>asList(
            new BooleanTemplate(template, args),
            new ComparableTemplate<String>(String.class, template, args),
            new DateTemplate<java.sql.Date>(java.sql.Date.class, template, args),
View Full Code Here

        TimeTemplate.create(Time.class, template, arg);
    }

    @Test
    public void FactoryMethods2() {
        Template template = TemplateFactory.DEFAULT.create("");
        Expression<Boolean> arg = ConstantImpl.create(true);

        BooleanTemplate.create(template, arg);
        ComparableTemplate.create(String.class, template, arg);
        DateTemplate.create(Date.class, template, arg);
View Full Code Here

TOP

Related Classes of com.mysema.query.types.Template$StaticText

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.