Java Code Examples for com.sun.tools.javac.code.Attribute#Constant
The following examples show how to use
com.sun.tools.javac.code.Attribute#Constant .
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: TencentKona-8 File: AnnotationValueImpl.java License: GNU General Public License v2.0 | 5 votes |
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; } }
Example 2
Source Project: TencentKona-8 File: AnnotationValueImpl.java License: GNU General Public License v2.0 | 5 votes |
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)); } }
Example 3
Source Project: openjdk-8 File: AnnotationValueImpl.java License: GNU General Public License v2.0 | 5 votes |
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)); } }
Example 4
Source Project: jdk8u60 File: AnnotationValueImpl.java License: GNU General Public License v2.0 | 5 votes |
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; } }
Example 5
Source Project: jdk8u60 File: AnnotationValueImpl.java License: GNU General Public License v2.0 | 5 votes |
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)); } }
Example 6
Source Project: openjdk-8-source File: AnnotationValueImpl.java License: GNU General Public License v2.0 | 5 votes |
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; } }
Example 7
Source Project: hottub File: AnnotationValueImpl.java License: GNU General Public License v2.0 | 5 votes |
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; } }
Example 8
Source Project: openjdk-jdk8u File: AnnotationValueImpl.java License: GNU General Public License v2.0 | 5 votes |
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; } }
Example 9
Source Project: lua-for-android File: ClassWriter.java License: BSD 3-Clause "New" or "Revised" License | 5 votes |
public void visitConstant(Attribute.Constant _value) { Object value = _value.value; switch (_value.type.getTag()) { case BYTE: databuf.appendByte('B'); break; case CHAR: databuf.appendByte('C'); break; case SHORT: databuf.appendByte('S'); break; case INT: databuf.appendByte('I'); break; case LONG: databuf.appendByte('J'); break; case FLOAT: databuf.appendByte('F'); break; case DOUBLE: databuf.appendByte('D'); break; case BOOLEAN: databuf.appendByte('Z'); break; case CLASS: Assert.check(value instanceof String); databuf.appendByte('s'); value = names.fromString(value.toString()); // CONSTANT_Utf8 break; default: throw new AssertionError(_value.type); } databuf.appendChar(pool.put(value)); }
Example 10
Source Project: lua-for-android File: ClassReader.java License: BSD 3-Clause "New" or "Revised" License | 5 votes |
@Override public void run() { JavaFileObject previousClassFile = currentClassFile; try { currentClassFile = classFile; List<Attribute.Compound> newList = deproxyCompoundList(l); for (Attribute.Compound attr : newList) { if (attr.type.tsym == syms.deprecatedType.tsym) { sym.flags_field |= (DEPRECATED | DEPRECATED_ANNOTATION); Attribute forRemoval = attr.member(names.forRemoval); if (forRemoval instanceof Attribute.Constant) { Attribute.Constant c = (Attribute.Constant) forRemoval; if (c.type == syms.booleanType && ((Integer) c.value) != 0) { sym.flags_field |= DEPRECATED_REMOVAL; } } } } if (sym.annotationsPendingCompletion()) { sym.setDeclarationAttributes(newList); } else { sym.appendAttributes(newList); } } finally { currentClassFile = previousClassFile; } }
Example 11
Source Project: openjdk-8 File: AnnotationValueImpl.java License: GNU General Public License v2.0 | 5 votes |
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; } }
Example 12
Source Project: openjdk-jdk8u-backup File: AnnotationValueImpl.java License: GNU General Public License v2.0 | 5 votes |
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; } }
Example 13
Source Project: openjdk-jdk9 File: AnnotationValueImpl.java License: GNU General Public License v2.0 | 5 votes |
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)); } }
Example 14
Source Project: hottub File: AnnotationValueImpl.java License: GNU General Public License v2.0 | 5 votes |
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)); } }
Example 15
Source Project: openjdk-jdk9 File: DPrinter.java License: GNU General Public License v2.0 | 4 votes |
public void visitConstant(Attribute.Constant a) { printObject("value", a.value, Details.SUMMARY); visitAttribute(a); }
Example 16
Source Project: openjdk-jdk8u File: DPrinter.java License: GNU General Public License v2.0 | 4 votes |
public void visitConstant(Attribute.Constant a) { printObject("value", a.value, Details.SUMMARY); visitAttribute(a); }
Example 17
Source Project: hottub File: DPrinter.java License: GNU General Public License v2.0 | 4 votes |
public void visitConstant(Attribute.Constant a) { printObject("value", a.value, Details.SUMMARY); visitAttribute(a); }
Example 18
Source Project: lua-for-android File: ClassReader.java License: BSD 3-Clause "New" or "Revised" License | 4 votes |
public void visitConstant(Attribute.Constant value) { // assert value.type == type; result = value; }
Example 19
Source Project: lua-for-android File: AnnotationProxyMaker.java License: BSD 3-Clause "New" or "Revised" License | 4 votes |
public void visitConstant(Attribute.Constant c) { value = c.getValue(); }
Example 20
Source Project: openjdk-jdk8u-backup File: DPrinter.java License: GNU General Public License v2.0 | 4 votes |
public void visitConstant(Attribute.Constant a) { printObject("value", a.value, Details.SUMMARY); visitAttribute(a); }