/** {@inheritDoc} */ public TypedConstant getConstantValue() { AttributeList attribs = getAttributes(); AttConstantValue cval = (AttConstantValue) attribs.findFirst(AttConstantValue.ATTRIBUTE_NAME); if (cval == null) { return null; } return cval.getConstantValue(); } }
/** * 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; }
/** {@inheritDoc} */ @Override public TypedConstant getConstantValue() { AttributeList attribs = getAttributes(); AttConstantValue cval = (AttConstantValue) attribs.findFirst(AttConstantValue.ATTRIBUTE_NAME); if (cval == null) { return null; } return cval.getConstantValue(); } }
/** * 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; }
/** {@inheritDoc} */ @Override public TypedConstant getConstantValue() { AttributeList attribs = getAttributes(); AttConstantValue cval = (AttConstantValue) attribs.findFirst(AttConstantValue.ATTRIBUTE_NAME); if (cval == null) { return null; } return cval.getConstantValue(); } }
/** * 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; }
/** {@inheritDoc} */ public TypedConstant getConstantValue() { AttributeList attribs = getAttributes(); AttConstantValue cval = (AttConstantValue) attribs.findFirst(AttConstantValue.ATTRIBUTE_NAME); if (cval == null) { return null; } return cval.getConstantValue(); } }
/** * 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; }
/** {@inheritDoc} */ public TypedConstant getConstantValue() { AttributeList attribs = getAttributes(); AttConstantValue cval = (AttConstantValue) attribs.findFirst(AttConstantValue.ATTRIBUTE_NAME); if (cval == null) { return null; } return cval.getConstantValue(); } }
/** * 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; }
/** {@inheritDoc} */ public TypedConstant getConstantValue() { AttributeList attribs = getAttributes(); AttConstantValue cval = (AttConstantValue) attribs.findFirst(AttConstantValue.ATTRIBUTE_NAME); if (cval == null) { return null; } return cval.getConstantValue(); } }