~ubuntu-branches/ubuntu/precise/asm3/precise

« back to all changes in this revision

Viewing changes to src/org/objectweb/asm/xml/ASMContentHandler.java

  • Committer: Package Import Robot
  • Author(s): Torsten Werner
  • Date: 2011-09-12 13:50:38 UTC
  • mfrom: (3.2.5 sid)
  • Revision ID: package-import@ubuntu.com-20110912135038-1g97tsp2uopphgm7
Tags: 3.3.2-1
* Team upload.
* New upstream release.
* Change debian/watch to point to upstream's SVN repository. Add
  debian/orig-tar.sh.
* Remove all prebuilt jar files from orig tarball.
* Install asm-debug-all.jar.
* Do no longer install symlinks from asm3-all.jar to the individual jars.
  Install the real files instead.
* Use upstream provided pom files instead of shipping them in the debian
  directory.

Show diffs side-by-side

added added

removed removed

Lines of Context:
69
69
    /**
70
70
     * Complete name of the current element.
71
71
     */
72
 
    private String match = "";
 
72
    String match = "";
73
73
 
74
74
    /**
75
75
     * <tt>true</tt> if the maximum stack size and number of local variables
319
319
        OPCODES.put(operStr, new Opcode(oper, group));
320
320
    }
321
321
 
322
 
    private static final Map TYPES = new HashMap();
 
322
    static final Map TYPES = new HashMap();
323
323
    static {
324
324
        String[] types = SAXCodeAdapter.TYPES;
325
325
        for (int i = 0; i < types.length; i++) {
470
470
        stack.add(object);
471
471
    }
472
472
 
473
 
    private static final class RuleSet {
 
473
    static final class RuleSet {
474
474
 
475
475
        private final Map rules = new HashMap();
476
476
 
684
684
    /**
685
685
     * ClassRule
686
686
     */
687
 
    private final class ClassRule extends Rule {
 
687
    final class ClassRule extends Rule {
688
688
 
689
689
        public final void begin(final String name, final Attributes attrs) {
690
690
            int major = Integer.parseInt(attrs.getValue("major"));
703
703
        }
704
704
    }
705
705
 
706
 
    private final class SourceRule extends Rule {
 
706
    final class SourceRule extends Rule {
707
707
 
708
708
        public void begin(final String name, final Attributes attrs) {
709
709
            String file = attrs.getValue("file");
715
715
    /**
716
716
     * InterfaceRule
717
717
     */
718
 
    private final class InterfaceRule extends Rule {
 
718
    final class InterfaceRule extends Rule {
719
719
 
720
720
        public final void begin(final String name, final Attributes attrs) {
721
721
            ((List) ((HashMap) peek()).get("interfaces")).add(attrs.getValue("name"));
725
725
    /**
726
726
     * InterfacesRule
727
727
     */
728
 
    private final class InterfacesRule extends Rule {
 
728
    final class InterfacesRule extends Rule {
729
729
 
730
730
        public final void end(final String element) {
731
 
            Map vals = (HashMap) pop();
 
731
            Map vals = (Map) pop();
732
732
            int version = ((Integer) vals.get("version")).intValue();
733
733
            int access = getAccess((String) vals.get("access"));
734
734
            String name = (String) vals.get("name");
744
744
    /**
745
745
     * OuterClassRule
746
746
     */
747
 
    private final class OuterClassRule extends Rule {
 
747
    final class OuterClassRule extends Rule {
748
748
 
749
749
        public final void begin(final String element, final Attributes attrs) {
750
750
            String owner = attrs.getValue("owner");
757
757
    /**
758
758
     * InnerClassRule
759
759
     */
760
 
    private final class InnerClassRule extends Rule {
 
760
    final class InnerClassRule extends Rule {
761
761
 
762
762
        public final void begin(final String element, final Attributes attrs) {
763
763
            int access = getAccess(attrs.getValue("access"));
771
771
    /**
772
772
     * FieldRule
773
773
     */
774
 
    private final class FieldRule extends Rule {
 
774
    final class FieldRule extends Rule {
775
775
 
776
776
        public final void begin(final String element, final Attributes attrs)
777
777
                throws SAXException
792
792
    /**
793
793
     * MethodRule
794
794
     */
795
 
    private final class MethodRule extends Rule {
 
795
    final class MethodRule extends Rule {
796
796
 
797
797
        public final void begin(final String name, final Attributes attrs) {
798
798
            labels = new HashMap();
815
815
    /**
816
816
     * ExceptionRule
817
817
     */
818
 
    private final class ExceptionRule extends Rule {
 
818
    final class ExceptionRule extends Rule {
819
819
 
820
820
        public final void begin(final String name, final Attributes attrs) {
821
821
            ((List) ((HashMap) peek()).get("exceptions")).add(attrs.getValue("name"));
825
825
    /**
826
826
     * ExceptionsRule
827
827
     */
828
 
    private final class ExceptionsRule extends Rule {
 
828
    final class ExceptionsRule extends Rule {
829
829
 
830
830
        public final void end(final String element) {
831
 
            Map vals = (HashMap) pop();
 
831
            Map vals = (Map) pop();
832
832
            int access = getAccess((String) vals.get("access"));
833
833
            String name = (String) vals.get("name");
834
834
            String desc = (String) vals.get("desc");
843
843
    /**
844
844
     * TableSwitchRule
845
845
     */
846
 
    private class TableSwitchRule extends Rule {
 
846
    class TableSwitchRule extends Rule {
847
847
 
848
848
        public final void begin(final String name, final Attributes attrs) {
849
849
            Map vals = new HashMap();
855
855
        }
856
856
 
857
857
        public final void end(final String name) {
858
 
            Map vals = (HashMap) pop();
 
858
            Map vals = (Map) pop();
859
859
            int min = Integer.parseInt((String) vals.get("min"));
860
860
            int max = Integer.parseInt((String) vals.get("max"));
861
861
            Label dflt = getLabel(vals.get("dflt"));
868
868
    /**
869
869
     * TableSwitchLabelRule
870
870
     */
871
 
    private final class TableSwitchLabelRule extends Rule {
 
871
    final class TableSwitchLabelRule extends Rule {
872
872
 
873
873
        public final void begin(final String name, final Attributes attrs) {
874
874
            ((List) ((HashMap) peek()).get("labels")).add(getLabel(attrs.getValue("name")));
878
878
    /**
879
879
     * LookupSwitchRule
880
880
     */
881
 
    private final class LookupSwitchRule extends Rule {
 
881
    final class LookupSwitchRule extends Rule {
882
882
 
883
883
        public final void begin(final String name, final Attributes attrs) {
884
884
            Map vals = new HashMap();
889
889
        }
890
890
 
891
891
        public final void end(final String name) {
892
 
            Map vals = (HashMap) pop();
 
892
            Map vals = (Map) pop();
893
893
            Label dflt = getLabel(vals.get("dflt"));
894
894
            List keyList = (List) vals.get("keys");
895
895
            List lbls = (List) vals.get("labels");
905
905
    /**
906
906
     * LookupSwitchLabelRule
907
907
     */
908
 
    private final class LookupSwitchLabelRule extends Rule {
 
908
    final class LookupSwitchLabelRule extends Rule {
909
909
 
910
910
        public final void begin(final String name, final Attributes attrs) {
911
 
            Map vals = (HashMap) peek();
 
911
            Map vals = (Map) peek();
912
912
            ((List) vals.get("labels")).add(getLabel(attrs.getValue("name")));
913
913
            ((List) vals.get("keys")).add(attrs.getValue("key"));
914
914
        }
917
917
    /**
918
918
     * FrameRule
919
919
     */
920
 
    private final class FrameRule extends Rule {
 
920
    final class FrameRule extends Rule {
921
921
 
922
922
        public void begin(final String name, final Attributes attrs) {
923
923
            Map typeLists = new HashMap();
931
931
        }
932
932
 
933
933
        public void end(final String name) {
934
 
            Map typeLists = (HashMap) pop();
 
934
            Map typeLists = (Map) pop();
935
935
            List locals = (List) typeLists.get("local");
936
936
            int nLocal = locals.size();
937
937
            Object[] local = locals.toArray();
976
976
        }
977
977
    }
978
978
 
979
 
    private final class FrameTypeRule extends Rule {
 
979
    final class FrameTypeRule extends Rule {
980
980
 
981
981
        public void begin(final String name, final Attributes attrs) {
982
982
            List types = (List) ((HashMap) peek()).get(name);
997
997
    /**
998
998
     * LabelRule
999
999
     */
1000
 
    private final class LabelRule extends Rule {
 
1000
    final class LabelRule extends Rule {
1001
1001
 
1002
1002
        public final void begin(final String name, final Attributes attrs) {
1003
1003
            getCodeVisitor().visitLabel(getLabel(attrs.getValue("name")));
1007
1007
    /**
1008
1008
     * TryCatchRule
1009
1009
     */
1010
 
    private final class TryCatchRule extends Rule {
 
1010
    final class TryCatchRule extends Rule {
1011
1011
 
1012
1012
        public final void begin(final String name, final Attributes attrs) {
1013
1013
            Label start = getLabel(attrs.getValue("start"));
1021
1021
    /**
1022
1022
     * LineNumberRule
1023
1023
     */
1024
 
    private final class LineNumberRule extends Rule {
 
1024
    final class LineNumberRule extends Rule {
1025
1025
 
1026
1026
        public final void begin(final String name, final Attributes attrs) {
1027
1027
            int line = Integer.parseInt(attrs.getValue("line"));
1033
1033
    /**
1034
1034
     * LocalVarRule
1035
1035
     */
1036
 
    private final class LocalVarRule extends Rule {
 
1036
    final class LocalVarRule extends Rule {
1037
1037
 
1038
1038
        public final void begin(final String element, final Attributes attrs) {
1039
1039
            String name = attrs.getValue("name");
1054
1054
    /**
1055
1055
     * OpcodesRule
1056
1056
     */
1057
 
    private final class OpcodesRule extends Rule {
 
1057
    final class OpcodesRule extends Rule {
1058
1058
 
1059
1059
        // public boolean match( String match, String element) {
1060
1060
        // return match.startsWith( path) && OPCODES.containsKey( element);
1135
1135
    /**
1136
1136
     * MaxRule
1137
1137
     */
1138
 
    private final class MaxRule extends Rule {
 
1138
    final class MaxRule extends Rule {
1139
1139
 
1140
1140
        public final void begin(final String element, final Attributes attrs) {
1141
1141
            int maxStack = Integer.parseInt(attrs.getValue("maxStack"));
1144
1144
        }
1145
1145
    }
1146
1146
 
1147
 
    private final class AnnotationRule extends Rule {
 
1147
    final class AnnotationRule extends Rule {
1148
1148
 
1149
1149
        public void begin(final String name, final Attributes attrs) {
1150
1150
            String desc = attrs.getValue("desc");
1169
1169
        }
1170
1170
    }
1171
1171
 
1172
 
    private final class AnnotationParameterRule extends Rule {
 
1172
    final class AnnotationParameterRule extends Rule {
1173
1173
 
1174
1174
        public void begin(final String name, final Attributes attrs) {
1175
1175
            int parameter = Integer.parseInt(attrs.getValue("parameter"));
1190
1190
        }
1191
1191
    }
1192
1192
 
1193
 
    private final class AnnotationValueRule extends Rule {
 
1193
    final class AnnotationValueRule extends Rule {
1194
1194
 
1195
1195
        public void begin(final String nm, final Attributes attrs)
1196
1196
                throws SAXException
1204
1204
        }
1205
1205
    }
1206
1206
 
1207
 
    private final class AnnotationValueEnumRule extends Rule {
 
1207
    final class AnnotationValueEnumRule extends Rule {
1208
1208
 
1209
1209
        public void begin(final String nm, final Attributes attrs) {
1210
1210
            AnnotationVisitor av = (AnnotationVisitor) peek();
1216
1216
        }
1217
1217
    }
1218
1218
 
1219
 
    private final class AnnotationValueAnnotationRule extends Rule {
 
1219
    final class AnnotationValueAnnotationRule extends Rule {
1220
1220
 
1221
1221
        public void begin(final String nm, final Attributes attrs) {
1222
1222
            AnnotationVisitor av = (AnnotationVisitor) peek();
1232
1232
        }
1233
1233
    }
1234
1234
 
1235
 
    private final class AnnotationValueArrayRule extends Rule {
 
1235
    final class AnnotationValueArrayRule extends Rule {
1236
1236
 
1237
1237
        public void begin(final String nm, final Attributes attrs) {
1238
1238
            AnnotationVisitor av = (AnnotationVisitor) peek();
1247
1247
        }
1248
1248
    }
1249
1249
 
1250
 
    private final class AnnotationDefaultRule extends Rule {
 
1250
    final class AnnotationDefaultRule extends Rule {
1251
1251
 
1252
1252
        public void begin(final String nm, final Attributes attrs) {
1253
1253
            MethodVisitor av = (MethodVisitor) peek();
1265
1265
    /**
1266
1266
     * Opcode
1267
1267
     */
1268
 
    private static final class Opcode {
 
1268
    static final class Opcode {
1269
1269
 
1270
1270
        public final int opcode;
1271
1271
 
1272
1272
        public final int type;
1273
1273
 
1274
 
        private Opcode(final int opcode, final int type) {
 
1274
        Opcode(final int opcode, final int type) {
1275
1275
            this.opcode = opcode;
1276
1276
            this.type = type;
1277
1277
        }