Examples of EMFClass


Examples of org.openiaml.docs.modeldoc.EMFClass

      for (EReference ref : source.getTargetClass().getEReferences()) {
       
        // get the destination type
        EClass refDest = ref.getEReferenceType();
        // find the corresponding EMFClass
        EMFClass refDestEMF = getEMFClassFor(root, refDest);
       
        // create a new EMFReference
        EMFReference newRef = factory.createEMFReference();
        newRef.setName(ref.getName());
        newRef.setLowerBound(ref.getLowerBound());
View Full Code Here

Examples of org.openiaml.docs.modeldoc.EMFClass

          }
          // are there multiple elements selected with ','s?
          String[] classNames = className.split(",");
          for (String classNameTarget : classNames) {
           
            EMFClass target = helper.getEMFClassFor(root, classNameTarget);
            if (target != null) {
             
              // get the handler to deal with it
              handler.handleSemanticLink(tag, description, target, reference);
 
View Full Code Here

Examples of org.openiaml.docs.modeldoc.EMFClass

   
      // is there at least one type?
      if (ext.getFormalParameters() != null && ext.getFormalParameters().size() > 0) {
       
        // map the Type (the first parameter) to an EMFClass
        EMFClass identifier = mapOAWType(root, ext.getFormalParameters().get(0));       
        if (identifier == null)
          continue// unidentified type (e.g. emf::EObject)
       
        // make a new Extension
        ModelExtension extension = factory.createModelExtension();
        extension.setName(ext.getName());
        extension.setValue(ext.toString());
       
        // make a new FileReference
        FileLineReference line = factory.createFileLineReference();
        line.setFile(fr);
        line.setLine(ext.getLine());
        extension.setReference(line);

        // add this extension
        identifier.getExtensions().add(extension);

      }
    }
   
  }
View Full Code Here

Examples of org.openiaml.docs.modeldoc.EMFClass

  public void testNewModel() throws Exception {
   
    // get the EClass from IAML
    EClass page = VisualPackage.eINSTANCE.getFrame();
   
    EMFClass c = ModeldocFactory.eINSTANCE.createEMFClass();
    c.setTargetClass(page);

    {
      ResourceSet resourceSet = new ResourceSetImpl();
          URI fileURI = URI.createFileURI(new File("test.modeldoc")
                  .getAbsolutePath());
          Resource resource = resourceSet.createResource(fileURI);
          resource.getContents().add(c);
          resource.save(Collections.EMPTY_MAP);
    }
       
        // try loading it!
    EMFClass c2 = null;
    {
      ResourceSet resourceSet = new ResourceSetImpl();
          URI fileURI = URI.createFileURI(new File("test.modeldoc")
                  .getAbsolutePath());
          Resource resource = resourceSet.getResource(fileURI, true);
          c2 = (EMFClass) resource.getContents().get(0);
    }
   
    assertEquals(page, c2.getTargetClass());
    System.out.println(c2.getTargetClass());
    System.out.println(((EClass) c2.getTargetClass()).getEAllContainments());
       
  }
View Full Code Here

Examples of org.openiaml.docs.modeldoc.EMFClass

    for (EClassifier classifier : pkg.getEClassifiers()) {
      if (classifier instanceof EClass) {
       
        EClass cls = (EClass) classifier;
       
        EMFClass c = factory.createEMFClass();
        c.setTargetClass(cls);
        c.setName(cls.getName());
        c.setAbstract(cls.isAbstract());
        c.setInterface(cls.isInterface());

        // add tagline
        {
          JavadocTagElement e = getTaglineForEMFElement(factory, cls);
          if (e != null) {
            c.setTagline(e);
          }
        }
       
        // add rationale
        {
          JavadocTagElement e = getRationaleForEMFElement(factory, cls);
          if (e != null) {
            c.setRationale(e);
          }
        }
       
        c.setParent(root);
       
        // link up the source java class
        getJavaClassFor(c, cls, factory, root);
       
        // parse attributes
View Full Code Here

Examples of org.openiaml.docs.modeldoc.EMFClass

    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
Copyright © 2018 www.massapi.com. 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.