Package com.android.dx.cf.attrib

Examples of com.android.dx.cf.attrib.AttEnclosingMethod


        CstType type = (CstType) pool.get(idx);

        idx = bytes.getUnsignedShort(offset + 2);
        CstNat method = (CstNat) pool.get0Ok(idx);

        Attribute result = new AttEnclosingMethod(type, method);

        if (observer != null) {
            observer.parsed(bytes, offset, 2, "class: " + type);
            observer.parsed(bytes, offset + 2, 2, "method: " +
                            DirectClassFile.stringOrNone(method));
View Full Code Here


     * @return {@code null-ok;} the converted {@code EnclosingMethod} or
     * {@code EnclosingClass} annotation, if there was an
     * attribute to translate
     */
    private static Annotation translateEnclosingMethod(AttributeList attribs) {
        AttEnclosingMethod enclosingMethod = (AttEnclosingMethod)
            attribs.findFirst(AttEnclosingMethod.ATTRIBUTE_NAME);

        if (enclosingMethod == null) {
            return null;
        }

        CstType enclosingClass = enclosingMethod.getEnclosingClass();
        CstNat nat = enclosingMethod.getMethod();

        if (nat == null) {
            /*
             * Dalvik doesn't use EnclosingMethod annotations unless
             * there really is an enclosing method. Anonymous classes
View Full Code Here

    classElement.setAttribute("name", parsedClassName.className);
    classElement.setAttribute("package", parsedClassName.packageName);
    String superClassName= "";

    // if we are an innerclass add the enclosingMethod
    AttEnclosingMethod enclosingMethodAnnotation= (AttEnclosingMethod) cf.getAttributes().findFirst(AttEnclosingMethod.ATTRIBUTE_NAME);

    if (enclosingMethodAnnotation != null)
    {
      CstType enclosingClass= enclosingMethodAnnotation.getEnclosingClass();
      CstNat enclosingMethod= enclosingMethodAnnotation.getMethod();
      if (enclosingClass != null)
      {
        addReference(referencedTypes, enclosingClass.toHuman(), ReferenceKind.USAGE);
        classElement.setAttribute("enclosingClass", enclosingClass.toHuman());
      }
View Full Code Here

TOP

Related Classes of com.android.dx.cf.attrib.AttEnclosingMethod

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.