Codota Logo
JavaFileWriter.appendString
Code IndexAdd Codota to your IDE (free)

How to use
appendString
method
in
com.yahoo.aptutils.writer.JavaFileWriter

Best Java code snippets using com.yahoo.aptutils.writer.JavaFileWriter.appendString (Showing top 8 results out of 315)

  • Common ways to obtain JavaFileWriter
private void myMethod () {
JavaFileWriter j =
  • Codota IconJavaFileWriter javaFileWriter;String str;javaFileWriter.writeStringStatement(str)
  • Smart code suggestions by Codota
}
origin: yahoo/squidb

  @Override
  public boolean writeExpression(JavaFileWriter writer) throws IOException {
    writer.appendString("@")
        .appendString(writer.shortenName(MODEL_GEN_ERROR_INNER, false))
        .appendString("(specClass=")
        .appendExpression(Expressions.classObject(errorInfo.errorClass))
        .appendString(", ");
    if (!AptUtils.isEmpty(errorInfo.element)) {
      writer.appendString("element=\"")
          .appendString(errorInfo.element)
          .appendString("\", ");
    }
    writer.appendString("message=\"")
        .appendString(errorInfo.message)
        .appendString("\")");
    return true;
  }
}
origin: yahoo/squidb

  @Override
  public boolean writeExpression(JavaFileWriter writer) throws IOException {
    writer.appendExpression(condition)
        .appendString(" ? ")
        .appendExpression(ifTrue)
        .appendString(" : ")
        .appendExpression(ifFalse);
    return true;
  }
}
origin: yahoo/squidb

  @Override
  public boolean writeExpression(JavaFileWriter writer) throws IOException {
    writer.appendString("@")
        .appendString(writer.shortenName(MODEL_GEN_ERRORS, false))
        .appendString("({\n");
    writer.moveToScope(JavaFileWriter.Scope.METHOD_DEFINITION);
    boolean needsNewline = false;
    for (ErrorInfo errorInfo : errors) {
      if (needsNewline) {
        writer.appendString(",").writeNewline();
      }
      needsNewline = true;
      writer.writeExpression(new ModelGenErrorSingle(errorInfo));
    }
    writer.writeNewline();
    writer.finishScope(JavaFileWriter.Scope.METHOD_DEFINITION);
    writer.writeString("})");
    return true;
  }
}
origin: yahoo/squidb

private boolean emitPropertyReferenceArrayBody(boolean alias) throws IOException {
  for (PropertyGenerator propertyGenerator : modelSpec.getPropertyGenerators()) {
    Expression reference = Expressions.staticReference(modelSpec.getModelSpecName(),
        propertyGenerator.getPropertyName());
    if (alias) {
      VariableElement field = propertyGenerator.getField();
      if (field != null) {
        Alias aliasAnnotation = field.getAnnotation(Alias.class);
        if (aliasAnnotation != null && !AptUtils.isEmpty(aliasAnnotation.value().trim())) {
          reference = reference.callMethod("as", "\"" + aliasAnnotation.value().trim() + "\"");
        }
      }
    }
    writer.writeExpression(reference);
    writer.appendString(",\n");
  }
  return !AptUtils.isEmpty(modelSpec.getPropertyGenerators());
}
origin: com.yahoo.squidb/squidb-processor

  @Override
  public boolean writeExpression(JavaFileWriter writer) throws IOException {
    writer.appendString("@")
        .appendString(writer.shortenName(MODEL_GEN_ERROR_INNER, false))
        .appendString("(specClass=")
        .appendExpression(Expressions.classObject(errorInfo.errorClass))
        .appendString(", ");
    if (!AptUtils.isEmpty(errorInfo.element)) {
      writer.appendString("element=\"")
          .appendString(errorInfo.element)
          .appendString("\", ");
    }
    writer.appendString("message=\"")
        .appendString(errorInfo.message)
        .appendString("\")");
    return true;
  }
}
origin: com.yahoo.squidb/squidb-processor

  @Override
  public boolean writeExpression(JavaFileWriter writer) throws IOException {
    writer.appendExpression(condition)
        .appendString(" ? ")
        .appendExpression(ifTrue)
        .appendString(" : ")
        .appendExpression(ifFalse);
    return true;
  }
}
origin: com.yahoo.squidb/squidb-processor

  @Override
  public boolean writeExpression(JavaFileWriter writer) throws IOException {
    writer.appendString("@")
        .appendString(writer.shortenName(MODEL_GEN_ERRORS, false))
        .appendString("({\n");
    writer.moveToScope(JavaFileWriter.Scope.METHOD_DEFINITION);
    boolean needsNewline = false;
    for (ErrorInfo errorInfo : errors) {
      if (needsNewline) {
        writer.appendString(",").writeNewline();
      }
      needsNewline = true;
      writer.writeExpression(new ModelGenErrorSingle(errorInfo));
    }
    writer.writeNewline();
    writer.finishScope(JavaFileWriter.Scope.METHOD_DEFINITION);
    writer.writeString("})");
    return true;
  }
}
origin: com.yahoo.squidb/squidb-processor

private boolean emitPropertyReferenceArrayBody(boolean alias) throws IOException {
  for (PropertyGenerator propertyGenerator : modelSpec.getPropertyGenerators()) {
    Expression reference = Expressions.staticReference(modelSpec.getModelSpecName(),
        propertyGenerator.getPropertyName());
    if (alias) {
      VariableElement field = propertyGenerator.getField();
      if (field != null) {
        Alias aliasAnnotation = field.getAnnotation(Alias.class);
        if (aliasAnnotation != null && !AptUtils.isEmpty(aliasAnnotation.value().trim())) {
          reference = reference.callMethod("as", "\"" + aliasAnnotation.value().trim() + "\"");
        }
      }
    }
    writer.writeExpression(reference);
    writer.appendString(",\n");
  }
  return !AptUtils.isEmpty(modelSpec.getPropertyGenerators());
}
com.yahoo.aptutils.writerJavaFileWriterappendString

Popular methods of JavaFileWriter

  • writeStatement
  • writeStringStatement
  • appendExpression
  • beginConstructorDeclaration
  • beginInitializerBlock
  • beginMethodDefinition
  • beginTypeDefinition
  • close
  • finishInitializerBlock
  • finishMethodDefinition
  • finishScope
  • finishTypeDefinition
  • finishScope,
  • finishTypeDefinition,
  • moveToScope,
  • registerOtherKnownNames,
  • shortenName,
  • writeAnnotation,
  • writeComment,
  • writeExpression,
  • writeFieldDeclaration

Popular in Java

  • Making http requests using okhttp
  • addToBackStack (FragmentTransaction)
  • onRequestPermissionsResult (Fragment)
  • runOnUiThread (Activity)
  • Pointer (com.sun.jna)
    An abstraction for a native pointer data type. A Pointer instance represents, on the Java side, a na
  • HttpServer (com.sun.net.httpserver)
    This class implements a simple HTTP server. A HttpServer is bound to an IP address and port number a
  • File (java.io)
    An "abstract" representation of a file system entity identified by a pathname. The pathname may be a
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • HashSet (java.util)
    This class implements the Set interface, backed by a hash table (actually a HashMap instance). It m
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now