Package eu.admire.dispel.types

Examples of eu.admire.dispel.types.ClassifierReference


        if (result == null) result = caseCommentable(typeReference);
        if (result == null) result = defaultCase(theEObject);
        return result;
      }
      case TypesPackage.CLASSIFIER_REFERENCE: {
        ClassifierReference classifierReference = (ClassifierReference)theEObject;
        T result = caseClassifierReference(classifierReference);
        if (result == null) result = caseTypeReference(classifierReference);
        if (result == null) result = caseCommentable(classifierReference);
        if (result == null) result = defaultCase(theEObject);
        return result;
View Full Code Here


   * @param javaClass
   */
  public static void addDefaultSuperClass(Class javaClass) {
    if (javaClass.getExtends() == null && javaClass.getDefaultExtends() == null) {
      Class objectClass = javaClass.getObjectClass();
      ClassifierReference classifierReference = TypesFactory.eINSTANCE.createClassifierReference();
      classifierReference.setTarget(objectClass);
      javaClass.setDefaultExtends(classifierReference);
    }
  }
View Full Code Here

   * @param javaClass
   */
  public static void addDefaultSuperInterface(Interface javaInterface) {
    if (javaInterface.getExtends().isEmpty() && javaInterface.getDefaultExtends().isEmpty()) {
      Class objectClass = javaInterface.getObjectClass();
      ClassifierReference classifierReference = TypesFactory.eINSTANCE.createClassifierReference();
      classifierReference.setTarget(objectClass);
      javaInterface.getDefaultExtends().add(classifierReference);
    }
  }
View Full Code Here

    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

   
    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.types.ClassifierReference

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.