/** * Gets the {@code Signature} attribute out of a given * {@link AttributeList}, if any, translating it to an annotation. * * @param attribs {@code non-null;} the attributes list to search in * @return {@code null-ok;} the converted {@code Signature} annotation, * if there was an attribute to translate */ private static Annotation getSignature(AttributeList attribs) { AttSignature signature = (AttSignature) attribs.findFirst(AttSignature.ATTRIBUTE_NAME); if (signature == null) { return null; } return AnnotationUtils.makeSignature(signature.getSignature()); }
/** * 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; }
/** * Gets the {@code Signature} attribute out of a given * {@link AttributeList}, if any, translating it to an annotation. * * @param attribs {@code non-null;} the attributes list to search in * @return {@code null-ok;} the converted {@code Signature} annotation, * if there was an attribute to translate */ private static Annotation getSignature(AttributeList attribs) { AttSignature signature = (AttSignature) attribs.findFirst(AttSignature.ATTRIBUTE_NAME); if (signature == null) { return null; } return AnnotationUtils.makeSignature(signature.getSignature()); }
/** * 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; }
/** * Gets the {@code Signature} attribute out of a given * {@link AttributeList}, if any, translating it to an annotation. * * @param attribs {@code non-null;} the attributes list to search in * @return {@code null-ok;} the converted {@code Signature} annotation, * if there was an attribute to translate */ private static Annotation getSignature(AttributeList attribs) { AttSignature signature = (AttSignature) attribs.findFirst(AttSignature.ATTRIBUTE_NAME); if (signature == null) { return null; } return AnnotationUtils.makeSignature(signature.getSignature()); }
/** * 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; }
/** * Gets the {@code Signature} attribute out of a given * {@link AttributeList}, if any, translating it to an annotation. * * @param attribs {@code non-null;} the attributes list to search in * @return {@code null-ok;} the converted {@code Signature} annotation, * if there was an attribute to translate */ private static Annotation getSignature(AttributeList attribs) { AttSignature signature = (AttSignature) attribs.findFirst(AttSignature.ATTRIBUTE_NAME); if (signature == null) { return null; } return AnnotationUtils.makeSignature(signature.getSignature()); }
/** * 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; }
/** * Gets the {@code Signature} attribute out of a given * {@link AttributeList}, if any, translating it to an annotation. * * @param attribs {@code non-null;} the attributes list to search in * @return {@code null-ok;} the converted {@code Signature} annotation, * if there was an attribute to translate */ private static Annotation getSignature(AttributeList attribs) { AttSignature signature = (AttSignature) attribs.findFirst(AttSignature.ATTRIBUTE_NAME); if (signature == null) { return null; } return AnnotationUtils.makeSignature(signature.getSignature()); }
/** * 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; }
/** * Gets the {@code Signature} attribute out of a given * {@link AttributeList}, if any, translating it to an annotation. * * @param attribs {@code non-null;} the attributes list to search in * @return {@code null-ok;} the converted {@code Signature} annotation, * if there was an attribute to translate */ private static Annotation getSignature(AttributeList attribs) { AttSignature signature = (AttSignature) attribs.findFirst(AttSignature.ATTRIBUTE_NAME); if (signature == null) { return null; } return AnnotationUtils.makeSignature(signature.getSignature()); }
classElement.setAttribute("signature", signatureAnnotation.getSignature().toHuman());