Package com.mattinsler.guiceymongo.data.generator.type

Examples of com.mattinsler.guiceymongo.data.generator.type.Type


    builder.append(template.toString());
  }
 
  @Override
  public void createWrapperMethod(Appendable builder, SetProperty property, int indentCount) throws IOException {
    Type itemType = property.getType().getItemType();

    String s =
        "/**\n" +
        " * $p.comment$\n" +
        " */\n" +
View Full Code Here


    builder.append(template.toString());
  }
 
  @Override
  public void createBuilderNewBuilder(Appendable builder, SetProperty property, int indentCount) throws IOException {
    Type itemType = property.getType().getItemType();
   
    String s =
        "if (value.get$p.camelCaseName$Count() > 0) {\n";
    if (itemType instanceof UserDataType)
      s +=  "for ($p.itemType$ item : value.get$p.camelCaseName$Set())\n" +
View Full Code Here

    builder.append(template.toString());
  }
 
  @Override
  public void createBuilderBuild(Appendable builder, SetProperty property, int indentCount) throws IOException {
    Type itemType = property.getType().getItemType();
   
    String s;
    if (itemType instanceof UserEnumType) {
      s =
        "if ($p.memberVariableName$ != null) {\n" +
View Full Code Here

    super(PrimitiveType.class, typeRegistry);
  }
 
  @Override
  public void createEquals(Appendable builder, PrimitiveProperty property, int indentCount) throws IOException {
    Type type = property.getType();
   
    String s;
    if (PrimitiveType.BoolType.equals(type) ||
        PrimitiveType.DoubleType.equals(type) ||
        PrimitiveType.FloatType.equals(type) ||
View Full Code Here

  public String getItemType() {
    return super.getType().getItemType().getJavaType();
  }
 
  public String getListItemType() {
    Type type = super.getType().getItemType();
    if (type instanceof PrimitiveType)
      return ((PrimitiveType)type).getJavaBoxedType();
    return type.getJavaType();
  }
View Full Code Here

      return ((PrimitiveType)type).getJavaBoxedType();
    return type.getJavaType();
  }
 
  public String getBuilderItemType() {
    Type type = super.getType().getItemType();
    if (type instanceof UserDataType)
      return getItemType() + ".Builder";
    return getItemType();
  }
View Full Code Here

      return getItemType() + ".Builder";
    return getItemType();
  }
 
  public String getBuilderListItemType() {
    Type type = super.getType().getItemType();
    if (type instanceof UserDataType)
      return getListItemType() + ".Builder";
    return getListItemType();
  }
View Full Code Here

  public String getKeyType() {
    return super.getType().getKeyType().getJavaType();
  }
 
  public String getMapKeyType() {
    Type type = super.getType().getKeyType();
    if (type instanceof PrimitiveType)
      return ((PrimitiveType)type).getJavaBoxedType();
    return type.getJavaType();
  }
View Full Code Here

  public String getValueType() {
    return super.getType().getValueType().getJavaType();
  }
 
  public String getMapValueType() {
    Type type = super.getType().getValueType();
    if (type instanceof PrimitiveType)
      return ((PrimitiveType)type).getJavaBoxedType();
    if (type instanceof ListType) {
      Type itemType = ((ListType)type).getItemType();
      if (itemType instanceof PrimitiveType)
        return "java.util.List<" + ((PrimitiveType)itemType).getJavaBoxedType() + ">";
    }
    return type.getJavaType();
  }
View Full Code Here

    }
    return type.getJavaType();
  }
 
  public String getNewMapValueType() {
    Type type = super.getType().getValueType();
    if (type instanceof UserDataType) {
      return type.getJavaType() + ".newBuilder";
    }
    if (type instanceof ListType) {
      Type itemType = ((ListType)type).getItemType();
      if (itemType instanceof PrimitiveType)
        return "java.util.ArrayList<" + ((PrimitiveType)itemType).getJavaBoxedType() + ">";
      return "java.util.ArrayList<" + ((ListType)type).getItemType().getJavaType() + ">";
    }
    if (type instanceof SetType) {
      Type itemType = ((SetType)type).getItemType();
      if (itemType instanceof PrimitiveType)
        return "java.util.HashSet<" + ((PrimitiveType)itemType).getJavaBoxedType() + ">";
      return "java.util.HashSet<" + ((SetType)type).getItemType().getJavaType() + ">";
    }
    return "";
View Full Code Here

TOP

Related Classes of com.mattinsler.guiceymongo.data.generator.type.Type

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.