public static Property findAttribute(
     Classifier classifier, String attributeIdentifier, boolean ignoreCase, boolean recurse) {
   Property found = classifier.getAttribute(attributeIdentifier, null, ignoreCase, null);
   if (found != null || !recurse) return found;
   final EList<TemplateBinding> templateBindings = classifier.getTemplateBindings();
   if (!templateBindings.isEmpty()) {
     for (TemplateBinding templateBinding : templateBindings) {
       TemplateSignature signature = templateBinding.getSignature();
       found =
           findAttribute(
               (Classifier) signature.getTemplate(), attributeIdentifier, ignoreCase, true);
       if (found != null) return found;
     }
   }
   for (Generalization generalization : classifier.getGeneralizations())
     if ((found =
             findAttribute(generalization.getGeneral(), attributeIdentifier, ignoreCase, true))
         != null) return found;
   return null;
 }
예제 #2
0
 public Property getAttribute(Classifier classifier, String name, Type type) {
   return classifier.getAttribute(name, type);
 }