javax.lang.model.type.NullType Java Examples

The following examples show how to use javax.lang.model.type.NullType. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: myexcel   Author: liaochong   File: AbstractSimpleExcelBuilder.java    License: Apache License 2.0 6 votes vote down vote up
private void setTdContent(Td td, Pair<? extends Class, ?> pair) {
    Class fieldType = pair.getKey();
    if (fieldType == NullType.class) {
        return;
    }
    if (fieldType == Date.class) {
        td.setDate((Date) pair.getValue());
    } else if (fieldType == LocalDateTime.class) {
        td.setLocalDateTime((LocalDateTime) pair.getValue());
    } else if (fieldType == LocalDate.class) {
        td.setLocalDate((LocalDate) pair.getValue());
    } else if (com.github.liaochong.myexcel.core.constant.File.class.isAssignableFrom(fieldType)) {
        td.setFile((File) pair.getValue());
    } else {
        td.setContent(String.valueOf(pair.getValue()));
    }
}
 
Example #2
Source Project: myexcel   Author: liaochong   File: AbstractSimpleExcelBuilder.java    License: Apache License 2.0 6 votes vote down vote up
protected List<Pair<? extends Class, ?>> assemblingMapContents(Map<String, Object> data) {
    if (data == null || data.isEmpty()) {
        return Collections.emptyList();
    }
    List<Pair<? extends Class, ?>> contents = new ArrayList<>(data.size());
    if (fieldDisplayOrder == null) {
        data.forEach((k, v) -> {
            contents.add(Pair.of(v == null ? NullType.class : v.getClass(), v));
        });
    } else {
        for (String fieldName : fieldDisplayOrder) {
            Object val = data.get(fieldName);
            contents.add(Pair.of(val == null ? NullType.class : val.getClass(), val));
        }
    }
    return contents;
}
 
Example #3
Source Project: manifold   Author: manifold-systems   File: SrcClassUtil.java    License: Apache License 2.0 6 votes vote down vote up
private SrcType makeTypeVarType( Symbol.TypeVariableSymbol typeVar )
{
  StringBuilder sb = new StringBuilder( typeVar.type.toString() );
  Type lowerBound = typeVar.type.getLowerBound();
  if( lowerBound != null && !(lowerBound instanceof NullType) )
  {
    sb.append( " super " ).append( lowerBound.toString() );
  }
  else
  {
    Type upperBound = typeVar.type.getUpperBound();
    if( upperBound != null && !(upperBound instanceof NoType) && !upperBound.toString().equals( Object.class.getName() ) )
    {
      sb.append( " extends " ).append( upperBound.toString() );
    }
  }
  return new SrcType( sb.toString() );
}
 
Example #4
Source Project: SkyblockAddons   Author: BiscuitDevelopment   File: GuiContainerHook.java    License: MIT License 5 votes vote down vote up
public static void handleMouseClick(Slot slotIn, int slotId, int clickedButton, int clickType, ReturnValue<NullType> returnValue) {
/*        SkyblockAddons main = SkyblockAddons.getInstance();
        if (main.getUtils().isOnSkyblock()) {
            boolean isOutsideGui = oldMouseX < guiLeft || oldMouseY < guiTop || oldMouseX >= guiLeft + xSize || oldMouseY >= guiTop + ySize;
            Minecraft mc = Minecraft.getMinecraft();
            if (main.getConfigValues().isEnabled(Feature.STOP_DROPPING_SELLING_RARE_ITEMS) &&
                    mc.thePlayer.inventory.getItemStack() != null && isOutsideGui &&
                    main.getInventoryUtils().shouldCancelDrop(mc.thePlayer.inventory.getItemStack())) returnValue.cancel();
        }*/
    }
 
Example #5
Source Project: auto-parcel   Author: aitorvs   File: MoreTypes.java    License: Apache License 2.0 5 votes vote down vote up
/**
 * Returns a {@link NullType} if the {@link TypeMirror} represents the null type
 * or throws an {@link IllegalArgumentException}.
 */
public static NullType asNullType(TypeMirror maybeNullType) {
    return maybeNullType.accept(new CastingTypeVisitor<NullType>() {
        @Override
        public NullType visitNull(NullType nullType, String p) {
            return nullType;
        }
    }, "null");
}
 
Example #6
Source Project: revapi   Author: revapi   File: Util.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public final T visitNull(NullType t, StringBuilderAndState<S> st) {
    try {
        st.depth++;
        return doVisitNull(t, st);
    } finally {
        st.depth--;
    }
}
 
Example #7
Source Project: buck   Author: facebook   File: StandaloneTypeMirror.java    License: Apache License 2.0 5 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  switch (kind) {
    case BOOLEAN:
    case BYTE:
    case SHORT:
    case INT:
    case LONG:
    case CHAR:
    case FLOAT:
    case DOUBLE:
      return v.visitPrimitive((PrimitiveType) this, p);
    case PACKAGE:
    case VOID:
    case NONE:
      return v.visitNoType((NoType) this, p);
    case NULL:
      return v.visitNull((NullType) this, p);
    case ARRAY:
      return v.visitArray((ArrayType) this, p);
    case DECLARED:
      return v.visitDeclared((DeclaredType) this, p);
    case ERROR:
      return v.visitError((ErrorType) this, p);
    case TYPEVAR:
      return v.visitTypeVariable((TypeVariable) this, p);
    case WILDCARD:
      return v.visitWildcard((WildcardType) this, p);
    case EXECUTABLE:
      return v.visitExecutable((ExecutableType) this, p);
    case OTHER:
      return v.visit(this, p);
    case UNION:
      return v.visitUnion((UnionType) this, p);
    case INTERSECTION:
      return v.visitIntersection((IntersectionType) this, p);
    default:
      throw new AssertionError(String.format("Unknown TypeKind: %s", kind));
  }
}
 
Example #8
Source Project: netbeans   Author: apache   File: ExportNonAccessibleElement.java    License: Apache License 2.0 4 votes vote down vote up
public Boolean visitNull(NullType arg0, Void arg1) {
    return false;
}
 
Example #9
Source Project: turbine   Author: google   File: TurbineTypes.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public NullType getNullType() {
  return factory.nullType();
}
 
Example #10
Source Project: turbine   Author: google   File: ModelFactory.java    License: Apache License 2.0 4 votes vote down vote up
public NullType nullType() {
  return new TurbineNullType(this);
}
 
Example #11
Source Project: turbine   Author: google   File: TurbineTypeMirror.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public boolean equals(Object obj) {
  return obj instanceof NullType;
}
 
Example #12
Source Project: EasyMPermission   Author: mobmead   File: FindTypeVarScanner.java    License: MIT License 4 votes vote down vote up
@Override public Void visitNull(NullType t, Void p) {
	return null;
}
 
Example #13
Source Project: FreeBuilder   Author: inferred   File: IsInvalidTypeVisitor.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Boolean visitNull(NullType t, Void p) {
  return false;
}
 
Example #14
Source Project: sundrio   Author: sundrio   File: TypeRefTypeVisitor.java    License: Apache License 2.0 4 votes vote down vote up
public TypeRef visitNull(NullType t, Integer dimension) {
    return null;
}
 
Example #15
Source Project: Eclipse-Postfix-Code-Completion   Author: trylimits   File: Factory.java    License: Eclipse Public License 1.0 4 votes vote down vote up
public NullType getNullType() {
	return NoTypeImpl.NULL_TYPE;
}
 
Example #16
Source Project: Eclipse-Postfix-Code-Completion   Author: trylimits   File: TypesImpl.java    License: Eclipse Public License 1.0 4 votes vote down vote up
@Override
public NullType getNullType() {
    return _env.getFactory().getNullType();
}
 
Example #17
Source Project: j2objc   Author: google   File: TypeUtil.java    License: Apache License 2.0 4 votes vote down vote up
public NullType getNull() {
  return javacTypes.getNullType();
}
 
Example #18
Source Project: revapi   Author: revapi   File: MissingTypeAwareDelegatingTypes.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public NullType getNullType() {
    return types.getNullType();
}
 
Example #19
Source Project: revapi   Author: revapi   File: Util.java    License: Apache License 2.0 4 votes vote down vote up
protected T doVisitNull(NullType t, StringBuilderAndState<S> st) {
    return defaultAction(t, st);
}
 
Example #20
Source Project: revapi   Author: revapi   File: TypeMirrorPairVisitor.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public final R visitNull(NullType type, TypeMirror otherType) {
    return otherType instanceof NullType ? visitNull(type, (NullType) otherType) :
        unmatchedAction(type, otherType);
}
 
Example #21
Source Project: revapi   Author: revapi   File: TypeMirrorPairVisitor.java    License: Apache License 2.0 4 votes vote down vote up
protected R visitNull(NullType type, NullType otherType) {
    return defaultMatchAction(type, otherType);
}
 
Example #22
Source Project: doma   Author: domaframework   File: MoreTypes.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public NullType getNullType() {
  return typeUtils.getNullType();
}
 
Example #23
Source Project: buck   Author: facebook   File: TypeScanner8.java    License: Apache License 2.0 4 votes vote down vote up
@Override
@Nullable
public R visitNull(NullType t, P p) {
  return defaultValue;
}
 
Example #24
Source Project: buck   Author: facebook   File: StandaloneTypeMirror.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public <R, P> R accept(TypeVisitor<R, P> v, P p) {
  switch (kind) {
    case BOOLEAN:
    case BYTE:
    case SHORT:
    case INT:
    case LONG:
    case CHAR:
    case FLOAT:
    case DOUBLE:
      return v.visitPrimitive((PrimitiveType) this, p);
    case PACKAGE:
    case MODULE:
    case VOID:
    case NONE:
      return v.visitNoType((NoType) this, p);
    case NULL:
      return v.visitNull((NullType) this, p);
    case ARRAY:
      return v.visitArray((ArrayType) this, p);
    case DECLARED:
      return v.visitDeclared((DeclaredType) this, p);
    case ERROR:
      return v.visitError((ErrorType) this, p);
    case TYPEVAR:
      return v.visitTypeVariable((TypeVariable) this, p);
    case WILDCARD:
      return v.visitWildcard((WildcardType) this, p);
    case EXECUTABLE:
      return v.visitExecutable((ExecutableType) this, p);
    case OTHER:
      return v.visit(this, p);
    case UNION:
      return v.visitUnion((UnionType) this, p);
    case INTERSECTION:
      return v.visitIntersection((IntersectionType) this, p);
    default:
      throw new AssertionError(String.format("Unknown TypeKind: %s", kind));
  }
}
 
Example #25
Source Project: buck   Author: facebook   File: TreeBackedTypes.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public NullType getNullType() {
  return javacTypes.getNullType();
}
 
Example #26
Source Project: buck   Author: facebook   File: TypeScanner8Test.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Void visitNull(NullType t, Void aVoid) {
  scans.add(t.toString());
  return super.visitNull(t, aVoid);
}
 
Example #27
Source Project: immutables   Author: immutables   File: TypeExtractor.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public Type visitNull(NullType t, Type.Parameters p) {
  throw new UnsupportedOperationException("NullType type not supported");
}
 
Example #28
Source Project: auto   Author: google   File: MoreTypes.java    License: Apache License 2.0 4 votes vote down vote up
@Override
public NullType visitNull(NullType type, Void ignore) {
  return type;
}
 
Example #29
Source Project: camunda-bpm-platform   Author: camunda   File: PrimitiveValueTypeImpl.java    License: Apache License 2.0 4 votes vote down vote up
public NullTypeImpl() {
  super("null", NullType.class);
}
 
Example #30
Source Project: auto   Author: google   File: MoreTypes.java    License: Apache License 2.0 2 votes vote down vote up
/**
 * Returns a {@link NullType} if the {@link TypeMirror} represents the null type or throws an
 * {@link IllegalArgumentException}.
 */
public static NullType asNullType(TypeMirror maybeNullType) {
  return maybeNullType.accept(NullTypeVisitor.INSTANCE, null);
}