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
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
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
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
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
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
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
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
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
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
@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
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
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
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
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
public void visitConstant(Attribute.Constant a) {
    printObject("value", a.value, Details.SUMMARY);
    visitAttribute(a);
}
 
Example 16
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 vote down vote up
public void visitConstant(Attribute.Constant a) {
    printObject("value", a.value, Details.SUMMARY);
    visitAttribute(a);
}
 
Example 18
public void visitConstant(Attribute.Constant value) {
    // assert value.type == type;
    result = value;
}
 
Example 19
public void visitConstant(Attribute.Constant c) {
    value = c.getValue();
}
 
Example 20
public void visitConstant(Attribute.Constant a) {
    printObject("value", a.value, Details.SUMMARY);
    visitAttribute(a);
}