Package eu.admire.dispel.members

Examples of eu.admire.dispel.members.Method


    }
  }

  public static void addMissingAnnotationMembers(Annotation annotation) {
    String valueMethodName = "value";
    Method valueMethod = annotation.getContainedMethod(valueMethodName);
    if (valueMethod == null) {
      valueMethod = AnnotationsFactory.eINSTANCE.createAnnotationAttribute();
      valueMethod.setName(valueMethodName);
      ClassifierReference type = TypesFactory.eINSTANCE.createClassifierReference();
      type.setTarget(annotation.getConcreteClassifier("java.lang.String"));
      valueMethod.setTypeReference(type);
      annotation.getDefaultMembers().add(valueMethod);
    }
  }
View Full Code Here


   */
  public static void addMissingEnumerationMembers(Enumeration enumeration) {
   
    //add the values
    String valuesMethodName = "values";
    Method valuesMethod = enumeration.getContainedMethod(valuesMethodName);
   
    if (valuesMethod == null) {
      valuesMethod = MembersFactory.eINSTANCE.createInterfaceMethod();
      valuesMethod.setName(valuesMethodName);
     
      ClassifierReference type = TypesFactory.eINSTANCE.createClassifierReference();
      type.setTarget(enumeration);
      valuesMethod.setTypeReference(type);
      enumeration.getDefaultMembers().add(valuesMethod);
    }
   
    //add the value of method
    String valueOfMethodName = "valueOf";
    Method valueOfMethod = enumeration.getContainedMethod(valueOfMethodName);
   
    if (valueOfMethod == null) {
      valueOfMethod = MembersFactory.eINSTANCE.createInterfaceMethod();
      valueOfMethod.setName(valueOfMethodName);
     
      ClassifierReference type = TypesFactory.eINSTANCE.createClassifierReference();
      type.setTarget(enumeration);
      valueOfMethod.setTypeReference(type);
     
      Parameter strParameter = ParametersFactory.eINSTANCE.createOrdinaryParameter();
      strParameter.setName("str");
      type = TypesFactory.eINSTANCE.createClassifierReference();
      type.setTarget(enumeration.getConcreteClassifier("java.lang.String"));
      strParameter.setTypeReference(type);
     
      valueOfMethod.getParameters().add(strParameter);
      enumeration.getDefaultMembers().add(valueOfMethod);
    }
  }
View Full Code Here

TOP

Related Classes of eu.admire.dispel.members.Method

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.