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

The following examples show how to use com.android.dx.cf.attrib.AttSignature. 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: StdAttributeFactory.java    From Box with Apache License 2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #2
Source File: StdAttributeFactory.java    From Box with Apache License 2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #3
Source File: StdAttributeFactory.java    From J2ME-Loader with Apache License 2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #4
Source File: StdAttributeFactory.java    From buck with Apache License 2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #5
Source File: AttributeTranslator.java    From Box with Apache License 2.0 5 votes vote down vote up
/**
 * 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());
}
 
Example #6
Source File: AttributeTranslator.java    From Box with Apache License 2.0 5 votes vote down vote up
/**
 * 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());
}
 
Example #7
Source File: AttributeTranslator.java    From J2ME-Loader with Apache License 2.0 5 votes vote down vote up
/**
 * 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());
}
 
Example #8
Source File: AttributeTranslator.java    From buck with Apache License 2.0 5 votes vote down vote up
/**
 * 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());
}