Example #1
0
 public virtual void Add(StructLocalVariableTableAttribute attr)
 {
     Sharpen.Collections.AddAll(localVariables, attr.localVariables);
 }
        public static StructGeneralAttribute CreateAttribute(string name)
        {
            StructGeneralAttribute attr;

            if (Attribute_Inner_Classes.GetName().Equals(name))
            {
                attr = new StructInnerClassesAttribute();
            }
            else if (Attribute_Constant_Value.GetName().Equals(name))
            {
                attr = new StructConstantValueAttribute();
            }
            else if (Attribute_Signature.GetName().Equals(name))
            {
                attr = new StructGenericSignatureAttribute();
            }
            else if (Attribute_Annotation_Default.GetName().Equals(name))
            {
                attr = new StructAnnDefaultAttribute();
            }
            else if (Attribute_Exceptions.GetName().Equals(name))
            {
                attr = new StructExceptionsAttribute();
            }
            else if (Attribute_Enclosing_Method.GetName().Equals(name))
            {
                attr = new StructEnclosingMethodAttribute();
            }
            else if (Attribute_Runtime_Visible_Annotations.GetName().Equals(name) || Attribute_Runtime_Invisible_Annotations
                     .GetName().Equals(name))
            {
                attr = new StructAnnotationAttribute();
            }
            else if (Attribute_Runtime_Visible_Parameter_Annotations.GetName().Equals(name) ||
                     Attribute_Runtime_Invisible_Parameter_Annotations.GetName().Equals(name))
            {
                attr = new StructAnnotationParameterAttribute();
            }
            else if (Attribute_Runtime_Visible_Type_Annotations.GetName().Equals(name) || Attribute_Runtime_Invisible_Type_Annotations
                     .GetName().Equals(name))
            {
                attr = new StructTypeAnnotationAttribute();
            }
            else if (Attribute_Local_Variable_Table.GetName().Equals(name))
            {
                attr = new StructLocalVariableTableAttribute();
            }
            else if (Attribute_Local_Variable_Type_Table.GetName().Equals(name))
            {
                attr = new StructLocalVariableTypeTableAttribute();
            }
            else if (Attribute_Bootstrap_Methods.GetName().Equals(name))
            {
                attr = new StructBootstrapMethodsAttribute();
            }
            else if (Attribute_Synthetic.GetName().Equals(name) || Attribute_Deprecated.GetName
                         ().Equals(name))
            {
                attr = new StructGeneralAttribute();
            }
            else if (Attribute_Line_Number_Table.GetName().Equals(name))
            {
                attr = new StructLineNumberTableAttribute();
            }
            else if (Attribute_Method_Parameters.GetName().Equals(name))
            {
                attr = new StructMethodParametersAttribute();
            }
            else
            {
                // unsupported attribute
                return(null);
            }
            attr.name = name;
            return(attr);
        }