/**
   * @param parentElement
   * @param childElement
   * @param severity
   */
  private void reportMinOccurenceViolation(
      Element parentElement, ElementOccurrenceResult result, int severity) {

    ISchemaElement childElement = result.getSchemaElement();
    String allowedOccurrences = new Integer(result.getAllowedOccurrences()).toString();
    String message =
        NLS.bind(
            MDECoreMessages.ExtensionsErrorReporter_minOccurrence,
            new String[] {allowedOccurrences, childElement.getName()});
    report(message, getLine(parentElement), severity, MDEMarkerFactory.CAT_FATAL);
  }
 private void computeAllowedElements(ISchemaCompositor compositor, HashSet elementSet) {
   ISchemaObject[] children = compositor.getChildren();
   for (int i = 0; i < children.length; i++) {
     ISchemaObject child = children[i];
     if (child instanceof ISchemaObjectReference) {
       ISchemaObjectReference ref = (ISchemaObjectReference) child;
       ISchemaElement refElement = (ISchemaElement) ref.getReferencedObject();
       if (refElement != null) elementSet.add(refElement.getName());
     } else if (child instanceof ISchemaCompositor) {
       computeAllowedElements((ISchemaCompositor) child, elementSet);
     }
   }
 }
Example #3
0
 public static String getCounterKey(ISchemaElement elementInfo) {
   return elementInfo.getSchema().getQualifiedPointId()
       + "."
       + elementInfo.getName(); // $NON-NLS-1$
 }