]> source.dussan.org Git - aspectj.git/commitdiff
246125: the SPLIT
authoraclement <aclement>
Wed, 22 Oct 2008 05:46:20 +0000 (05:46 +0000)
committeraclement <aclement>
Wed, 22 Oct 2008 05:46:20 +0000 (05:46 +0000)
asm/src/org/aspectj/asm/IRelationship.java

index d71a5f2b7077ad257b484405cdeca3b5d7e41d42..439c089d21c2dd9239f3ab17cc9fe664e97b9212 100644 (file)
@@ -61,6 +61,25 @@ public interface IRelationship extends Serializable {
                                        || this == DECLARE_SOFT;
                }
 
+               public String getName() {
+                       return name;
+               }
+
+               /**
+                * Return the Kind of the relationship that is passed in by name.
+                * 
+                * @param stringFormOfRelationshipKind the relationship name, eg. 'declare warning', 'declare error', etc.
+                * @return the Kind instance
+                */
+               public static Kind getKindFor(String stringFormOfRelationshipKind) {
+                       for (int i = 0; i < ALL.length; i++) {
+                               if (ALL[i].name.equals(stringFormOfRelationshipKind)) {
+                                       return ALL[i];
+                               }
+                       }
+                       return null;
+               }
+
                private Kind(String name) {
                        this.name = name;
                }