本文整理汇总了Java中com.sun.tools.javac.code.Attribute.Constant方法的典型用法代码示例。如果您正苦于以下问题:Java Attribute.Constant方法的具体用法?Java Attribute.Constant怎么用?Java Attribute.Constant使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.sun.tools.javac.code.Attribute
的用法示例。
在下文中一共展示了Attribute.Constant方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: visitConstant
import com.sun.tools.javac.code.Attribute; //导入方法依赖的package包/类
public void visitConstant(Attribute.Constant c) {
if (c.type.hasTag(BOOLEAN)) {
// javac represents false and true as integers 0 and 1
value = Boolean.valueOf(
((Integer)c.value).intValue() != 0);
} else {
value = c.value;
}
}
示例2: visitConstant
import com.sun.tools.javac.code.Attribute; //导入方法依赖的package包/类
public void visitConstant(Attribute.Constant c) {
if (c.type.tag == TypeTags.BOOLEAN) {
// javac represents false and true as integers 0 and 1
value = Boolean.valueOf(
((Integer)c.value).intValue() != 0);
} else {
value = c.value;
}
}
示例3: visitConstant
import com.sun.tools.javac.code.Attribute; //导入方法依赖的package包/类
public void visitConstant(Attribute.Constant c) {
if (c.type.hasTag(BOOLEAN)) {
// javac represents false and true as integers 0 and 1
sb.append(((Integer)c.value).intValue() != 0);
} else {
sb.append(FieldDocImpl.constantValueExpression(c.value));
}
}
示例4: visitConstant
import com.sun.tools.javac.code.Attribute; //导入方法依赖的package包/类
public void visitConstant(Attribute.Constant c) {
value = c.getValue();
}
示例5: visitConstant
import com.sun.tools.javac.code.Attribute; //导入方法依赖的package包/类
public void visitConstant(Attribute.Constant a) {
printObject("value", a.value, Details.SUMMARY);
visitAttribute(a);
}
示例6: visitConstant
import com.sun.tools.javac.code.Attribute; //导入方法依赖的package包/类
public void visitConstant(Attribute.Constant c) {
value = Constants.decodeConstant(c.value, c.type);
}
示例7: visitByte
import com.sun.tools.javac.code.Attribute; //导入方法依赖的package包/类
@Override
public Attribute visitByte(byte b, Void p) {
TypeMirror byteType = modelTypes.getPrimitiveType(TypeKind.BYTE);
return new Attribute.Constant((Type) byteType, b);
}
示例8: visitChar
import com.sun.tools.javac.code.Attribute; //导入方法依赖的package包/类
@Override
public Attribute visitChar(char c, Void p) {
TypeMirror charType = modelTypes.getPrimitiveType(TypeKind.CHAR);
return new Attribute.Constant((Type) charType, c);
}
示例9: visitBoolean
import com.sun.tools.javac.code.Attribute; //导入方法依赖的package包/类
@Override
public Attribute visitBoolean(boolean b, Void p) {
TypeMirror booleanType = modelTypes.getPrimitiveType(TypeKind.BOOLEAN);
return new Attribute.Constant((Type)booleanType, b);
}
示例10: visitFloat
import com.sun.tools.javac.code.Attribute; //导入方法依赖的package包/类
@Override
public Attribute visitFloat(float f, Void p) {
TypeMirror floatType = modelTypes.getPrimitiveType(TypeKind.FLOAT);
return new Attribute.Constant((Type) floatType, f);
}
示例11: visitChar
import com.sun.tools.javac.code.Attribute; //导入方法依赖的package包/类
@Override
public Attribute visitChar(char c, Void p) {
TypeMirror charType = modelTypes.getPrimitiveType(TypeKind.CHAR);
return new Attribute.Constant((Type)charType, c);
}
示例12: visitDouble
import com.sun.tools.javac.code.Attribute; //导入方法依赖的package包/类
@Override
public Attribute visitDouble(double d, Void p) {
TypeMirror doubleType = modelTypes.getPrimitiveType(TypeKind.DOUBLE);
return new Attribute.Constant((Type)doubleType, d);
}
示例13: visitFloat
import com.sun.tools.javac.code.Attribute; //导入方法依赖的package包/类
@Override
public Attribute visitFloat(float f, Void p) {
TypeMirror floatType = modelTypes.getPrimitiveType(TypeKind.FLOAT);
return new Attribute.Constant((Type)floatType, f);
}
示例14: visitInt
import com.sun.tools.javac.code.Attribute; //导入方法依赖的package包/类
@Override
public Attribute visitInt(int i, Void p) {
TypeMirror intType = modelTypes.getPrimitiveType(TypeKind.INT);
return new Attribute.Constant((Type)intType, i);
}
示例15: visitLong
import com.sun.tools.javac.code.Attribute; //导入方法依赖的package包/类
@Override
public Attribute visitLong(long i, Void p) {
TypeMirror longType = modelTypes.getPrimitiveType(TypeKind.LONG);
return new Attribute.Constant((Type)longType, i);
}