com.android.dx.cf.attrib.RawAttribute Java Examples

The following examples show how to use com.android.dx.cf.attrib.RawAttribute. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: AttributeFactory.java    From Box with Apache License 2.0 3 votes vote down vote up
/**
 * Parses attribute content. The base class implements this by constructing
 * an instance of {@link RawAttribute}. Subclasses are expected to
 * override this to do something better in most cases.
 *
 * @param cf {@code non-null;} class file to parse from
 * @param context context to parse in; one of the {@code CTX_*}
 * constants
 * @param name {@code non-null;} the attribute name
 * @param offset offset into {@code bytes} to start parsing at; this
 * is the offset to the start of attribute data, not to the header
 * @param length the length of the attribute data
 * @param observer {@code null-ok;} parse observer to report to, if any
 * @return {@code non-null;} an appropriately-constructed {@link Attribute}
 */
protected Attribute parse0(DirectClassFile cf, int context, String name,
                           int offset, int length,
                           ParseObserver observer) {
    ByteArray bytes = cf.getBytes();
    ConstantPool pool = cf.getConstantPool();
    Attribute result = new RawAttribute(name, bytes, offset, length, pool);

    if (observer != null) {
        observer.parsed(bytes, offset, length, "attribute data");
    }

    return result;
}
 
Example #2
Source File: AttributeFactory.java    From Box with Apache License 2.0 3 votes vote down vote up
/**
 * Parses attribute content. The base class implements this by constructing
 * an instance of {@link RawAttribute}. Subclasses are expected to
 * override this to do something better in most cases.
 *
 * @param cf {@code non-null;} class file to parse from
 * @param context context to parse in; one of the {@code CTX_*}
 * constants
 * @param name {@code non-null;} the attribute name
 * @param offset offset into {@code bytes} to start parsing at; this
 * is the offset to the start of attribute data, not to the header
 * @param length the length of the attribute data
 * @param observer {@code null-ok;} parse observer to report to, if any
 * @return {@code non-null;} an appropriately-constructed {@link Attribute}
 */
protected Attribute parse0(DirectClassFile cf, int context, String name,
                           int offset, int length,
                           ParseObserver observer) {
    ByteArray bytes = cf.getBytes();
    ConstantPool pool = cf.getConstantPool();
    Attribute result = new RawAttribute(name, bytes, offset, length, pool);

    if (observer != null) {
        observer.parsed(bytes, offset, length, "attribute data");
    }

    return result;
}
 
Example #3
Source File: AttributeFactory.java    From J2ME-Loader with Apache License 2.0 3 votes vote down vote up
/**
 * Parses attribute content. The base class implements this by constructing
 * an instance of {@link RawAttribute}. Subclasses are expected to
 * override this to do something better in most cases.
 *
 * @param cf {@code non-null;} class file to parse from
 * @param context context to parse in; one of the {@code CTX_*}
 * constants
 * @param name {@code non-null;} the attribute name
 * @param offset offset into {@code bytes} to start parsing at; this
 * is the offset to the start of attribute data, not to the header
 * @param length the length of the attribute data
 * @param observer {@code null-ok;} parse observer to report to, if any
 * @return {@code non-null;} an appropriately-constructed {@link Attribute}
 */
protected Attribute parse0(DirectClassFile cf, int context, String name,
                           int offset, int length,
                           ParseObserver observer) {
    ByteArray bytes = cf.getBytes();
    ConstantPool pool = cf.getConstantPool();
    Attribute result = new RawAttribute(name, bytes, offset, length, pool);

    if (observer != null) {
        observer.parsed(bytes, offset, length, "attribute data");
    }

    return result;
}
 
Example #4
Source File: AttributeFactory.java    From buck with Apache License 2.0 3 votes vote down vote up
/**
 * Parses attribute content. The base class implements this by constructing
 * an instance of {@link RawAttribute}. Subclasses are expected to
 * override this to do something better in most cases.
 *
 * @param cf {@code non-null;} class file to parse from
 * @param context context to parse in; one of the {@code CTX_*}
 * constants
 * @param name {@code non-null;} the attribute name
 * @param offset offset into {@code bytes} to start parsing at; this
 * is the offset to the start of attribute data, not to the header
 * @param length the length of the attribute data
 * @param observer {@code null-ok;} parse observer to report to, if any
 * @return {@code non-null;} an appropriately-constructed {@link Attribute}
 */
protected Attribute parse0(DirectClassFile cf, int context, String name,
                           int offset, int length,
                           ParseObserver observer) {
    ByteArray bytes = cf.getBytes();
    ConstantPool pool = cf.getConstantPool();
    Attribute result = new RawAttribute(name, bytes, offset, length, pool);

    if (observer != null) {
        observer.parsed(bytes, offset, length, "attribute data");
    }

    return result;
}