protected boolean shouldSaveFeature(EObject o, EStructuralFeature f) { return o.eIsSet(f) || keepDefaults && f.getDefaultValueLiteral() != null; }
protected boolean shouldSaveFeature(EObject o, EStructuralFeature f) { return o.eIsSet(f) || keepDefaults && f.getDefaultValueLiteral() != null; }
public boolean isSetDefaultValue() { return getEcoreFeature().getDefaultValueLiteral() != null; }
public boolean isSetDefaultValue() { return getEcoreFeature().getDefaultValueLiteral() != null; }
private static void fixedDefaultValues(PropertiesPackageImpl thePropertiesPackage) { //fix the workaround spaces in the defaults EStructuralFeature excludes = thePropertiesPackage.scanConfigurationEClass.getEStructuralFeature(SCAN_CONFIGURATION__EXCLUDE); if(excludes.getDefaultValueLiteral()!=null) { String exclude = excludes.getDefaultValueLiteral().replace(" ", ""); exclude = exclude.replace("\\\\", "\\"); excludes.setDefaultValueLiteral(exclude); } EStructuralFeature includes = thePropertiesPackage.scanConfigurationEClass.getEStructuralFeature(SCAN_CONFIGURATION__INCLUDE); if(includes.getDefaultValueLiteral()!=null) { String include = includes.getDefaultValueLiteral().replace(" ", ""); include = include.replace("\\\\", "\\"); includes.setDefaultValueLiteral(include); } }
@Override protected boolean shouldSaveFeature(EObject o, EStructuralFeature f) { return o.eIsSet(f) || (keepDefaults && f.getDefaultValueLiteral() != null && f.getLowerBound() > 0); }
public String getDefaultValue() { if (!isSetDefaultValue()) return null; return Literals.toStringLiteral(getEcoreFeature().getDefaultValueLiteral(), getGenModel()); }
public String getDefaultValue() { if (!isSetDefaultValue()) return null; return Literals.toStringLiteral(getEcoreFeature().getDefaultValueLiteral(), getGenModel()); }
public String getStaticDefaultValue() { String defaultString = getEcoreFeature().getDefaultValueLiteral(); EClassifier eType = getEcoreFeature().getEType(); if (eType instanceof EDataType) { GenDataType genDataType = (GenDataType)findGenClassifier(eType); return genDataType.getStaticValue(defaultString); } return "null"; }
public String getStaticDefaultValue() { String defaultString = getEcoreFeature().getDefaultValueLiteral(); EClassifier eType = getEcoreFeature().getEType(); if (eType instanceof EDataType) { GenDataType genDataType = (GenDataType)findGenClassifier(eType); return genDataType.getStaticValue(defaultString); } return "null"; }
@Override public Object getMongoDefaultValue(EStructuralFeature feature) { EEnum eenum = (EEnum)feature.getEType(); String defaultValueLiteral = feature.getDefaultValueLiteral(); if (defaultValueLiteral != null) { EEnumLiteral literal = eenum.getEEnumLiteralByLiteral(defaultValueLiteral); return literal.getValue(); } Enumerator enumerator = (Enumerator)eenum.getDefaultValue(); return enumerator.getValue(); } });
@Override protected Object getDefaultValue() { EEnum eenum = (EEnum)getFeature().getEType(); String defaultValueLiteral = getFeature().getDefaultValueLiteral(); if (defaultValueLiteral != null) { EEnumLiteral literal = eenum.getEEnumLiteralByLiteral(defaultValueLiteral); return literal.getValue(); } Enumerator enumerator = (Enumerator)eenum.getDefaultValue(); return enumerator.getValue(); }
protected XSDAttributeDeclaration buildGlobalAttribute(XSDSchema xsdSchema, EStructuralFeature eStructuralFeature) { XSDAttributeDeclaration xsdAttributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration(); xsdAttributeDeclaration.setName(extendedMetaData.getName(eStructuralFeature)); XSDSimpleTypeDefinition xsdSimpleTypeDefinition = xsdSchema.resolveSimpleTypeDefinitionURI(getURI(eStructuralFeature.getEType())); handleImport(xsdSchema, xsdSimpleTypeDefinition); xsdAttributeDeclaration.setTypeDefinition(xsdSimpleTypeDefinition); String defaultValue = eStructuralFeature.getDefaultValueLiteral(); if (defaultValue != null) { xsdAttributeDeclaration.setConstraint(XSDConstraint.DEFAULT_LITERAL); xsdAttributeDeclaration.setLexicalValue(defaultValue); } xsdSchema.getContents().add(xsdAttributeDeclaration); map(xsdAttributeDeclaration, eStructuralFeature); if (eStructuralFeature.eIsSet(EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE)) { createEcoreAnnotation(xsdAttributeDeclaration, "type", getGenericType(xsdSchema, eStructuralFeature.getEGenericType())); } buildAnnotations(xsdAttributeDeclaration, eStructuralFeature); return xsdAttributeDeclaration; }
protected XSDAttributeDeclaration buildGlobalAttribute(XSDSchema xsdSchema, EStructuralFeature eStructuralFeature) { XSDAttributeDeclaration xsdAttributeDeclaration = XSDFactory.eINSTANCE.createXSDAttributeDeclaration(); xsdAttributeDeclaration.setName(extendedMetaData.getName(eStructuralFeature)); XSDSimpleTypeDefinition xsdSimpleTypeDefinition = xsdSchema.resolveSimpleTypeDefinitionURI(getURI(eStructuralFeature.getEType())); handleImport(xsdSchema, xsdSimpleTypeDefinition); xsdAttributeDeclaration.setTypeDefinition(xsdSimpleTypeDefinition); String defaultValue = eStructuralFeature.getDefaultValueLiteral(); if (defaultValue != null) { xsdAttributeDeclaration.setConstraint(XSDConstraint.DEFAULT_LITERAL); xsdAttributeDeclaration.setLexicalValue(transformDefaultValue(xsdAttributeDeclaration.getTypeDefinition(), defaultValue)); } xsdSchema.getContents().add(xsdAttributeDeclaration); map(xsdAttributeDeclaration, eStructuralFeature); if (eStructuralFeature.eIsSet(EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE)) { createEcoreAnnotation(xsdAttributeDeclaration, "type", getGenericType(xsdSchema, eStructuralFeature.getEGenericType())); } buildAnnotations(xsdAttributeDeclaration, eStructuralFeature); return xsdAttributeDeclaration; }
protected XSDElementDeclaration buildGlobalElement(XSDSchema xsdSchema, EStructuralFeature eStructuralFeature) { XSDElementDeclaration xsdElementDeclaration = XSDFactory.eINSTANCE.createXSDElementDeclaration(); xsdElementDeclaration.setName(extendedMetaData.getName(eStructuralFeature)); EClassifier eType = eStructuralFeature.getEType(); XSDTypeDefinition xsdTypeDefinition = xsdSchema.resolveTypeDefinitionURI(getURI(eType)); handleImport(xsdSchema, xsdTypeDefinition); xsdElementDeclaration.setTypeDefinition(xsdTypeDefinition); if (isWrapperType(eType)) { xsdElementDeclaration.setNillable(true); } String defaultValue = eStructuralFeature.getDefaultValueLiteral(); if (defaultValue != null) { xsdElementDeclaration.setConstraint(XSDConstraint.DEFAULT_LITERAL); xsdElementDeclaration.setLexicalValue(defaultValue); } xsdSchema.getContents().add(xsdElementDeclaration); map(xsdElementDeclaration, eStructuralFeature); if (eStructuralFeature.eIsSet(EcorePackage.Literals.ETYPED_ELEMENT__EGENERIC_TYPE)) { createEcoreAnnotation(xsdElementDeclaration, "type", getGenericType(xsdSchema, eStructuralFeature.getEGenericType())); } buildAnnotations(xsdElementDeclaration, eStructuralFeature); return xsdElementDeclaration; }
String defaultValue = eStructuralFeature.getDefaultValueLiteral(); if (defaultValue != null) else if ((eStructuralFeature.getEType().getDefaultValue() != null || eStructuralFeature.getDefaultValueLiteral() != null) != eStructuralFeature.isUnsettable())
String defaultValueLiteral = eStructuralFeature.getDefaultValueLiteral(); Object defaultValue = null; EDataType eDataType = null;
String defaultValueLiteral = eStructuralFeature.getDefaultValueLiteral(); Object defaultValue = null; EDataType eDataType = null;
String defaultValue = eStructuralFeature.getDefaultValueLiteral(); if (defaultValue != null) else if ((eStructuralFeature.getEType().getDefaultValue() != null || eStructuralFeature.getDefaultValueLiteral() != null) != eStructuralFeature.isUnsettable())
String defaultValue = eStructuralFeature.getDefaultValueLiteral(); if (defaultValue != null)