本文整理汇总了Java中org.eclipse.jdt.internal.compiler.lookup.TypeIds.T_boolean方法的典型用法代码示例。如果您正苦于以下问题:Java TypeIds.T_boolean方法的具体用法?Java TypeIds.T_boolean怎么用?Java TypeIds.T_boolean使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.eclipse.jdt.internal.compiler.lookup.TypeIds
的用法示例。
在下文中一共展示了TypeIds.T_boolean方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: getKind
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
public static TypeKind getKind(BaseTypeBinding binding) {
switch (binding.id) {
case TypeIds.T_boolean:
return TypeKind.BOOLEAN;
case TypeIds.T_byte:
return TypeKind.BYTE;
case TypeIds.T_char:
return TypeKind.CHAR;
case TypeIds.T_double:
return TypeKind.DOUBLE;
case TypeIds.T_float:
return TypeKind.FLOAT;
case TypeIds.T_int:
return TypeKind.INT;
case TypeIds.T_long:
return TypeKind.LONG;
case TypeIds.T_short:
return TypeKind.SHORT;
default:
throw new IllegalArgumentException("BaseTypeBinding of unexpected id " + binding.id); //$NON-NLS-1$
}
}
示例2: getConstantValue
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
public Object getConstantValue() {
Constant c = this.binding.constant();
if (c == null || c == Constant.NotAConstant) return null;
switch (c.typeID()) {
case TypeIds.T_boolean:
return Boolean.valueOf(c.booleanValue());
case TypeIds.T_byte:
return new Byte(c.byteValue());
case TypeIds.T_char:
return new Character(c.charValue());
case TypeIds.T_double:
return new Double(c.doubleValue());
case TypeIds.T_float:
return new Float(c.floatValue());
case TypeIds.T_int:
return new Integer(c.intValue());
case TypeIds.T_long:
return new Long(c.longValue());
case TypeIds.T_short:
return new Short(c.shortValue());
case TypeIds.T_JavaLangString:
return c.stringValue();
}
return null;
}
示例3: unannotated
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
public TypeBinding unannotated() {
if (!this.hasTypeAnnotations())
return this;
switch (this.id) {
case TypeIds.T_boolean:
return TypeBinding.BOOLEAN;
case TypeIds.T_byte:
return TypeBinding.BYTE;
case TypeIds.T_char:
return TypeBinding.CHAR;
case TypeIds.T_double:
return TypeBinding.DOUBLE;
case TypeIds.T_float:
return TypeBinding.FLOAT;
case TypeIds.T_int:
return TypeBinding.INT;
case TypeIds.T_long:
return TypeBinding.LONG;
case TypeIds.T_short:
return TypeBinding.SHORT;
default:
throw new IllegalStateException();
}
}
示例4: resolveConstantExpressionValue
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
Object resolveConstantExpressionValue(Expression expression) {
org.eclipse.jdt.internal.compiler.ast.ASTNode node = (org.eclipse.jdt.internal.compiler.ast.ASTNode) this.newAstToOldAst.get(expression);
if (node instanceof org.eclipse.jdt.internal.compiler.ast.Expression) {
org.eclipse.jdt.internal.compiler.ast.Expression compilerExpression = (org.eclipse.jdt.internal.compiler.ast.Expression) node;
Constant constant = compilerExpression.constant;
if (constant != null && constant != Constant.NotAConstant) {
switch (constant.typeID()) {
case TypeIds.T_int : return new Integer(constant.intValue());
case TypeIds.T_byte : return new Byte(constant.byteValue());
case TypeIds.T_short : return new Short(constant.shortValue());
case TypeIds.T_char : return new Character(constant.charValue());
case TypeIds.T_float : return new Float(constant.floatValue());
case TypeIds.T_double : return new Double(constant.doubleValue());
case TypeIds.T_boolean : return constant.booleanValue() ? Boolean.TRUE : Boolean.FALSE;
case TypeIds.T_long : return new Long(constant.longValue());
case TypeIds.T_JavaLangString : return constant.stringValue();
}
return null;
}
}
return null;
}
开发者ID:trylimits,项目名称:Eclipse-Postfix-Code-Completion-Juno38,代码行数:23,代码来源:DefaultBindingResolver.java
示例5: calculateValue
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
/**
* Returns the actual value of the given Literal or Literal-like node.
*/
public static Object calculateValue(Expression e) {
if (e instanceof Literal) {
((Literal)e).computeConstant();
switch (e.constant.typeID()) {
case TypeIds.T_int: return e.constant.intValue();
case TypeIds.T_byte: return e.constant.byteValue();
case TypeIds.T_short: return e.constant.shortValue();
case TypeIds.T_char: return e.constant.charValue();
case TypeIds.T_float: return e.constant.floatValue();
case TypeIds.T_double: return e.constant.doubleValue();
case TypeIds.T_boolean: return e.constant.booleanValue();
case TypeIds.T_long: return e.constant.longValue();
case TypeIds.T_JavaLangString: return e.constant.stringValue();
default: return null;
}
} else if (e instanceof ClassLiteralAccess) {
return Eclipse.toQualifiedName(((ClassLiteralAccess)e).type.getTypeName());
} else if (e instanceof SingleNameReference) {
return new String(((SingleNameReference)e).token);
} else if (e instanceof QualifiedNameReference) {
String qName = Eclipse.toQualifiedName(((QualifiedNameReference)e).tokens);
int idx = qName.lastIndexOf('.');
return idx == -1 ? qName : qName.substring(idx+1);
}
return null;
}
示例6: getAnnotationMemberValue
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
public static Object getAnnotationMemberValue(
MemberValuePair memberValuePair, Constant constant) {
if (constant == null) {
memberValuePair.valueKind = IMemberValuePair.K_UNKNOWN;
return null;
}
switch (constant.typeID()) {
case TypeIds.T_int:
memberValuePair.valueKind = IMemberValuePair.K_INT;
return new Integer(constant.intValue());
case TypeIds.T_byte:
memberValuePair.valueKind = IMemberValuePair.K_BYTE;
return new Byte(constant.byteValue());
case TypeIds.T_short:
memberValuePair.valueKind = IMemberValuePair.K_SHORT;
return new Short(constant.shortValue());
case TypeIds.T_char:
memberValuePair.valueKind = IMemberValuePair.K_CHAR;
return new Character(constant.charValue());
case TypeIds.T_float:
memberValuePair.valueKind = IMemberValuePair.K_FLOAT;
return new Float(constant.floatValue());
case TypeIds.T_double:
memberValuePair.valueKind = IMemberValuePair.K_DOUBLE;
return new Double(constant.doubleValue());
case TypeIds.T_boolean:
memberValuePair.valueKind = IMemberValuePair.K_BOOLEAN;
return Boolean.valueOf(constant.booleanValue());
case TypeIds.T_long:
memberValuePair.valueKind = IMemberValuePair.K_LONG;
return new Long(constant.longValue());
case TypeIds.T_JavaLangString:
memberValuePair.valueKind = IMemberValuePair.K_STRING;
return constant.stringValue();
default:
memberValuePair.valueKind = IMemberValuePair.K_UNKNOWN;
return null;
}
}
示例7: accept
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
@SuppressWarnings("unchecked") // Need to cast Object _value to a List<AnnotationValue>
@Override
public <R, P> R accept(AnnotationValueVisitor<R, P> v, P p) {
switch (_kind) {
case TypeIds.T_boolean:
return v.visitBoolean((Boolean)_value, p);
case TypeIds.T_byte:
return v.visitByte((Byte)_value, p);
case TypeIds.T_char:
return v.visitChar((Character)_value, p);
case TypeIds.T_double:
return v.visitDouble((Double)_value, p);
case TypeIds.T_float:
return v.visitFloat((Float)_value, p);
case TypeIds.T_int:
return v.visitInt((Integer)_value, p);
case TypeIds.T_JavaLangString:
return v.visitString((String)_value, p);
case TypeIds.T_long:
return v.visitLong((Long)_value, p);
case TypeIds.T_short:
return v.visitShort((Short)_value, p);
case T_EnumConstant:
return v.visitEnumConstant((VariableElement)_value, p);
case T_ClassObject:
return v.visitType((TypeMirror)_value, p);
case T_AnnotationMirror:
return v.visitAnnotation((AnnotationMirror)_value, p);
case T_ArrayType:
return v.visitArray((List<AnnotationValue>)_value, p);
default:
return null;
}
}
示例8: getAnnotationMemberValue
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
public static Object getAnnotationMemberValue(MemberValuePair memberValuePair, Constant constant) {
if (constant == null) {
memberValuePair.valueKind = IMemberValuePair.K_UNKNOWN;
return null;
}
switch (constant.typeID()) {
case TypeIds.T_int :
memberValuePair.valueKind = IMemberValuePair.K_INT;
return new Integer(constant.intValue());
case TypeIds.T_byte :
memberValuePair.valueKind = IMemberValuePair.K_BYTE;
return new Byte(constant.byteValue());
case TypeIds.T_short :
memberValuePair.valueKind = IMemberValuePair.K_SHORT;
return new Short(constant.shortValue());
case TypeIds.T_char :
memberValuePair.valueKind = IMemberValuePair.K_CHAR;
return new Character(constant.charValue());
case TypeIds.T_float :
memberValuePair.valueKind = IMemberValuePair.K_FLOAT;
return new Float(constant.floatValue());
case TypeIds.T_double :
memberValuePair.valueKind = IMemberValuePair.K_DOUBLE;
return new Double(constant.doubleValue());
case TypeIds.T_boolean :
memberValuePair.valueKind = IMemberValuePair.K_BOOLEAN;
return Boolean.valueOf(constant.booleanValue());
case TypeIds.T_long :
memberValuePair.valueKind = IMemberValuePair.K_LONG;
return new Long(constant.longValue());
case TypeIds.T_JavaLangString :
memberValuePair.valueKind = IMemberValuePair.K_STRING;
return constant.stringValue();
default:
memberValuePair.valueKind = IMemberValuePair.K_UNKNOWN;
return null;
}
}
示例9: convertConstant
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
/**
* Converts a field constant from the compiler's representation
* to the Java Model constant representation (Number or String).
*/
protected static Object convertConstant(Constant constant) {
if (constant == null)
return null;
if (constant == Constant.NotAConstant) {
return null;
}
switch (constant.typeID()) {
case TypeIds.T_boolean :
return constant.booleanValue() ? Boolean.TRUE : Boolean.FALSE;
case TypeIds.T_byte :
return new Byte(constant.byteValue());
case TypeIds.T_char :
return new Character(constant.charValue());
case TypeIds.T_double :
return new Double(constant.doubleValue());
case TypeIds.T_float :
return new Float(constant.floatValue());
case TypeIds.T_int :
return new Integer(constant.intValue());
case TypeIds.T_long :
return new Long(constant.longValue());
case TypeIds.T_short :
return new Short(constant.shortValue());
case TypeIds.T_JavaLangString :
return constant.stringValue();
default :
return null;
}
}
示例10: getWrappedConstantValue
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
/**
* Return a wrapper that contains the constant of the field.
* @return java.lang.Object
*/
public Object getWrappedConstantValue() {
if (this.wrappedConstantValue == null) {
if (hasConstant()) {
Constant fieldConstant = getConstant();
switch (fieldConstant.typeID()) {
case TypeIds.T_int :
this.wrappedConstantValue = new Integer(fieldConstant.intValue());
break;
case TypeIds.T_byte :
this.wrappedConstantValue = new Byte(fieldConstant.byteValue());
break;
case TypeIds.T_short :
this.wrappedConstantValue = new Short(fieldConstant.shortValue());
break;
case TypeIds.T_char :
this.wrappedConstantValue = new Character(fieldConstant.charValue());
break;
case TypeIds.T_float :
this.wrappedConstantValue = new Float(fieldConstant.floatValue());
break;
case TypeIds.T_double :
this.wrappedConstantValue = new Double(fieldConstant.doubleValue());
break;
case TypeIds.T_boolean :
this.wrappedConstantValue = Util.toBoolean(fieldConstant.booleanValue());
break;
case TypeIds.T_long :
this.wrappedConstantValue = new Long(fieldConstant.longValue());
break;
case TypeIds.T_JavaLangString :
this.wrappedConstantValue = fieldConstant.stringValue();
}
}
}
return this.wrappedConstantValue;
}
示例11: hasSameValue
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
/**
* Returns true if both constants have the same type and the same actual value
* @param otherConstant
*/
public boolean hasSameValue(Constant otherConstant) {
if (this == otherConstant)
return true;
int typeID;
if ((typeID = typeID()) != otherConstant.typeID())
return false;
switch (typeID) {
case TypeIds.T_boolean:
return booleanValue() == otherConstant.booleanValue();
case TypeIds.T_byte:
return byteValue() == otherConstant.byteValue();
case TypeIds.T_char:
return charValue() == otherConstant.charValue();
case TypeIds.T_double:
return doubleValue() == otherConstant.doubleValue();
case TypeIds.T_float:
return floatValue() == otherConstant.floatValue();
case TypeIds.T_int:
return intValue() == otherConstant.intValue();
case TypeIds.T_short:
return shortValue() == otherConstant.shortValue();
case TypeIds.T_long:
return longValue() == otherConstant.longValue();
case TypeIds.T_JavaLangString:
String value = stringValue();
return value == null
? otherConstant.stringValue() == null
: value.equals(otherConstant.stringValue());
}
return false;
}
示例12: VerificationTypeInfo
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
public VerificationTypeInfo(TypeBinding binding) {
this.id = binding.id;
switch(binding.id) {
case TypeIds.T_boolean :
case TypeIds.T_byte :
case TypeIds.T_char :
case TypeIds.T_int :
case TypeIds.T_short :
this.tag = VerificationTypeInfo.ITEM_INTEGER;
break;
case TypeIds.T_float :
this.tag = VerificationTypeInfo.ITEM_FLOAT;
break;
case TypeIds.T_long :
this.tag = VerificationTypeInfo.ITEM_LONG;
break;
case TypeIds.T_double :
this.tag = VerificationTypeInfo.ITEM_DOUBLE;
break;
case TypeIds.T_null :
this.tag = VerificationTypeInfo.ITEM_NULL;
break;
default:
this.tag = VerificationTypeInfo.ITEM_OBJECT;
this.constantPoolName = binding.constantPoolName();
}
}
示例13: buildDOMValue
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
static Object buildDOMValue(final Object internalObject, BindingResolver resolver) {
if (internalObject == null)
return null;
if (internalObject instanceof Constant) {
Constant constant = (Constant) internalObject;
switch (constant.typeID()) {
case TypeIds.T_boolean:
return Boolean.valueOf(constant.booleanValue());
case TypeIds.T_byte:
return new Byte(constant.byteValue());
case TypeIds.T_char:
return new Character(constant.charValue());
case TypeIds.T_double:
return new Double(constant.doubleValue());
case TypeIds.T_float:
return new Float(constant.floatValue());
case TypeIds.T_int:
return new Integer(constant.intValue());
case TypeIds.T_long:
return new Long(constant.longValue());
case TypeIds.T_short:
return new Short(constant.shortValue());
default:
// TypeIds.T_JavaLangString:
return constant.stringValue();
}
} else if (internalObject instanceof org.eclipse.jdt.internal.compiler.lookup.TypeBinding) {
return resolver.getTypeBinding((org.eclipse.jdt.internal.compiler.lookup.TypeBinding) internalObject);
} else if (internalObject instanceof org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding) {
return resolver.getAnnotationInstance((org.eclipse.jdt.internal.compiler.lookup.AnnotationBinding) internalObject);
} else if (internalObject instanceof org.eclipse.jdt.internal.compiler.lookup.FieldBinding) {
return resolver.getVariableBinding((org.eclipse.jdt.internal.compiler.lookup.FieldBinding) internalObject);
} else if (internalObject instanceof Object[]) {
Object[] elements = (Object[]) internalObject;
int length = elements.length;
Object[] values = length == 0 ? EmptyArray : new Object[length];
for (int i = 0; i < length; i++)
values[i] = buildDOMValue(elements[i], resolver);
return values;
}
return null;
}
示例14: hasStructuralFieldChanges
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
private boolean hasStructuralFieldChanges(FieldInfo currentFieldInfo, FieldInfo otherFieldInfo) {
// generic signature
if (!CharOperation.equals(currentFieldInfo.getGenericSignature(), otherFieldInfo.getGenericSignature()))
return true;
if (currentFieldInfo.getModifiers() != otherFieldInfo.getModifiers())
return true;
if ((currentFieldInfo.getTagBits() & TagBits.AnnotationDeprecated) != (otherFieldInfo.getTagBits() & TagBits.AnnotationDeprecated))
return true;
if (hasStructuralAnnotationChanges(currentFieldInfo.getAnnotations(), otherFieldInfo.getAnnotations()))
return true;
if (!CharOperation.equals(currentFieldInfo.getName(), otherFieldInfo.getName()))
return true;
if (!CharOperation.equals(currentFieldInfo.getTypeName(), otherFieldInfo.getTypeName()))
return true;
if (currentFieldInfo.hasConstant() != otherFieldInfo.hasConstant())
return true;
if (currentFieldInfo.hasConstant()) {
Constant currentConstant = currentFieldInfo.getConstant();
Constant otherConstant = otherFieldInfo.getConstant();
if (currentConstant.typeID() != otherConstant.typeID())
return true;
if (!currentConstant.getClass().equals(otherConstant.getClass()))
return true;
switch (currentConstant.typeID()) {
case TypeIds.T_int :
return currentConstant.intValue() != otherConstant.intValue();
case TypeIds.T_byte :
return currentConstant.byteValue() != otherConstant.byteValue();
case TypeIds.T_short :
return currentConstant.shortValue() != otherConstant.shortValue();
case TypeIds.T_char :
return currentConstant.charValue() != otherConstant.charValue();
case TypeIds.T_long :
return currentConstant.longValue() != otherConstant.longValue();
case TypeIds.T_float :
return currentConstant.floatValue() != otherConstant.floatValue();
case TypeIds.T_double :
return currentConstant.doubleValue() != otherConstant.doubleValue();
case TypeIds.T_boolean :
return currentConstant.booleanValue() != otherConstant.booleanValue();
case TypeIds.T_JavaLangString :
return !currentConstant.stringValue().equals(otherConstant.stringValue());
}
}
return false;
}
示例15: baseTypeReference
import org.eclipse.jdt.internal.compiler.lookup.TypeIds; //导入方法依赖的package包/类
public static final TypeReference baseTypeReference(int baseType, int dim, Annotation [][] dimAnnotations) {
if (dim == 0) {
switch (baseType) {
case (TypeIds.T_void) :
return new SingleTypeReference(TypeBinding.VOID.simpleName, 0);
case (TypeIds.T_boolean) :
return new SingleTypeReference(TypeBinding.BOOLEAN.simpleName, 0);
case (TypeIds.T_char) :
return new SingleTypeReference(TypeBinding.CHAR.simpleName, 0);
case (TypeIds.T_float) :
return new SingleTypeReference(TypeBinding.FLOAT.simpleName, 0);
case (TypeIds.T_double) :
return new SingleTypeReference(TypeBinding.DOUBLE.simpleName, 0);
case (TypeIds.T_byte) :
return new SingleTypeReference(TypeBinding.BYTE.simpleName, 0);
case (TypeIds.T_short) :
return new SingleTypeReference(TypeBinding.SHORT.simpleName, 0);
case (TypeIds.T_int) :
return new SingleTypeReference(TypeBinding.INT.simpleName, 0);
default : //T_long
return new SingleTypeReference(TypeBinding.LONG.simpleName, 0);
}
}
switch (baseType) {
case (TypeIds.T_void) :
return new ArrayTypeReference(TypeBinding.VOID.simpleName, dim, dimAnnotations, 0);
case (TypeIds.T_boolean) :
return new ArrayTypeReference(TypeBinding.BOOLEAN.simpleName, dim, dimAnnotations, 0);
case (TypeIds.T_char) :
return new ArrayTypeReference(TypeBinding.CHAR.simpleName, dim, dimAnnotations, 0);
case (TypeIds.T_float) :
return new ArrayTypeReference(TypeBinding.FLOAT.simpleName, dim, dimAnnotations, 0);
case (TypeIds.T_double) :
return new ArrayTypeReference(TypeBinding.DOUBLE.simpleName, dim, dimAnnotations, 0);
case (TypeIds.T_byte) :
return new ArrayTypeReference(TypeBinding.BYTE.simpleName, dim, dimAnnotations, 0);
case (TypeIds.T_short) :
return new ArrayTypeReference(TypeBinding.SHORT.simpleName, dim, dimAnnotations, 0);
case (TypeIds.T_int) :
return new ArrayTypeReference(TypeBinding.INT.simpleName, dim, dimAnnotations, 0);
default : //T_long
return new ArrayTypeReference(TypeBinding.LONG.simpleName, dim, dimAnnotations, 0);
}
}