com.sun.tools.javac.jvm
class: ClassWriter.AttributeWriter [javadoc |
source]
java.lang.Object
com.sun.tools.javac.jvm.ClassWriter$AttributeWriter
All Implemented Interfaces:
Visitor
A visitor to write an attribute including its leading
single-character marker.
Methods from java.lang.Object: |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method from com.sun.tools.javac.jvm.ClassWriter$AttributeWriter Detail: |
public void visitArray(Array array) {
databuf.appendByte('[');
databuf.appendChar(array.values.length);
for (Attribute a : array.values) {
a.accept(this);
}
}
|
public void visitClass(Class clazz) {
databuf.appendByte('c');
databuf.appendChar(pool.put(typeSig(clazz.type)));
}
|
public void visitCompound(Compound compound) {
databuf.appendByte('@');
writeCompoundAttribute(compound);
}
|
public void visitConstant(Constant _value) {
Object value = _value.value;
switch (_value.type.tag) {
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));
}
|
public void visitEnum(Enum e) {
databuf.appendByte('e');
databuf.appendChar(pool.put(typeSig(e.value.type)));
databuf.appendChar(pool.put(e.value.name));
}
|
public void visitError(Error x) {
throw new AssertionError(x);
}
|