public static SourceAttribute create(final String name) { return new SourceAttribute(VerifyArgument.notNull(name, "name"), 0); }
MethodInfo(final int accessFlags, final String name, final String descriptor, final SourceAttribute[] attributes) { this.accessFlags = accessFlags; this.name = name; this.descriptor = descriptor; this.attributes = attributes; this.codeAttribute = SourceAttribute.find(AttributeNames.Code, attributes); } }
protected final SourceAttribute inflateAttribute(final Buffer buffer, final SourceAttribute attribute) { if (attribute instanceof BlobAttribute) { buffer.reset(attribute.getLength()); final BlobAttribute blobAttribute = (BlobAttribute) attribute; System.arraycopy( blobAttribute.getData(), 0, buffer.array(), 0, attribute.getLength() ); return readAttributeCore( attribute.getName(), buffer, blobAttribute.getDataOffset(), attribute.getLength() ); } return attribute; }
@SuppressWarnings("unchecked") public static <T extends SourceAttribute> T find(final String name, final List<SourceAttribute> attributes) { VerifyArgument.notNull(name, "name"); VerifyArgument.noNullElements(attributes, "attributes"); for (final SourceAttribute attribute : attributes) { if (name.equals(attribute.getName())) { return (T) attribute; } } return null; }
return SourceAttribute.create(name); final SourceAttribute[] attributes = new SourceAttribute[attributeCount]; readAttributes(resolver, scope, buffer, attributes);
public static void readAttributes(final IMetadataResolver resolver, final IMetadataScope scope, final Buffer input, final SourceAttribute[] attributes) { for (int i = 0; i < attributes.length; i++) { attributes[i] = readAttribute(resolver, scope, input); } }
protected void inflateAttributes(final SourceAttribute[] attributes) { VerifyArgument.noNullElements(attributes, "attributes"); if (attributes.length == 0) { return; } Buffer buffer = null; for (int i = 0; i < attributes.length; i++) { final SourceAttribute attribute = attributes[i]; if (attribute instanceof BlobAttribute) { if (buffer == null) { buffer = new Buffer(attribute.getLength()); } attributes[i] = inflateAttribute(buffer, attribute); } } }
return SourceAttribute.create(name);
@SuppressWarnings("unchecked") public static <T extends SourceAttribute> T find(final String name, final SourceAttribute... attributes) { VerifyArgument.notNull(name, "name"); VerifyArgument.noNullElements(attributes, "attributes"); for (final SourceAttribute attribute : attributes) { if (name.equals(attribute.getName())) { return (T) attribute; } } return null; }
return SourceAttribute.create(name); final SourceAttribute[] attributes = new SourceAttribute[attributeCount]; readAttributes(resolver, scope, buffer, attributes);
public static void readAttributes(final IMetadataResolver resolver, final IMetadataScope scope, final Buffer input, final SourceAttribute[] attributes) { for (int i = 0; i < attributes.length; i++) { attributes[i] = readAttribute(resolver, scope, input); } }
protected void inflateAttributes(final SourceAttribute[] attributes) { VerifyArgument.noNullElements(attributes, "attributes"); if (attributes.length == 0) { return; } Buffer buffer = null; for (int i = 0; i < attributes.length; i++) { final SourceAttribute attribute = attributes[i]; if (attribute instanceof BlobAttribute) { if (buffer == null) { buffer = new Buffer(attribute.getLength()); } attributes[i] = inflateAttribute(buffer, attribute); } } }
return SourceAttribute.create(name);
MethodInfo(final int accessFlags, final String name, final String descriptor, final SourceAttribute[] attributes) { this.accessFlags = accessFlags; this.name = name; this.descriptor = descriptor; this.attributes = attributes; this.codeAttribute = SourceAttribute.find(AttributeNames.Code, attributes); } }
protected final SourceAttribute inflateAttribute(final Buffer buffer, final SourceAttribute attribute) { if (attribute instanceof BlobAttribute) { buffer.reset(attribute.getLength()); final BlobAttribute blobAttribute = (BlobAttribute) attribute; System.arraycopy( blobAttribute.getData(), 0, buffer.array(), 0, attribute.getLength() ); return readAttributeCore( attribute.getName(), buffer, blobAttribute.getDataOffset(), attribute.getLength() ); } return attribute; }
@SuppressWarnings("unchecked") public static <T extends SourceAttribute> T find(final String name, final List<SourceAttribute> attributes) { VerifyArgument.notNull(name, "name"); VerifyArgument.noNullElements(attributes, "attributes"); for (final SourceAttribute attribute : attributes) { if (name.equals(attribute.getName())) { return (T) attribute; } } return null; }
return SourceAttribute.create(name); final SourceAttribute[] attributes = new SourceAttribute[attributeCount]; readAttributes(resolver, scope, buffer, attributes);
public static void readAttributes(final IMetadataResolver resolver, final IMetadataScope scope, final Buffer input, final SourceAttribute[] attributes) { for (int i = 0; i < attributes.length; i++) { attributes[i] = readAttribute(resolver, scope, input); } }
public static SourceAttribute create(final String name) { return new SourceAttribute(VerifyArgument.notNull(name, "name"), 0); }
protected void inflateAttributes(final SourceAttribute[] attributes) { VerifyArgument.noNullElements(attributes, "attributes"); if (attributes.length == 0) { return; } Buffer buffer = null; for (int i = 0; i < attributes.length; i++) { final SourceAttribute attribute = attributes[i]; if (attribute instanceof BlobAttribute) { if (buffer == null) { buffer = new Buffer(attribute.getLength()); } attributes[i] = inflateAttribute(buffer, attribute); } } }