Package org.openiaml.docs.modeldoc

Examples of org.openiaml.docs.modeldoc.ChecksReference


   */
  public static int getTotalConstraintCount(ModelDocumentation root) {
    int count = 0;
    for (Reference ref : root.getReferences()) {
      if (ref instanceof ChecksReference) {
        ChecksReference pkg = (ChecksReference) ref;
        count += pkg.getUniqueConstraints();
      }
    }
    return count;
  }
View Full Code Here


      in = new FileInputStream(checkFile);
    } catch (FileNotFoundException e) {
      throw new DocumentationGenerationException(e);
    }
   
    ChecksReference fr = factory.createChecksReference();
    fr.setPlugin(plugin);
    fr.setPackage(packageBase);
    fr.setName(name);
    fr.setParent(root);
   
    ExtensionFile file = ParseFacade.file(new InputStreamReader(in), checkFile);
   
    for (Check check : file.getChecks()) {
     
      // map the Identifier (the context) to an EMFClass
      EMFClass identifier = mapOAWIdentifier(root, check.getType());
      if (identifier == null)
        continue// unidentified type (e.g. emf::EObject)

      // make a new Constraint for this check
      Constraint constraint = factory.createConstraint();
      constraint.setConstraint(check.getConstraint().toString());
      constraint.setType( check.isErrorCheck() ? ConstraintType.ERROR : ConstraintType.WARNING );
      constraint.setMessage( check.getMsg().toString() );

      // make a new FileReference
      FileLineReference line = factory.createFileLineReference();
      line.setFile(fr);
      line.setLine(check.getLine());
      constraint.setReference(line);
     
      // add this constraint
      identifier.getConstraints().add(constraint);
    }
   
    // set number of constraints
    fr.setUniqueConstraints(file.getChecks().size());
   
  }
View Full Code Here

TOP

Related Classes of org.openiaml.docs.modeldoc.ChecksReference

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.