@Override public void appendImmediate(Object object, String indentation) { target.appendImmediate(object, indentation); }
@Override public void appendImmediate(Object object, String indentation) { target.appendImmediate(object, indentation); }
private String _formatValue(final List<?> list) { StringConcatenation _builder = new StringConcatenation(); { boolean _hasElements = false; for(final Object item : list) { if (!_hasElements) { _hasElements = true; } else { _builder.appendImmediate("<br>", ""); } _builder.append("item?.toString?.htmlEscape"); } } return _builder.toString(); }
public static CharSequence handleProperties(final List<Property> properties, final InvocationContext invocationContext) { StringConcatenation _builder = new StringConcatenation(); { boolean _hasElements = false; for(final Property property : properties) { if (!_hasElements) { _hasElements = true; } else { _builder.appendImmediate(",", ""); } CharSequence _handleProperty = EntityValidationTemplate.handleProperty(property, invocationContext); _builder.append(_handleProperty, ""); _builder.newLineIfNotEmpty(); } } return _builder; }
protected CharSequence _toExpressionString(final ParenthesizedExpression it) { StringConcatenation _builder = new StringConcatenation(); _builder.append("("); { EList<Expression> _expressions = it.getExpressions(); boolean _hasElements = false; for(final Expression expression : _expressions) { if (!_hasElements) { _hasElements = true; } else { _builder.appendImmediate(",", ""); } Object _expressionString = this.toExpressionString(expression); _builder.append(_expressionString, ""); } } _builder.append(")"); return _builder; }
protected String _dataTypeEbnf2(final Alternatives it, final boolean supportActions) { StringConcatenation _builder = new StringConcatenation(); { EList<AbstractElement> _elements = it.getElements(); boolean _hasElements = false; for(final AbstractElement e : _elements) { if (!_hasElements) { _hasElements = true; } else { _builder.appendImmediate("\n |", ""); } String _dataTypeEbnf = this.dataTypeEbnf(e, supportActions); _builder.append(_dataTypeEbnf); } } _builder.newLineIfNotEmpty(); return _builder.toString(); }
protected String _assignmentEbnf(final Alternatives it, final Assignment assignment, final AntlrOptions options, final boolean supportActions) { StringConcatenation _builder = new StringConcatenation(); { EList<AbstractElement> _elements = it.getElements(); boolean _hasElements = false; for(final AbstractElement element : _elements) { if (!_hasElements) { _hasElements = true; } else { _builder.appendImmediate("\n |", ""); } String _assignmentEbnf = this.assignmentEbnf(element, assignment, options, supportActions); _builder.append(_assignmentEbnf); } } _builder.newLineIfNotEmpty(); return _builder.toString(); }
protected String _ebnf2(final Alternatives it, final AntlrOptions options, final boolean supportActions) { StringConcatenation _builder = new StringConcatenation(); { EList<AbstractElement> _elements = it.getElements(); boolean _hasElements = false; for(final AbstractElement element : _elements) { if (!_hasElements) { _hasElements = true; } else { _builder.appendImmediate("\n |", ""); } String _ebnf = this.ebnf(element, options, supportActions); _builder.append(_ebnf); } } _builder.newLineIfNotEmpty(); return _builder.toString(); }
protected CharSequence propsAsArgs(final Iterable<GeneratedProperty> properties) { StringConcatenation _builder = new StringConcatenation(); { boolean _hasElements = false; for(final GeneratedProperty prop : properties) { if (!_hasElements) { _hasElements = true; } else { _builder.appendImmediate(",", ""); } _builder.append("\""); String _name = prop.getName(); _builder.append(_name); _builder.append("\""); _builder.newLineIfNotEmpty(); } } return _builder; }
protected CharSequence propsAsArgs(final Iterable<GeneratedProperty> properties) { StringConcatenation _builder = new StringConcatenation(); { boolean _hasElements = false; for(final GeneratedProperty prop : properties) { if (!_hasElements) { _hasElements = true; } else { _builder.appendImmediate(",", ""); } _builder.append("\""); String _name = prop.getName(); _builder.append(_name, ""); _builder.append("\""); _builder.newLineIfNotEmpty(); } } return _builder; }
protected String _crossrefEbnf(final Alternatives it, final CrossReference ref, final boolean supportActions) { StringConcatenation _builder = new StringConcatenation(); { EList<AbstractElement> _elements = it.getElements(); boolean _hasElements = false; for(final AbstractElement element : _elements) { if (!_hasElements) { _hasElements = true; } else { _builder.appendImmediate("\n |", ""); } String _crossrefEbnf = this.crossrefEbnf(element, ref, supportActions); _builder.append(_crossrefEbnf); } } _builder.newLineIfNotEmpty(); return _builder.toString(); }
public static CharSequence getConstraintsContent(final ConstraintRule constraintRule, final InvocationContext invocationContext) { StringConcatenation _builder = new StringConcatenation(); { if ((constraintRule != null)) { { EList<Constraint> _constraints = constraintRule.getConstraints(); boolean _hasElements = false; for(final Constraint constraint : _constraints) { if (!_hasElements) { _hasElements = true; _builder.append(",\n", ""); } else { _builder.appendImmediate(",", ""); } String _content = Utils.constraintTemplate.getContent(constraint, invocationContext); _builder.append(_content, ""); _builder.newLineIfNotEmpty(); } } } } return _builder; } }
public CharSequence writeEnumeration(final Enumeration enumeration) { StringConcatenation _builder = new StringConcatenation(); { List<Enumeration.Pair> _values = enumeration.getValues(); boolean _hasElements = false; for(final Enumeration.Pair v : _values) { if (!_hasElements) { _hasElements = true; } else { _builder.appendImmediate(",\n", ""); } String _name = v.getName(); Integer _value = v.getValue(); String _description = v.getDescription(); CharSequence _writeEnumItem = this.writeEnumItem(_name, (_value).intValue(), _description); _builder.append(_writeEnumItem, ""); } if (_hasElements) { _builder.append(";", ""); } } _builder.newLineIfNotEmpty(); return _builder; } }
protected CharSequence _toExpressionString(final SubQuery it) { StringConcatenation _builder = new StringConcatenation(); _builder.append("("); _builder.newLine(); { EList<SelectStatement> _queries = it.getQueries(); boolean _hasElements = false; for(final SelectStatement statement : _queries) { if (!_hasElements) { _hasElements = true; } else { _builder.appendImmediate("union", ""); } Object _qlString = this.toQlString(statement); _builder.append(_qlString, ""); } } _builder.append(")"); return _builder; }
public CharSequence writeEnumeration(final Enumeration enumeration) { StringConcatenation _builder = new StringConcatenation(); { List<Enumeration.Pair> _values = enumeration.getValues(); boolean _hasElements = false; for(final Enumeration.Pair v : _values) { if (!_hasElements) { _hasElements = true; } else { _builder.appendImmediate(",\n", ""); } CharSequence _writeEnumItem = this.writeEnumItem(v.getName(), v.getMappedName(), v.getValue(), v.getDescription().orElse(null)); _builder.append(_writeEnumItem); } if (_hasElements) { _builder.append(";"); } } _builder.newLineIfNotEmpty(); return _builder; } }
protected String _ebnf2(final UnorderedGroup it, final AntlrOptions options, final boolean supportActions) { StringConcatenation _builder = new StringConcatenation(); _builder.append("("); { EList<AbstractElement> _elements = it.getElements(); boolean _hasElements = false; for(final AbstractElement element : _elements) { if (!_hasElements) { _hasElements = true; } else { _builder.appendImmediate("\n |", ""); } String _ebnf = this.ebnf(element, options, supportActions); _builder.append(_ebnf); } } _builder.append(")*"); _builder.newLineIfNotEmpty(); return _builder.toString(); }
protected String _dataTypeEbnf2(final UnorderedGroup it, final boolean supportActions) { StringConcatenation _builder = new StringConcatenation(); _builder.append("("); { EList<AbstractElement> _elements = it.getElements(); boolean _hasElements = false; for(final AbstractElement e : _elements) { if (!_hasElements) { _hasElements = true; } else { _builder.appendImmediate("\n |", ""); } String _dataTypeEbnf2 = this.dataTypeEbnf2(e, supportActions); _builder.append(_dataTypeEbnf2); } } _builder.append(")*"); _builder.newLineIfNotEmpty(); return _builder.toString(); }
protected CharSequence _toExpressionString(final FunctionCall it) { StringConcatenation _builder = new StringConcatenation(); String _function = it.getFunction(); _builder.append(_function, ""); _builder.append("("); { EList<Expression> _arguments = it.getArguments(); boolean _hasElements = false; for(final Expression argument : _arguments) { if (!_hasElements) { _hasElements = true; } else { _builder.appendImmediate(",", ""); } Object _expressionString = this.toExpressionString(argument); _builder.append(_expressionString, ""); } } _builder.append(")"); return _builder; }
@Override public String getContent(final org.eclipse.vorto.core.api.model.datatype.Enum en, final InvocationContext invocationContext) { StringConcatenation _builder = new StringConcatenation(); _builder.append("\"type\": \"string\","); _builder.newLine(); _builder.append("\"enum\": [ "); { EList<EnumLiteral> _enums = en.getEnums(); boolean _hasElements = false; for(final EnumLiteral literal : _enums) { if (!_hasElements) { _hasElements = true; } else { _builder.appendImmediate(",", ""); } _builder.append("\""); String _name = literal.getName(); _builder.append(_name, ""); _builder.append("\""); } } _builder.append(" ]"); _builder.newLineIfNotEmpty(); return _builder.toString(); } }
protected CharSequence _toQlString(final SelectClass it) { StringConcatenation _builder = new StringConcatenation(); _builder.append("select new "); String _class_ = it.getClass_(); _builder.append(_class_, ""); _builder.append("("); { EList<Expression> _arguments = it.getArguments(); boolean _hasElements = false; for(final Expression argument : _arguments) { if (!_hasElements) { _hasElements = true; } else { _builder.appendImmediate(",", ""); } CharSequence _expressionString = this.toExpressionString(argument); _builder.append(_expressionString, ""); } } _builder.append(")"); _builder.newLineIfNotEmpty(); _builder.append(" "); CharSequence _selectString = this.toSelectString(it); _builder.append(_selectString, " "); return _builder; }