Tabnine Logo
DeclaredTypeName.toString
Code IndexAdd Tabnine to your IDE (free)

How to use
toString
method
in
com.yahoo.aptutils.model.DeclaredTypeName

Best Java code snippets using com.yahoo.aptutils.model.DeclaredTypeName.toString (Showing top 6 results out of 315)

origin: yahoo/squidb

private DeclaredTypeName extractGetAndSetType() {
  String basicType = propertyType.toString().replace(TypeConstants.PROPERTY.toString(), "")
      .replace("Property", "")
      .replace(".", "");
  if ("Blob".equals(basicType)) {
    return TypeConstants.BYTE_ARRAY;
  } else {
    return new DeclaredTypeName("java.lang", basicType);
  }
}
origin: yahoo/squidb

@Override
public void emitAdditionalJava(JavaFileWriter writer) throws IOException {
  List<ErrorInfo> errors = modelSpec.getLoggedErrors();
  if (errors.size() > 0) {
    writer.writeExpression(new ModelGenErrorsExpression(errors))
        .writeNewline();
    TypeDeclarationParameters dummyErrorClass = new TypeDeclarationParameters()
        .setModifiers(Modifier.STATIC, Modifier.FINAL)
        .setName(new DeclaredTypeName(modelSpec.getGeneratedClassName().toString(), "LoggedErrors"))
        .setKind(JavaFileWriter.Type.CLASS);
    writer.beginTypeDefinition(dummyErrorClass);
    writer.writeComment("Dummy class for holding logged error annotations");
    writer.finishTypeDefinition();
  }
}
origin: yahoo/squidb

@Override
public boolean processVariableElement(VariableElement field, DeclaredTypeName fieldType) {
  boolean isViewProperty = TypeConstants.isBasicPropertyType(fieldType);
  ViewQuery isViewQuery = field.getAnnotation(ViewQuery.class);
  if (TypeConstants.isVisibleConstant(field)) {
    if (isViewQuery != null) {
      if (!TypeConstants.QUERY.equals(fieldType)) {
        modelSpec.logError("ViewQuery must be an instance of " + TypeConstants.QUERY.toString(), field);
      } else if (modelSpec.hasMetadata(ViewModelSpecWrapper.METADATA_KEY_QUERY_ELEMENT)) {
        modelSpec.logError("Only one ViewQuery can be declared per spec", field);
      } else {
        modelSpec.putMetadata(ViewModelSpecWrapper.METADATA_KEY_VIEW_QUERY, isViewQuery);
        modelSpec.putMetadata(ViewModelSpecWrapper.METADATA_KEY_QUERY_ELEMENT, field);
      }
      return true;
    } else {
      return super.processVariableElement(field, fieldType);
    }
  } else if (isViewProperty) {
    modelSpec.logError("View properties must be static final and non-private", field);
  }
  return false;
}
origin: com.yahoo.squidb/squidb-processor

private DeclaredTypeName extractGetAndSetType() {
  String basicType = propertyType.toString().replace(TypeConstants.PROPERTY.toString(), "")
      .replace("Property", "")
      .replace(".", "");
  if ("Blob".equals(basicType)) {
    return TypeConstants.BYTE_ARRAY;
  } else {
    return new DeclaredTypeName("java.lang", basicType);
  }
}
origin: com.yahoo.squidb/squidb-processor

@Override
public void emitAdditionalJava(JavaFileWriter writer) throws IOException {
  List<ErrorInfo> errors = modelSpec.getLoggedErrors();
  if (errors.size() > 0) {
    writer.writeExpression(new ModelGenErrorsExpression(errors))
        .writeNewline();
    TypeDeclarationParameters dummyErrorClass = new TypeDeclarationParameters()
        .setModifiers(Modifier.STATIC, Modifier.FINAL)
        .setName(new DeclaredTypeName(modelSpec.getGeneratedClassName().toString(), "LoggedErrors"))
        .setKind(JavaFileWriter.Type.CLASS);
    writer.beginTypeDefinition(dummyErrorClass);
    writer.writeComment("Dummy class for holding logged error annotations");
    writer.finishTypeDefinition();
  }
}
origin: com.yahoo.squidb/squidb-processor

@Override
public boolean processVariableElement(VariableElement field, DeclaredTypeName fieldType) {
  boolean isViewProperty = TypeConstants.isBasicPropertyType(fieldType);
  ViewQuery isViewQuery = field.getAnnotation(ViewQuery.class);
  if (TypeConstants.isVisibleConstant(field)) {
    if (isViewQuery != null) {
      if (!TypeConstants.QUERY.equals(fieldType)) {
        modelSpec.logError("ViewQuery must be an instance of " + TypeConstants.QUERY.toString(), field);
      } else if (modelSpec.hasMetadata(ViewModelSpecWrapper.METADATA_KEY_QUERY_ELEMENT)) {
        modelSpec.logError("Only one ViewQuery can be declared per spec", field);
      } else {
        modelSpec.putMetadata(ViewModelSpecWrapper.METADATA_KEY_VIEW_QUERY, isViewQuery);
        modelSpec.putMetadata(ViewModelSpecWrapper.METADATA_KEY_QUERY_ELEMENT, field);
      }
      return true;
    } else {
      return super.processVariableElement(field, fieldType);
    }
  } else if (isViewProperty) {
    modelSpec.logError("View properties must be static final and non-private", field);
  }
  return false;
}
com.yahoo.aptutils.modelDeclaredTypeNametoString

Popular methods of DeclaredTypeName

  • clone
  • equals
  • getTypeArgs
  • setTypeArgs
  • <init>
  • getPackageName
  • getSimpleName
  • accept

Popular in Java

  • Running tasks concurrently on multiple threads
  • setRequestProperty (URLConnection)
  • onRequestPermissionsResult (Fragment)
  • getContentResolver (Context)
  • VirtualMachine (com.sun.tools.attach)
    A Java virtual machine. A VirtualMachine represents a Java virtual machine to which this Java vir
  • Comparator (java.util)
    A Comparator is used to compare two objects to determine their ordering with respect to each other.
  • Map (java.util)
    A Map is a data structure consisting of a set of keys and values in which each key is mapped to a si
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • Location (org.springframework.beans.factory.parsing)
    Class that models an arbitrary location in a Resource.Typically used to track the location of proble
  • Top Vim plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now