Search in sources :

Example 1 with JavaFileWriter

use of com.yahoo.aptutils.writer.JavaFileWriter in project squidb by yahoo.

the class ViewModelFileWriter method emitUnaliasedPropertyArray.

private void emitUnaliasedPropertyArray() throws IOException {
    writer.writeComment("--- unaliased property references");
    Expression basePropertiesInit = Expressions.block(new Expression() {

        @Override
        public boolean writeExpression(JavaFileWriter writer) throws IOException {
            return emitPropertyReferenceArrayBody(false);
        }
    }, false, false, false, false);
    writer.writeFieldDeclaration(TypeConstants.PROPERTY_ARRAY, BASE_PROPERTY_ARRAY_NAME, basePropertiesInit, TypeConstants.PRIVATE_STATIC_FINAL).writeNewline();
}
Also used : Expression(com.yahoo.aptutils.writer.expressions.Expression) JavaFileWriter(com.yahoo.aptutils.writer.JavaFileWriter) IOException(java.io.IOException)

Example 2 with JavaFileWriter

use of com.yahoo.aptutils.writer.JavaFileWriter in project squidb by yahoo.

the class ViewModelFileWriter method emitAliasedPropertyArray.

private void emitAliasedPropertyArray() throws IOException {
    writer.writeComment("--- aliased property references");
    Expression aliasedPropertiesInit = Expressions.block(new Expression() {

        @Override
        public boolean writeExpression(JavaFileWriter writer) throws IOException {
            return emitPropertyReferenceArrayBody(true);
        }
    }, false, false, false, false);
    writer.writeFieldDeclaration(TypeConstants.PROPERTY_ARRAY, ALIASED_PROPERTY_ARRAY_NAME, aliasedPropertiesInit, TypeConstants.PUBLIC_STATIC_FINAL).writeNewline();
    writer.beginInitializerBlock(true, true);
    writer.writeStatement(Expressions.callMethod("validateAliasedProperties", ALIASED_PROPERTY_ARRAY_NAME));
    writer.finishInitializerBlock(false, true);
    writer.writeNewline();
}
Also used : Expression(com.yahoo.aptutils.writer.expressions.Expression) JavaFileWriter(com.yahoo.aptutils.writer.JavaFileWriter) IOException(java.io.IOException)

Aggregations

JavaFileWriter (com.yahoo.aptutils.writer.JavaFileWriter)2 Expression (com.yahoo.aptutils.writer.expressions.Expression)2 IOException (java.io.IOException)2