Package org.openiaml.model.model

Examples of org.openiaml.model.model.NamedElement


   * @param element
   * @return
   */
  public String formatElement(EObject element) {
    if (element instanceof NamedElement) {
      NamedElement ne = (NamedElement) element;
      if (ne instanceof Event && ne.getName() == null) {
        return ne.eClass().getName() + " " + ne.eContainingFeature().getName();
      } else {
        return ne.eClass().getName() + " '" + ne.getName() + "'";
      }
    }
    return element.toString();
  }
View Full Code Here


   * @param object
   * @return
   */
  public static String getEObjectBreadcrumbString(EObject object) {
    if (object instanceof NamedElement) {
      NamedElement e = (NamedElement) object;
      if (e.getName() != null && !e.getName().isEmpty()) {
        return e.eClass().getName() + ": '" + e.getName() + "'";    // InternetApplication: 'root'
      } else {
        return e.eClass().getName();      // InternetApplication
      }
    } else if (object instanceof ENamedElement) {
      ENamedElement e = (ENamedElement) object;
      if (e.getName() != null && !e.getName().isEmpty()) {
        return e.eClass().getName() + ": '" + e.getName() + "'";    // EClass: 'root'
      } else {
        return e.eClass().getName();      // EClass
      }
    } else {
      return object.eClass().getName();      // EObject
    }
  }
View Full Code Here

        // check for shortcut status if necessary
        if (!checkShortcut || isShortcut(s) == shortcutRequired) {
          EObject obj = s.resolveSemanticElement();
          if (objectClass.isInstance(obj)) {
            // check containing feature name
            NamedElement e = (NamedElement) obj;
            if (name == null || (e.getName() != null && e.getName().equals(name))) {
              if (containingFeature == null || containingFeature.equals(obj.eContainingFeature())) {
              assertNotNull(s);
              return s;
              }
            }
            found += e.getName() + "[" + obj.eContainingFeature() + "],";
          }
        }
      }
    }
View Full Code Here

TOP

Related Classes of org.openiaml.model.model.NamedElement

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.