@Override public Collection<Model> apply(final Model input) { final ArrayList<Model> children = Lists.<Model>newArrayList(); final Entity parent = ((Entity) input); Entity _superType = parent.getSuperType(); boolean _notEquals = (!Objects.equal(_superType, null)); if (_notEquals) { Entity _superType_1 = parent.getSuperType(); children.add(_superType_1); } EList<Property> _properties = parent.getProperties(); Collection<Model> _referenceModels = this.getReferenceModels(_properties); children.addAll(_referenceModels); return children; } }
@Override public String getFileName(final Entity dataEntity) { String _name = dataEntity.getName(); return (_name + ".cpp"); }
public EList<Property> getEntity(final FunctionBlock fb, final PropertyType type) { EList<Entity> _referencedEntities = Utils.getReferencedEntities(fb); for (final Entity entity : _referencedEntities) { boolean _and = false; String _displayname = entity.getDisplayname(); Type _type = ((ObjectPropertyType) type).getType(); String _name = _type.getName(); boolean _equals = _displayname.equals(_name); if (!_equals) { _and = false; } else { String _namespace = entity.getNamespace(); Type _type_1 = ((ObjectPropertyType) type).getType(); String _namespace_1 = _type_1.getNamespace(); boolean _equals_1 = _namespace.equals(_namespace_1); _and = _equals_1; } if (_and) { return entity.getProperties(); } } return null; } }
private static List<Property> getFlatProperties(Entity entity) { List<Property> properties = new ArrayList<Property>(); TreeIterator<EObject> iter = entity.eAllContents(); while (iter.hasNext()) { EObject obj = iter.next(); if (obj instanceof Property) { Property property = (Property) obj; properties.add(property); } } if (entity.getSuperType() != null) { properties.addAll(getFlatProperties(entity.getSuperType())); } return properties; } }
private static void removeSuperTypeModelReference(Entity entity) { Iterator<ModelReference> iter = entity.getReferences().iterator(); while (iter.hasNext()) { ModelReference reference = iter.next(); ModelReference superTypeReference = ModelIdFactory.newInstance(entity.getSuperType()).asModelReference(); if (EcoreUtil.equals(superTypeReference, reference)) { iter.remove(); } } }
_builder.newLine(); _builder.append("* Name:\t\t\t"); String _name = entity.getName(); _builder.append(_name, ""); _builder.newLineIfNotEmpty(); _builder.append("* Namespace:\t"); String _namespace = entity.getNamespace(); _builder.append(_namespace, ""); _builder.newLineIfNotEmpty(); _builder.append("* Version:\t\t"); String _version = entity.getVersion(); _builder.append(_version, ""); _builder.newLineIfNotEmpty(); _builder.newLine(); _builder.append("* "); String _description = entity.getDescription(); _builder.append(_description, ""); _builder.newLineIfNotEmpty(); Entity _superType = entity.getSuperType(); boolean _tripleNotEquals = (_superType != null); if (_tripleNotEquals) { _builder.append("public class "); String _name_1 = entity.getName(); String _firstUpper = StringExtensions.toFirstUpper(_name_1); _builder.append(_firstUpper, ""); _builder.append(" extends "); Entity _superType_1 = entity.getSuperType();
StringConcatenation _builder = new StringConcatenation(); _builder.append("\\subsection{"); String _displayname = entity.getDisplayname(); _builder.append(_displayname, ""); _builder.append("}"); _builder.newLineIfNotEmpty(); _builder.append("\t"); String _description = entity.getDescription(); _builder.append(_description, "\t"); _builder.newLineIfNotEmpty(); _builder.append("\t"); _builder.append("The properties of the data type "); String _displayname_1 = entity.getDisplayname(); _builder.append(_displayname_1, "\t"); _builder.append("\\footnote{Name: "); String _name = entity.getName(); _builder.append(_name, "\t"); _builder.append(", Namespace: "); String _namespace = entity.getNamespace(); _builder.append(_namespace, "\t"); _builder.append(", Version: "); String _version = entity.getVersion(); _builder.append(_version, "\t"); _builder.append(".} are described below:\\\\\\\\"); _builder.newLineIfNotEmpty(); EList<Property> _properties = entity.getProperties(); for(final Property property : _properties) {
public IScope scope_EntityPropertySource_property(final EntityPropertySource exp, final EReference ref) { Entity _model = exp.getModel(); Entity model = ((Entity) _model); EList<Property> _properties = model.getProperties(); return Scopes.scopeFor(_properties); }
StringConcatenation _builder = new StringConcatenation(); _builder.append("// "); String _name = dataEntity.getName(); _builder.append(_name, ""); _builder.newLineIfNotEmpty(); _builder.newLine(); _builder.append("#include \""); String _name_1 = dataEntity.getName(); _builder.append(_name_1, ""); _builder.append(".h\""); _builder.newLine(); _builder.append("using namespace "); String _namespace = dataEntity.getNamespace(); String _replace = _namespace.replace(".", "_"); _builder.append(_replace, ""); _builder.newLineIfNotEmpty(); _builder.newLine(); String _name_2 = dataEntity.getName(); _builder.append(_name_2, ""); _builder.append("::"); String _name_3 = dataEntity.getName(); _builder.append(_name_3, ""); _builder.append("(){}"); EList<Property> _properties = dataEntity.getProperties(); for(final Property status : _properties) { _builder.append("void ");
StringConcatenation _builder = new StringConcatenation(); _builder.append("// "); String _name = dataEntity.getName(); _builder.append(_name, ""); _builder.newLineIfNotEmpty(); _builder.newLine(); _builder.append("#ifndef __ENTITY_"); String _name_1 = dataEntity.getName(); String _upperCase = _name_1.toUpperCase(); _builder.append(_upperCase, ""); _builder.newLineIfNotEmpty(); _builder.append("#define __ENTITY_"); String _name_2 = dataEntity.getName(); String _upperCase_1 = _name_2.toUpperCase(); _builder.append(_upperCase_1, ""); _builder.newLine(); _builder.append("namespace "); String _namespace = dataEntity.getNamespace(); String _replace = _namespace.replace(".", "_"); _builder.append(_replace, ""); _builder.append(" "); _builder.append("class "); String _name_3 = dataEntity.getName(); _builder.append(_name_3, " "); _builder.newLineIfNotEmpty();
_builder.newLine(); _builder.append("class "); String _name = context.getName(); _builder.append(_name, ""); _builder.append(" {"); _builder.newLine(); EList<Property> _properties = context.getProperties(); for(final Property property : _properties) { _builder.append("\t");
private void generateForEntity(InvocationContext ctx, Entity entity, IGeneratedWriter outputter) { ChainedCodeGeneratorTask<Entity> generator = new ChainedCodeGeneratorTask<Entity>(); generator.addTask(new JavaClassGeneratorTask(JAVA_FILE_EXTENSION, SOURCE, entity.getNamespace(), GETTER_PREFIX, SETTER_PREFIX)); generator.generate(entity, ctx, outputter); }
for (final Entity entity : _referencedEntities_1) { boolean _and_1 = false; String _displayname = entity.getDisplayname(); Type _type = ((ObjectPropertyType) type).getType(); String _name = _type.getName(); _and_1 = false; } else { String _namespace = entity.getNamespace(); Type _type_1 = ((ObjectPropertyType) type).getType(); String _namespace_1 = _type_1.getNamespace();
@Check public void checkCircularRefInSuperType(final Entity entity) { Entity _superType = entity.getSuperType(); boolean _notEquals = (!Objects.equal(_superType, null)); if (_notEquals) { try { Entity _superType_1 = entity.getSuperType(); boolean _hasCircularReference = ValidatorUtils.hasCircularReference(entity, _superType_1, ValidatorUtils.entityTypeToChildrenSupplierFunction); if (_hasCircularReference) { this.error(DatatypeSystemMessage.ERROR_SUPERTYPE_CIRCULAR_REF, entity, DatatypePackage.Literals.ENTITY__SUPER_TYPE); } } catch (final Throwable _t) { if (_t instanceof Exception) { final Exception e = (Exception)_t; e.printStackTrace(); } else { throw Exceptions.sneakyThrow(_t); } } } }
_builder.newLine(); _builder.append("* Name:\t\t\t"); String _name = entity.getName(); _builder.append(_name, ""); _builder.newLineIfNotEmpty(); _builder.append("* Namespace:\t"); String _namespace = entity.getNamespace(); _builder.append(_namespace, ""); _builder.newLineIfNotEmpty(); _builder.append("* Version:\t\t"); String _version = entity.getVersion(); _builder.append(_version, ""); _builder.newLineIfNotEmpty(); _builder.newLine(); _builder.append("* "); String _description = entity.getDescription(); _builder.append(_description, ""); _builder.newLineIfNotEmpty(); Entity _superType = entity.getSuperType(); boolean _notEquals = (!Objects.equal(_superType, null)); if (_notEquals) { _builder.append("public class "); String _name_1 = entity.getName(); String _firstUpper = StringExtensions.toFirstUpper(_name_1); _builder.append(_firstUpper, ""); _builder.append(" extends "); Entity _superType_1 = entity.getSuperType();
@Override public String getContent(final Entity entity, final InvocationContext invocationContext) { StringConcatenation _builder = new StringConcatenation(); EList<Property> _properties = entity.getProperties(); CharSequence _handleProperties = EntityValidationTemplate.handleProperties(_properties, invocationContext); String _string = _handleProperties.toString(); String _trim = _string.trim(); _builder.append(_trim, ""); _builder.newLineIfNotEmpty(); return _builder.toString(); }
private void generateForEntity(InformationModel infomodel, InvocationContext ctx, Entity entity, IGeneratedWriter outputter) { ChainedCodeGeneratorTask<Entity> generator = new ChainedCodeGeneratorTask<Entity>(); generator.addTask(new JavaClassGeneratorTask(JAVA_FILE_EXTENSION, SOURCE, entity.getNamespace(), GETTER_PREFIX, SETTER_PREFIX)); generator.generate(entity, ctx, outputter); }
@Override public String getFileName(final Entity dataEntity) { String _name = dataEntity.getName(); return (_name + ".h"); }
public static EList<Type> getReferencedTypes(Entity entity) { EList<Type> types = new BasicEList<Type>(); for (Property property : entity.getProperties()) { types.addAll(getReferencedTypes(property)); } types.add(entity.getSuperType()); return types; }
Entity entity = ((Entity) _type_3); StringBuilder result = new StringBuilder(); EList<Property> _properties = entity.getProperties(); for (final Property _prop : _properties) { PropertyType _type_4 = _prop.getType();