org.eclipse.emf.ecore.EDataType Java Examples
The following examples show how to use
org.eclipse.emf.ecore.EDataType.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Xtext2EcoreTransformer.java From xtext-core with Eclipse Public License 2.0 | 6 votes |
private void addSuperType(ParserRule rule, TypeRef subTypeRef, EClassifierInfo superTypeInfo) throws TransformationException { final EClassifier subType = subTypeRef.getClassifier(); final EClassifierInfo subTypeInfo = subType == null ? findOrCreateEClassifierInfo(subTypeRef, null, true) : eClassifierInfos.getInfoOrNull(subType); if (subTypeInfo == null) throw new TransformationException(TransformationErrorCode.NoSuchTypeAvailable, "Type '" + superTypeInfo.getEClassifier().getName() + "' is not available.", rule.getType()); if (superTypeInfo.isAssignableFrom(subTypeInfo)) return; if (subTypeInfo.getEClassifier() instanceof EDataType) throw new TransformationException(TransformationErrorCode.InvalidSupertype, "Cannot add supertype '" + superTypeInfo.getEClassifier().getName() + "' to simple datatype '" + subTypeInfo.getEClassifier().getName() + "'.", rule.getType()); if (!subTypeInfo.isGenerated()) throw new TransformationException(TransformationErrorCode.CannotCreateTypeInSealedMetamodel, "Cannot add supertype '" + superTypeInfo.getEClassifier().getName() + "' to sealed type '" + subTypeInfo.getEClassifier().getName() + "'.", rule.getType()); subTypeInfo.addSupertype(superTypeInfo); }
Example #2
Source File: Bug289187TestLanguageFactoryImpl.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object createFromString(EDataType eDataType, String initialValue) { switch (eDataType.getClassifierID()) { case Bug289187TestLanguagePackage.VISIBILITY: return createVisibilityFromString(eDataType, initialValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } }
Example #3
Source File: FormattertestlanguageFactoryImpl.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Enum1 createEnum1FromString(EDataType eDataType, String initialValue) { Enum1 result = Enum1.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; }
Example #4
Source File: LayoutFactoryImpl.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Integer createEllipsisTypeObjectFromString( EDataType eDataType, String initialValue ) { return createEllipsisTypeFromString( LayoutPackage.Literals.ELLIPSIS_TYPE, initialValue ); }
Example #5
Source File: AttributeFactoryImpl.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ public ChartType createChartTypeObjectFromString( EDataType eDataType, String initialValue ) { return createChartTypeFromString( AttributePackage.Literals.CHART_TYPE, initialValue ); }
Example #6
Source File: RootFactoryImpl.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public RootEnum createRootEnumFromString(EDataType eDataType, String initialValue) { RootEnum result = RootEnum.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; }
Example #7
Source File: AttributeFactoryImpl.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public VerticalAlignment createVerticalAlignmentFromString( EDataType eDataType, String initialValue ) { VerticalAlignment result = VerticalAlignment.get( initialValue ); if ( result == null ) throw new IllegalArgumentException( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName( ) + "'" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ return result; }
Example #8
Source File: ConfigurationFactoryImpl.java From neoscada with Eclipse Public License 1.0 | 5 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public VariantTypeType createVariantTypeTypeFromString ( EDataType eDataType, String initialValue ) { VariantTypeType result = VariantTypeType.get ( initialValue ); if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName () + "'" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ return result; }
Example #9
Source File: ModelFactoryImpl.java From openhab1-addons with Eclipse Public License 2.0 | 5 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ public TemperatureIRSubIds createTemperatureIRSubIdsFromString(EDataType eDataType, String initialValue) { TemperatureIRSubIds result = TemperatureIRSubIds.get(initialValue); if (result == null) throw new IllegalArgumentException( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; }
Example #10
Source File: LayoutFactoryImpl.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public String convertTitlePercentTypeObjectToString( EDataType eDataType, Object instanceValue ) { return convertTitlePercentTypeToString( LayoutPackage.Literals.TITLE_PERCENT_TYPE, instanceValue ); }
Example #11
Source File: EnumRulesTestLanguageFactoryImpl.java From xtext-extras with Eclipse Public License 2.0 | 5 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String convertToString(EDataType eDataType, Object instanceValue) { switch (eDataType.getClassifierID()) { case EnumRulesTestLanguagePackage.GENERATED_ENUM: return convertGeneratedEnumToString(eDataType, instanceValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } }
Example #12
Source File: Bug360834TestLanguageFactoryImpl.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String convertToString(EDataType eDataType, Object instanceValue) { switch (eDataType.getClassifierID()) { case Bug360834TestLanguagePackage.VISIBILITY: return convertVisibilityToString(eDataType, instanceValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } }
Example #13
Source File: MultiRuleenumsFactoryImpl.java From xtext-extras with Eclipse Public License 2.0 | 5 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object createFromString(EDataType eDataType, String initialValue) { switch (eDataType.getClassifierID()) { case MultiRuleenumsPackage.MY_ENUM: return createMyEnumFromString(eDataType, initialValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } }
Example #14
Source File: Bpmn2FactoryImpl.java From fixflow with Apache License 2.0 | 5 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public EventBasedGatewayType createEventBasedGatewayTypeFromString(EDataType eDataType, String initialValue) { EventBasedGatewayType result = EventBasedGatewayType.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; }
Example #15
Source File: ModelFactoryImpl.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String convertToString( EDataType eDataType, Object instanceValue ) { switch ( eDataType.getClassifierID( ) ) { case ModelPackage.COVERAGE_TYPE : return convertCoverageTypeToString( eDataType, instanceValue ); case ModelPackage.COVERAGE_TYPE_OBJECT : return convertCoverageTypeObjectToString( eDataType, instanceValue ); default : throw new IllegalArgumentException( "The datatype '" + eDataType.getName( ) + "' is not a valid classifier" ); //$NON-NLS-1$ //$NON-NLS-2$ } }
Example #16
Source File: Bug348427TestLanguageFactoryImpl.java From xtext-eclipse with Eclipse Public License 2.0 | 5 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String convertToString(EDataType eDataType, Object instanceValue) { switch (eDataType.getClassifierID()) { case Bug348427TestLanguagePackage.ENUM_TYPE: return convertEnumTypeToString(eDataType, instanceValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } }
Example #17
Source File: ProtocolFactoryImpl.java From neoscada with Eclipse Public License 1.0 | 5 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public Type createTypeFromString ( EDataType eDataType, String initialValue ) { Type result = Type.get ( initialValue ); if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName () + "'" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ return result; }
Example #18
Source File: EnumsFactoryImpl.java From xtext-core with Eclipse Public License 2.0 | 5 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public Object createFromString(EDataType eDataType, String initialValue) { switch (eDataType.getClassifierID()) { case EnumsPackage.EXISTING_ENUM: return createExistingEnumFromString(eDataType, initialValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } }
Example #19
Source File: AttributeFactoryImpl.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ public ActionType createActionTypeObjectFromString( EDataType eDataType, String initialValue ) { return createActionTypeFromString( AttributePackage.Literals.ACTION_TYPE, initialValue ); }
Example #20
Source File: EnumAndReferenceTestLanguageFactoryImpl.java From xtext-extras with Eclipse Public License 2.0 | 5 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ @Override public String convertToString(EDataType eDataType, Object instanceValue) { switch (eDataType.getClassifierID()) { case EnumAndReferenceTestLanguagePackage.KIND_OF_KEYWORD: return convertKindOfKeywordToString(eDataType, instanceValue); default: throw new IllegalArgumentException("The datatype '" + eDataType.getName() + "' is not a valid classifier"); } }
Example #21
Source File: ModelFactoryImpl.java From openhab1-addons with Eclipse Public License 2.0 | 5 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * * @generated */ public LaserRangeFinderSubIds createLaserRangeFinderSubIdsFromString(EDataType eDataType, String initialValue) { LaserRangeFinderSubIds result = LaserRangeFinderSubIds.get(initialValue); if (result == null) throw new IllegalArgumentException( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; }
Example #22
Source File: AttributeFactoryImpl.java From birt with Eclipse Public License 1.0 | 5 votes |
/** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ public UnitsOfMeasurement createUnitsOfMeasurementObjectFromString( EDataType eDataType, String initialValue ) { return createUnitsOfMeasurementFromString( AttributePackage.Literals.UNITS_OF_MEASUREMENT, initialValue ); }
Example #23
Source File: OsgiFactoryImpl.java From neoscada with Eclipse Public License 1.0 | 5 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public MovingAverageReferenceType createMovingAverageReferenceTypeFromString ( EDataType eDataType, String initialValue ) { MovingAverageReferenceType result = MovingAverageReferenceType.get ( initialValue ); if ( result == null ) throw new IllegalArgumentException ( "The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName () + "'" ); //$NON-NLS-1$ //$NON-NLS-2$ //$NON-NLS-3$ return result; }
Example #24
Source File: TypesFactoryImpl.java From elexis-3-core with Eclipse Public License 1.0 | 4 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public AddressType createAddressTypeFromString(EDataType eDataType, String initialValue) { AddressType result = AddressType.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; }
Example #25
Source File: Xpdl1FactoryImpl.java From bonita-studio with GNU General Public License v2.0 | 4 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public DurationUnitType createDurationUnitTypeFromString(EDataType eDataType, String initialValue) { DurationUnitType result = DurationUnitType.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; }
Example #26
Source File: AttributePackageImpl.java From birt with Eclipse Public License 1.0 | 4 votes |
/** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ public EDataType getAnchorObject( ) { return anchorObjectEDataType; }
Example #27
Source File: EipFactoryImpl.java From eip-designer with Apache License 2.0 | 4 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public MessagePart createMessagePartFromString(EDataType eDataType, String initialValue) { MessagePart result = MessagePart.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; }
Example #28
Source File: AttributePackageImpl.java From birt with Eclipse Public License 1.0 | 4 votes |
/** * <!-- begin-user-doc --> <!-- end-user-doc --> * @generated */ public EDataType getDataTypeObject( ) { return dataTypeObjectEDataType; }
Example #29
Source File: PosLengthQuerySpecification.java From trainbenchmark with Eclipse Public License 1.0 | 4 votes |
@Override public Set<PBody> doGetContainedBodies() throws QueryInitializationException { setEvaluationHints(new QueryEvaluationHint(null, (IQueryBackendFactory)null)); Set<PBody> bodies = Sets.newLinkedHashSet(); try { { PBody body = new PBody(this); PVariable var_segment = body.getOrCreateVariableByName("segment"); PVariable var_length = body.getOrCreateVariableByName("length"); body.setSymbolicParameters(Arrays.<ExportedParameter>asList( new ExportedParameter(body, var_segment, parameter_pSegment) )); // Segment.length(segment, length) new TypeConstraint(body, new FlatTuple(var_segment), new EClassTransitiveInstancesKey((EClass)getClassifierLiteral("http://www.semanticweb.org/ontologies/2015/trainbenchmark", "Segment"))); PVariable var__virtual_0_ = body.getOrCreateVariableByName(".virtual{0}"); new TypeConstraint(body, new FlatTuple(var_segment, var__virtual_0_), new EStructuralFeatureInstancesKey(getFeatureLiteral("http://www.semanticweb.org/ontologies/2015/trainbenchmark", "Segment", "length"))); new TypeConstraint(body, new FlatTuple(var__virtual_0_), new EDataTypeInSlotsKey((EDataType)getClassifierLiteral("http://www.eclipse.org/emf/2002/Ecore", "EInt"))); new Equality(body, var__virtual_0_, var_length); // check(length <= 0) new ExpressionEvaluation(body, new IExpressionEvaluator() { @Override public String getShortDescription() { return "Expression evaluation from pattern posLength"; } @Override public Iterable<String> getInputParameterNames() { return Arrays.asList("length");} @Override public Object evaluateExpression(IValueProvider provider) throws Exception { Integer length = (Integer) provider.getValue("length"); return evaluateExpression_1_1(length); } }, null); bodies.add(body); } // to silence compiler error if (false) throw new ViatraQueryException("Never", "happens"); } catch (ViatraQueryException ex) { throw processDependencyException(ex); } return bodies; }
Example #30
Source File: SGraphFactoryImpl.java From statecharts with Eclipse Public License 1.0 | 4 votes |
/** * <!-- begin-user-doc --> * <!-- end-user-doc --> * @generated */ public ChoiceKind createChoiceKindFromString(EDataType eDataType, String initialValue) { ChoiceKind result = ChoiceKind.get(initialValue); if (result == null) throw new IllegalArgumentException("The value '" + initialValue + "' is not a valid enumerator of '" + eDataType.getName() + "'"); return result; }