Examples of Helper


Examples of org.eclipse.ocl.ecore.OCL.Helper

   */
  public EList<Classifier> getGeneral() {
    EStructuralFeature eFeature = OntoUMLPackage.Literals.CLASSIFIER__GENERAL;
 
    if (generalDeriveOCL == null) {
      Helper helper = OCL_ENV.createOCLHelper();
      helper.setAttributeContext(OntoUMLPackage.Literals.CLASSIFIER, eFeature);
     
      EAnnotation ocl = eFeature.getEAnnotation(OCL_ANNOTATION_SOURCE);
      String derive = (String) ocl.getDetails().get("derive");
     
      try {
        generalDeriveOCL = helper.createQuery(derive);
      } catch (ParserException e) {
        throw new UnsupportedOperationException(e.getLocalizedMessage());
      }
    }
   
View Full Code Here

Examples of org.eclipse.ocl.ecore.OCL.Helper

   */
  public EList<Generalization> getGeneralization() {
    EStructuralFeature eFeature = OntoUMLPackage.Literals.CLASSIFIER__GENERALIZATION;
 
    if (generalizationDeriveOCL == null) {
      Helper helper = OCL_ENV.createOCLHelper();
      helper.setAttributeContext(OntoUMLPackage.Literals.CLASSIFIER, eFeature);
     
      EAnnotation ocl = eFeature.getEAnnotation(OCL_ANNOTATION_SOURCE);
      String derive = (String) ocl.getDetails().get("derive");
     
      try {
        generalizationDeriveOCL = helper.createQuery(derive);
      } catch (ParserException e) {
        throw new UnsupportedOperationException(e.getLocalizedMessage());
      }
    }
   
View Full Code Here

Examples of org.eclipse.ocl.ecore.OCL.Helper

   */
  public EList<Element> getRelatedElement() {
    EStructuralFeature eFeature = OntoUMLPackage.Literals.RELATIONSHIP__RELATED_ELEMENT;
 
    if (relatedElementDeriveOCL == null) {
      Helper helper = OCL_ENV.createOCLHelper();
      helper.setAttributeContext(OntoUMLPackage.Literals.RELATIONSHIP, eFeature);
     
      EAnnotation ocl = eFeature.getEAnnotation(OCL_ANNOTATION_SOURCE);
      String derive = (String) ocl.getDetails().get("derive");
     
      try {
        relatedElementDeriveOCL = helper.createQuery(derive);
      } catch (ParserException e) {
        throw new UnsupportedOperationException(e.getLocalizedMessage());
      }
    }
   
View Full Code Here

Examples of org.eclipse.ocl.ecore.OCL.Helper

   */
  public EList<Property> getAttribute() {
    EStructuralFeature eFeature = OntoUMLPackage.Literals.CLASSIFIER__ATTRIBUTE;
 
    if (attributeDeriveOCL == null) {
      Helper helper = OCL_ENV.createOCLHelper();
      helper.setAttributeContext(OntoUMLPackage.Literals.CLASSIFIER, eFeature);
     
      EAnnotation ocl = eFeature.getEAnnotation(OCL_ANNOTATION_SOURCE);
      String derive = (String) ocl.getDetails().get("derive");
     
      try {
        attributeDeriveOCL = helper.createQuery(derive);
      } catch (ParserException e) {
        throw new UnsupportedOperationException(e.getLocalizedMessage());
      }
    }
   
View Full Code Here

Examples of org.eclipse.ocl.ecore.OCL.Helper

   */
  public EList<Classifier> getGeneral() {
    EStructuralFeature eFeature = OntoUMLPackage.Literals.CLASSIFIER__GENERAL;
 
    if (generalDeriveOCL == null) {
      Helper helper = OCL_ENV.createOCLHelper();
      helper.setAttributeContext(OntoUMLPackage.Literals.CLASSIFIER, eFeature);
     
      EAnnotation ocl = eFeature.getEAnnotation(OCL_ANNOTATION_SOURCE);
      String derive = (String) ocl.getDetails().get("derive");
     
      try {
        generalDeriveOCL = helper.createQuery(derive);
      } catch (ParserException e) {
        throw new UnsupportedOperationException(e.getLocalizedMessage());
      }
    }
   
View Full Code Here

Examples of org.eclipse.ocl.ecore.OCL.Helper

   */
  public EList<Generalization> getGeneralization() {
    EStructuralFeature eFeature = OntoUMLPackage.Literals.CLASSIFIER__GENERALIZATION;
 
    if (generalizationDeriveOCL == null) {
      Helper helper = OCL_ENV.createOCLHelper();
      helper.setAttributeContext(OntoUMLPackage.Literals.CLASSIFIER, eFeature);
     
      EAnnotation ocl = eFeature.getEAnnotation(OCL_ANNOTATION_SOURCE);
      String derive = (String) ocl.getDetails().get("derive");
     
      try {
        generalizationDeriveOCL = helper.createQuery(derive);
      } catch (ParserException e) {
        throw new UnsupportedOperationException(e.getLocalizedMessage());
      }
    }
   
View Full Code Here

Examples of org.eclipse.ocl.ecore.OCL.Helper

    public Expression(String body, EClassifier context,
        Map<String, EClassifier> environment) {
      super(body, context);
      oclInstance = org.eclipse.ocl.ecore.OCL.newInstance();
      initCustomEnv(oclInstance.getEnvironment(), environment);
      Helper oclHelper = oclInstance.createOCLHelper();
      oclHelper.setContext(context());
      try {
        oclExpression = oclHelper.createQuery(body());
        setStatus(IStatus.OK, null, null);
      } catch (ParserException e) {
        setStatus(IStatus.ERROR, e.getMessage(), e);
      }
    }
View Full Code Here

Examples of org.eclipse.ocl.ecore.OCL.Helper

    public Expression(String body, EClassifier context,
        Map<String, EClassifier> environment) {
      super(body, context);
      oclInstance = org.eclipse.ocl.ecore.OCL.newInstance();
      initCustomEnv(oclInstance.getEnvironment(), environment);
      Helper oclHelper = oclInstance.createOCLHelper();
      oclHelper.setContext(context());
      try {
        oclExpression = oclHelper.createQuery(body());
        setStatus(IStatus.OK, null, null);
      } catch (ParserException e) {
        setStatus(IStatus.ERROR, e.getMessage(), e);
      }
    }
View Full Code Here

Examples of org.eclipse.ocl.uml.OCL.Helper

    Class umlClass = (Class) model.getOwnedMembers().get(0).getOwnedElements().get(0);
    Property umlProperty = (Property) umlClass.getOwnedAttributes().get(0);
   
    //initialize OCL stuff
    OCL ocl = OCL.newInstance();
    Helper helper = ocl.createOCLHelper();
    out(OCL.initialize(OCLParser.RESOURCE_SET));
    helper.setAttributeContext(umlClass, umlProperty);
    helper.setContext((Classifier) model.getOwnedMembers().get(0).getOwnedElements().get(0));
    out("The following elements are contained in the class:");
    out(model.getOwnedMembers().get(0).getOwnedElements().get(0).toString());
    out(helper.getEnvironment().getVariables().size()+"");
    out("Variables within the context:");
    for (Variable<Classifier, ?> v : helper.getEnvironment().getVariables()){
      out(v.toString());
      //out(v.getRepresentedParameter());
      //out(v.getName());
      //out(v.getType().toString());
      out(v.getClass().toString());
      //out(""+v.getTypeEndPosition());
      Iterator<EObject> it = v.eAllContents();
      while (it.hasNext()){
        out(it.next().getClass().toString());
      }

    }
    Constraint invariant = helper.createInvariant("x<5");
    Iterator<EObject> it = invariant.eAllContents();
    while (it.hasNext()){
      EObject o = it.next();
      out(o.getClass().toString());
      if ( o instanceof ASTNode ){
        out("found AST Node" + ((ASTNode) o).getStartPosition());
      }
    }
    out(invariant.toString());
    out(invariant.getSpecification().toString());
    ExpressionInOCL exp = (ExpressionInOCL) invariant.getSpecification();
    out(helper.getEnvironment().getVariables().size()+"");
    exp.getBodyExpression();
  }
View Full Code Here

Examples of org.eclipse.persistence.jaxb.javamodel.Helper

   * instance's JavaModel. Annotations are processed here as well.
     *
     * @param jModelInput
     */
    public Generator(JavaModelInput jModelInput) {
        helper = new Helper(jModelInput.getJavaModel());
        annotationsProcessor = new AnnotationsProcessor(helper);
        schemaGenerator = new SchemaGenerator(helper);
        mappingsGenerator = new MappingsGenerator(helper);
        annotationsProcessor.processClassesAndProperties(jModelInput.getJavaClasses());
    }
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.