/** * Helper for {@link #parseValue}, which parses a constant reference * and returns the referred-to constant value. * * @return {@code non-null;} the parsed value */ private Constant parseConstant() throws IOException { int constValueIndex = input.readUnsignedShort(); Constant value = (Constant) pool.get(constValueIndex); if (observer != null) { String human = (value instanceof CstString) ? ((CstString) value).toQuoted() : value.toHuman(); parsed(2, "constant_value: " + human); } return value; }
/** * Helper for {@link #parseValue}, which parses a constant reference * and returns the referred-to constant value. * * @return {@code non-null;} the parsed value */ private Constant parseConstant() throws IOException { int constValueIndex = input.readUnsignedShort(); Constant value = (Constant) pool.get(constValueIndex); if (observer != null) { String human = (value instanceof CstString) ? ((CstString) value).toQuoted() : value.toHuman(); parsed(2, "constant_value: " + human); } return value; }
/** * Helper for {@link #parseValue}, which parses a constant reference * and returns the referred-to constant value. * * @return {@code non-null;} the parsed value */ private Constant parseConstant() throws IOException { int constValueIndex = input.readUnsignedShort(); Constant value = (Constant) pool.get(constValueIndex); if (observer != null) { String human = (value instanceof CstString) ? ((CstString) value).toQuoted() : value.toHuman(); parsed(2, "constant_value: " + human); } return value; }
/** * Helper for {@link #parseValue}, which parses a constant reference * and returns the referred-to constant value. * * @return {@code non-null;} the parsed value */ private Constant parseConstant() throws IOException { int constValueIndex = input.readUnsignedShort(); Constant value = (Constant) pool.get(constValueIndex); if (observer != null) { String human = (value instanceof CstString) ? ((CstString) value).toQuoted() : value.toHuman(); parsed(2, "constant_value: " + human); } return value; }
/** * Helper for {@link #parseValue}, which parses a constant reference * and returns the referred-to constant value. * * @return {@code non-null;} the parsed value */ private Constant parseConstant() throws IOException { int constValueIndex = input.readUnsignedShort(); Constant value = (Constant) pool.get(constValueIndex); if (observer != null) { String human = (value instanceof CstString) ? ((CstString) value).toQuoted() : value.toHuman(); parsed(2, "constant_value: " + human); } return value; }
/** * Helper for {@link #parseValue}, which parses a constant reference * and returns the referred-to constant value. * * @return {@code non-null;} the parsed value */ private Constant parseConstant() throws IOException { int constValueIndex = input.readUnsignedShort(); Constant value = (Constant) pool.get(constValueIndex); if (observer != null) { String human = (value instanceof CstUtf8) ? ((CstUtf8) value).toQuoted() : value.toHuman(); parsed(2, "constant_value: " + human); } return value; }
/** * Parses a {@code SourceFile} attribute. */ private Attribute sourceFile(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length != 2) { throwBadLength(2); } ByteArray bytes = cf.getBytes(); ConstantPool pool = cf.getConstantPool(); int idx = bytes.getUnsignedShort(offset); CstString cst = (CstString) pool.get(idx); Attribute result = new AttSourceFile(cst); if (observer != null) { observer.parsed(bytes, offset, 2, "source: " + cst); } return result; }
/** * Parses a {@code ConstantValue} attribute. */ private Attribute constantValue(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length != 2) { return throwBadLength(2); } ByteArray bytes = cf.getBytes(); ConstantPool pool = cf.getConstantPool(); int idx = bytes.getUnsignedShort(offset); TypedConstant cst = (TypedConstant) pool.get(idx); Attribute result = new AttConstantValue(cst); if (observer != null) { observer.parsed(bytes, offset, 2, "value: " + cst); } return result; }
/** * Parses a {@code ConstantValue} attribute. */ private Attribute constantValue(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length != 2) { return throwBadLength(2); } ByteArray bytes = cf.getBytes(); ConstantPool pool = cf.getConstantPool(); int idx = bytes.getUnsignedShort(offset); TypedConstant cst = (TypedConstant) pool.get(idx); Attribute result = new AttConstantValue(cst); if (observer != null) { observer.parsed(bytes, offset, 2, "value: " + cst); } return result; }
/** * Parses a {@code Signature} attribute. */ private Attribute signature(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length != 2) { throwBadLength(2); } ByteArray bytes = cf.getBytes(); ConstantPool pool = cf.getConstantPool(); int idx = bytes.getUnsignedShort(offset); CstString cst = (CstString) pool.get(idx); Attribute result = new AttSignature(cst); if (observer != null) { observer.parsed(bytes, offset, 2, "signature: " + cst); } return result; }
/** * Parses a {@code Signature} attribute. */ private Attribute signature(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length != 2) { throwBadLength(2); } ByteArray bytes = cf.getBytes(); ConstantPool pool = cf.getConstantPool(); int idx = bytes.getUnsignedShort(offset); CstUtf8 cst = (CstUtf8) pool.get(idx); Attribute result = new AttSignature(cst); if (observer != null) { observer.parsed(bytes, offset, 2, "signature: " + cst); } return result; }
/** * Parses a {@code ConstantValue} attribute. */ private Attribute constantValue(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length != 2) { return throwBadLength(2); } ByteArray bytes = cf.getBytes(); ConstantPool pool = cf.getConstantPool(); int idx = bytes.getUnsignedShort(offset); TypedConstant cst = (TypedConstant) pool.get(idx); Attribute result = new AttConstantValue(cst); if (observer != null) { observer.parsed(bytes, offset, 2, "value: " + cst); } return result; }
/** * Parses a {@code Signature} attribute. */ private Attribute signature(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length != 2) { throwBadLength(2); } ByteArray bytes = cf.getBytes(); ConstantPool pool = cf.getConstantPool(); int idx = bytes.getUnsignedShort(offset); CstString cst = (CstString) pool.get(idx); Attribute result = new AttSignature(cst); if (observer != null) { observer.parsed(bytes, offset, 2, "signature: " + cst); } return result; }
/** * Parses a {@code SourceFile} attribute. */ private Attribute sourceFile(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length != 2) { throwBadLength(2); } ByteArray bytes = cf.getBytes(); ConstantPool pool = cf.getConstantPool(); int idx = bytes.getUnsignedShort(offset); CstString cst = (CstString) pool.get(idx); Attribute result = new AttSourceFile(cst); if (observer != null) { observer.parsed(bytes, offset, 2, "source: " + cst); } return result; }
/** * Parses a {@code SourceFile} attribute. */ private Attribute sourceFile(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length != 2) { throwBadLength(2); } ByteArray bytes = cf.getBytes(); ConstantPool pool = cf.getConstantPool(); int idx = bytes.getUnsignedShort(offset); CstString cst = (CstString) pool.get(idx); Attribute result = new AttSourceFile(cst); if (observer != null) { observer.parsed(bytes, offset, 2, "source: " + cst); } return result; }
/** * Parses a {@code Signature} attribute. */ private Attribute signature(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length != 2) { throwBadLength(2); } ByteArray bytes = cf.getBytes(); ConstantPool pool = cf.getConstantPool(); int idx = bytes.getUnsignedShort(offset); CstString cst = (CstString) pool.get(idx); Attribute result = new AttSignature(cst); if (observer != null) { observer.parsed(bytes, offset, 2, "signature: " + cst); } return result; }
/** * Parses a {@code SourceFile} attribute. */ private Attribute sourceFile(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length != 2) { throwBadLength(2); } ByteArray bytes = cf.getBytes(); ConstantPool pool = cf.getConstantPool(); int idx = bytes.getUnsignedShort(offset); CstString cst = (CstString) pool.get(idx); Attribute result = new AttSourceFile(cst); if (observer != null) { observer.parsed(bytes, offset, 2, "source: " + cst); } return result; }
/** * Parses a {@code SourceFile} attribute. */ private Attribute sourceFile(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length != 2) { throwBadLength(2); } ByteArray bytes = cf.getBytes(); ConstantPool pool = cf.getConstantPool(); int idx = bytes.getUnsignedShort(offset); CstString cst = (CstString) pool.get(idx); Attribute result = new AttSourceFile(cst); if (observer != null) { observer.parsed(bytes, offset, 2, "source: " + cst); } return result; }
/** * Parses a {@code Signature} attribute. */ private Attribute signature(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length != 2) { throwBadLength(2); } ByteArray bytes = cf.getBytes(); ConstantPool pool = cf.getConstantPool(); int idx = bytes.getUnsignedShort(offset); CstString cst = (CstString) pool.get(idx); Attribute result = new AttSignature(cst); if (observer != null) { observer.parsed(bytes, offset, 2, "signature: " + cst); } return result; }
/** * Parses a {@code ConstantValue} attribute. */ private Attribute constantValue(DirectClassFile cf, int offset, int length, ParseObserver observer) { if (length != 2) { return throwBadLength(2); } ByteArray bytes = cf.getBytes(); ConstantPool pool = cf.getConstantPool(); int idx = bytes.getUnsignedShort(offset); TypedConstant cst = (TypedConstant) pool.get(idx); Attribute result = new AttConstantValue(cst); if (observer != null) { observer.parsed(bytes, offset, 2, "value: " + cst); } return result; }