Package org.eclipse.emf.ecore

Examples of org.eclipse.emf.ecore.EEnumLiteral


   * @generated
   */
  public static Object performCast(Object value, EDataType targetType) {
    if (targetType instanceof EEnum) {
      if (value instanceof EEnumLiteral) {
        EEnumLiteral literal = (EEnumLiteral) value;
        return (literal.getInstance() != null) ? literal.getInstance()
            : literal;
      }
    }
    if (false == value instanceof Number || targetType == null
        || targetType.getInstanceClass() == null) {
View Full Code Here


                      OntoUML.diagram.part.Messages.AbstractParser_UnexpectedValueTypeMessage,
                      iClass.getName()));
        }
      } else if (type instanceof EEnum) {
        if (value instanceof String) {
          EEnumLiteral literal = ((EEnum) type)
              .getEEnumLiteralByLiteral((String) value);
          if (literal == null) {
            value = new InvalidValue(
                NLS
                    .bind(
                        OntoUML.diagram.part.Messages.AbstractParser_UnknownLiteralMessage,
                        value));
          } else {
            value = literal.getInstance();
          }
        } else {
          value = new InvalidValue(
              NLS
                  .bind(
View Full Code Here

    }
    // set allowed values
    EList literals = aEEnum.getELiterals();
    AllowedValue[] vals = new AllowedValue[literals.size()];
    for (int i = 0; i < literals.size(); i++) {
      EEnumLiteral literal = (EEnumLiteral) literals.get(i);
      vals[i] = uimaFactory.createAllowedValue();
      vals[i].setString(literal.getName());
      EAnnotation literalAnnot = literal.getEAnnotation("http://uima.apache.org");
      if (literalAnnot != null) {
        vals[i].setDescription((String) literalAnnot.getDetails().get("description"));
      }
    }
    type.setAllowedValues(vals);
View Full Code Here

                      eu.admire.visual.pmml.treemodel._40.diagram.part.Messages.AbstractParser_UnexpectedValueType,
                      iClass.getName()));
        }
      } else if (type instanceof EEnum) {
        if (value instanceof String) {
          EEnumLiteral literal = ((EEnum) type)
              .getEEnumLiteralByLiteral((String) value);
          if (literal == null) {
            value = new InvalidValue(
                NLS
                    .bind(
                        eu.admire.visual.pmml.treemodel._40.diagram.part.Messages.AbstractParser_UnknownLiteral,
                        value));
          } else {
            value = literal.getInstance();
          }
        } else {
          value = new InvalidValue(
              NLS
                  .bind(
View Full Code Here

                      eu.admire.visual.pmml._40.diagram.part.Messages.AbstractParser_UnexpectedValueType,
                      iClass.getName()));
        }
      } else if (type instanceof EEnum) {
        if (value instanceof String) {
          EEnumLiteral literal = ((EEnum) type)
              .getEEnumLiteralByLiteral((String) value);
          if (literal == null) {
            value = new InvalidValue(
                NLS
                    .bind(
                        eu.admire.visual.pmml._40.diagram.part.Messages.AbstractParser_UnknownLiteral,
                        value));
          } else {
            value = literal.getInstance();
          }
        } else {
          value = new InvalidValue(
              NLS
                  .bind(
View Full Code Here

                      eu.admire.visual.pmml.neuralnetwork._40.diagram.part.Messages.AbstractParser_UnexpectedValueType,
                      iClass.getName()));
        }
      } else if (type instanceof EEnum) {
        if (value instanceof String) {
          EEnumLiteral literal = ((EEnum) type)
              .getEEnumLiteralByLiteral((String) value);
          if (literal == null) {
            value = new InvalidValue(
                NLS
                    .bind(
                        eu.admire.visual.pmml.neuralnetwork._40.diagram.part.Messages.AbstractParser_UnknownLiteral,
                        value));
          } else {
            value = literal.getInstance();
          }
        } else {
          value = new InvalidValue(
              NLS
                  .bind(
View Full Code Here

   * @generated
   */
  public static Object performCast(Object value, EDataType targetType) {
    if (targetType instanceof EEnum) {
      if (value instanceof EEnumLiteral) {
        EEnumLiteral literal = (EEnumLiteral) value;
        return (literal.getInstance() != null) ? literal.getInstance()
            : literal;
      }
    }
    if (false == value instanceof Number || targetType == null
        || targetType.getInstanceClass() == null) {
View Full Code Here

              Messages.AbstractParser_UnexpectedValueType,
              iClass.getName()));
        }
      } else if (type instanceof EEnum) {
        if (value instanceof String) {
          EEnumLiteral literal = ((EEnum) type)
              .getEEnumLiteralByLiteral((String) value);
          if (literal == null) {
            value = new InvalidValue(NLS.bind(
                Messages.AbstractParser_UnknownLiteral, value));
          } else {
            value = literal.getInstance();
          }
        } else {
          value = new InvalidValue(NLS.bind(
              Messages.AbstractParser_UnexpectedValueType,
              String.class.getName()));
View Full Code Here

              Messages.AbstractParser_UnexpectedValueType,
              iClass.getName()));
        }
      } else if (type instanceof EEnum) {
        if (value instanceof String) {
          EEnumLiteral literal = ((EEnum) type)
              .getEEnumLiteralByLiteral((String) value);
          if (literal == null) {
            value = new InvalidValue(NLS.bind(
                Messages.AbstractParser_UnknownLiteral, value));
          } else {
            value = literal.getInstance();
          }
        } else {
          value = new InvalidValue(NLS.bind(
              Messages.AbstractParser_UnexpectedValueType,
              String.class.getName()));
View Full Code Here

              Messages.AbstractParser_UnexpectedValueType,
              iClass.getName()));
        }
      } else if (type instanceof EEnum) {
        if (value instanceof String) {
          EEnumLiteral literal = ((EEnum) type)
              .getEEnumLiteralByLiteral((String) value);
          if (literal == null) {
            value = new InvalidValue(NLS.bind(
                Messages.AbstractParser_UnknownLiteral, value));
          } else {
            value = literal.getInstance();
          }
        } else {
          value = new InvalidValue(NLS.bind(
              Messages.AbstractParser_UnexpectedValueType,
              String.class.getName()));
View Full Code Here

TOP

Related Classes of org.eclipse.emf.ecore.EEnumLiteral

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.