Package com.asakusafw.compiler.common

Examples of com.asakusafw.compiler.common.JavaName


        return false;
    }

    static PropertyMirror toProperty(ExecutableElement element) {
        assert element != null;
        JavaName name = JavaName.of(element.getSimpleName().toString());
        List<String> segments = name.getSegments();
        if (segments.size() <= 2) {
            return null;
        }
        if (segments.get(0).equals("get") == false
                || segments.get(segments.size() - 1).equals("option") == false) {
            return null;
        }
        name.removeLast();
        name.removeFirst();
        String propertyName = name.toMemberName();
        return new DefaultPropertyMirror(propertyName, element);
    }
View Full Code Here


        return results;
    }

    private static String toPropertyName(Method method) {
        assert method != null;
        JavaName name = JavaName.of(method.getName());
        List<String> segments = name.getSegments();
        if (segments.size() <= 2) {
            return null;
        }
        if (segments.get(0).equals("get") == false
                || segments.get(segments.size() - 1).equals("option") == false) {
            return null;
        }
        name.removeLast();
        name.removeFirst();
        return name.toMemberName();
    }
View Full Code Here

        return true;
    }

    @Override
    public Expression createIsNull(Expression object) {
        JavaName javaName = JavaName.of(name);
        javaName.addFirst("get");
        javaName.addLast("option");
        return new ExpressionBuilder(factory, object)
            .method(javaName.toMemberName())
            .method("isNull")
            .toExpression();
    }
View Full Code Here

            .toExpression();
    }

    @Override
    public Expression createGetter(Expression object) {
        JavaName javaName = JavaName.of(name);
        javaName.addFirst("get");
        javaName.addLast("option");
        return new ExpressionBuilder(factory, object)
            .method(javaName.toMemberName())
            .toExpression();
    }
View Full Code Here

        return assign(target, createGetter(object));
    }

    @Override
    public Statement createSetter(Expression object, Expression value) {
        JavaName javaName = JavaName.of(name);
        javaName.addFirst("set");
        javaName.addLast("option");
        return new ExpressionBuilder(factory, object)
            .method(javaName.toMemberName(), value)
            .toStatement();
    }
View Full Code Here

TOP

Related Classes of com.asakusafw.compiler.common.JavaName

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.