protected void _toJavaLiteral(final JvmIntAnnotationValue it, final ITreeAppendable appendable, final GeneratorConfig config) { final Procedure1<Integer> _function = (Integer it_1) -> { appendable.append(it_1.toString()); }; this._loopExtensions.<Integer>forEachWithShortcut(appendable, it.getValues(), _function); }
public void generateTypeParameterDeclaration(final JvmTypeParameterDeclarator it, final ITreeAppendable appendable, final GeneratorConfig config) { final Procedure1<LoopParams> _function = (LoopParams it_1) -> { it_1.setPrefix("<"); it_1.setSeparator(", "); it_1.setSuffix("> "); }; final Procedure1<JvmTypeParameter> _function_1 = (JvmTypeParameter it_1) -> { this.generateTypeParameterDeclaration(it_1, appendable, config); }; this._loopExtensions.<JvmTypeParameter>forEach(appendable, it.getTypeParameters(), _function, _function_1); }
public void generateAnnotation(final JvmAnnotationReference it, final ITreeAppendable appendable, final GeneratorConfig config) { appendable.append("@"); appendable.append(it.getAnnotation()); final Procedure1<LoopParams> _function = (LoopParams it_1) -> { it_1.setPrefix("("); it_1.setSeparator(", "); it_1.setSuffix(")"); }; final Procedure1<JvmAnnotationValue> _function_1 = (JvmAnnotationValue it_1) -> { this.toJava(it_1, appendable, config); }; this._loopExtensions.<JvmAnnotationValue>forEach(appendable, it.getExplicitValues(), _function, _function_1); }
/** * Uses curly braces and comma as delimiters. Doesn't use them for single valued iterables. */ public <T extends Object> void forEachWithShortcut(final ITreeAppendable appendable, final Iterable<T> elements, final Procedure1<? super T> procedure) { int _size = IterableExtensions.size(elements); boolean _equals = (_size == 1); if (_equals) { T _head = IterableExtensions.<T>head(elements); ObjectExtensions.<T>operator_doubleArrow(_head, procedure); } else { appendable.append("{"); final Procedure1<LoopParams> _function = (LoopParams it) -> { it.setPrefix(" "); it.setSeparator(", "); it.setSuffix(" "); }; this.<T>forEach(appendable, elements, _function, procedure); appendable.append("}"); } } }
protected void _toJavaLiteral(final JvmBooleanAnnotationValue it, final ITreeAppendable appendable, final GeneratorConfig config) { final Procedure1<Boolean> _function = (Boolean it_1) -> { appendable.append(it_1.toString()); }; this._loopExtensions.<Boolean>forEachWithShortcut(appendable, it.getValues(), _function); }
public ITreeAppendable generateMembersInBody(final JvmDeclaredType it, final ITreeAppendable appendable, final GeneratorConfig config) { ITreeAppendable _xblockexpression = null; { appendable.append("{").increaseIndentation(); final Procedure1<LoopParams> _function = (LoopParams it_1) -> { final Function1<ITreeAppendable, ITreeAppendable> _function_1 = (ITreeAppendable it_2) -> { return it_2.newLine(); }; it_1.setSeparator(_function_1); }; final Procedure1<JvmMember> _function_1 = (JvmMember it_1) -> { final ITreeAppendable memberAppendable = this._treeAppendableUtil.traceWithComments(appendable, it_1); memberAppendable.openScope(); this.generateMember(it_1, memberAppendable, config); memberAppendable.closeScope(); }; this._loopExtensions.<JvmMember>forEach(appendable, this.getMembersToBeCompiled(it), _function, _function_1); _xblockexpression = appendable.decreaseIndentation().newLine().append("}"); } return _xblockexpression; }
protected void _toJavaLiteral(final JvmByteAnnotationValue it, final ITreeAppendable appendable, final GeneratorConfig config) { final Procedure1<Byte> _function = (Byte it_1) -> { appendable.append(it_1.toString()); }; this._loopExtensions.<Byte>forEachWithShortcut(appendable, it.getValues(), _function); }
this.generateEnumLiteral(it_1, childAppendable.trace(it_1), config); }; this._loopExtensions.<JvmEnumerationLiteral>forEach(childAppendable, it.getLiterals(), _function, _function_1); final Function1<JvmMember, Boolean> _function_2 = (JvmMember it_1) -> { return Boolean.valueOf((!(it_1 instanceof JvmEnumerationLiteral))); this.generateMember(it_1, childAppendable.trace(it_1), config); }; this._loopExtensions.<JvmMember>forEach(childAppendable, IterableExtensions.<JvmMember>filter(this.getMembersToBeCompiled(it), _function_2), _function_3, _function_4); childAppendable.decreaseIndentation().newLine().append("}"); ITreeAppendable _xifexpression = null;
protected void _toJavaLiteral(final JvmShortAnnotationValue it, final ITreeAppendable appendable, final GeneratorConfig config) { final Procedure1<Short> _function = (Short it_1) -> { appendable.append(it_1.toString()); }; this._loopExtensions.<Short>forEachWithShortcut(appendable, it.getValues(), _function); }
memberAppendable.closeScope(); }; this._loopExtensions.<JvmField>forEach(appendable, fieldsWithInitializer, _function_1, _function_2); appendable.decreaseIndentation().newLine().append("}"); memberAppendable.closeScope(); }; this._loopExtensions.<JvmMember>forEach(appendable, this.getMembersToBeCompiled(it), _function_3, _function_4); _xblockexpression = appendable.decreaseIndentation().newLine().append("}");
protected void _toJavaLiteral(final JvmLongAnnotationValue it, final ITreeAppendable appendable, final GeneratorConfig config) { final Procedure1<Long> _function = (Long it_1) -> { appendable.append(it_1.toString()); }; this._loopExtensions.<Long>forEachWithShortcut(appendable, it.getValues(), _function); }
this._loopExtensions.<JvmMember>forEach(childAppendable, this.getAddedDeclarations(it, anonymousClass), _function_2, _function_3); childAppendable.decreaseIndentation().newLine().append("}"); appendable.newLine();
protected void _toJavaLiteral(final JvmAnnotationAnnotationValue value, final ITreeAppendable appendable, final GeneratorConfig config) { final Procedure1<JvmAnnotationReference> _function = (JvmAnnotationReference it) -> { this.generateAnnotation(it, appendable, config); }; this._loopExtensions.<JvmAnnotationReference>forEachWithShortcut(appendable, value.getValues(), _function); }
protected void _toJavaLiteral(final JvmDoubleAnnotationValue it, final ITreeAppendable appendable, final GeneratorConfig config) { final Procedure1<Double> _function = (Double it_1) -> { String _switchResult = null; boolean _matched = false; boolean _isNaN = Double.isNaN((it_1).doubleValue()); if (_isNaN) { _matched=true; _switchResult = "Double.NaN"; } if (!_matched) { if (Objects.equal(it_1, Double.POSITIVE_INFINITY)) { _matched=true; _switchResult = "Double.POSITIVE_INFINITY"; } } if (!_matched) { if (Objects.equal(it_1, Double.NEGATIVE_INFINITY)) { _matched=true; _switchResult = "Double.NEGATIVE_INFINITY"; } } if (!_matched) { String _string = it_1.toString(); _switchResult = (_string + "d"); } appendable.append(_switchResult); }; this._loopExtensions.<Double>forEachWithShortcut(appendable, it.getValues(), _function); }
protected void _toJavaLiteral(final JvmCharAnnotationValue it, final ITreeAppendable appendable, final GeneratorConfig config) { final Procedure1<Character> _function = (Character it_1) -> { String _doConvertToJavaString = this.doConvertToJavaString(it_1.toString()); String _plus = ("\'" + _doConvertToJavaString); String _plus_1 = (_plus + "\'"); appendable.append(_plus_1); }; this._loopExtensions.<Character>forEachWithShortcut(appendable, it.getValues(), _function); }
protected void _toJavaLiteral(final JvmFloatAnnotationValue it, final ITreeAppendable appendable, final GeneratorConfig config) { final Procedure1<Float> _function = (Float it_1) -> { String _switchResult = null; boolean _matched = false; boolean _isNaN = Float.isNaN((it_1).floatValue()); if (_isNaN) { _matched=true; _switchResult = "Float.NaN"; } if (!_matched) { if (Objects.equal(it_1, Float.POSITIVE_INFINITY)) { _matched=true; _switchResult = "Float.POSITIVE_INFINITY"; } } if (!_matched) { if (Objects.equal(it_1, Float.NEGATIVE_INFINITY)) { _matched=true; _switchResult = "Float.NEGATIVE_INFINITY"; } } if (!_matched) { String _string = it_1.toString(); _switchResult = (_string + "f"); } appendable.append(_switchResult); }; this._loopExtensions.<Float>forEachWithShortcut(appendable, it.getValues(), _function); }
protected void _toJavaLiteral(final JvmStringAnnotationValue it, final ITreeAppendable appendable, final GeneratorConfig config) { final Procedure1<String> _function = (String it_1) -> { String _doConvertToJavaString = this.doConvertToJavaString(it_1.toString()); String _plus = ("\"" + _doConvertToJavaString); String _plus_1 = (_plus + "\""); appendable.append(_plus_1); }; this._loopExtensions.<String>forEachWithShortcut(appendable, it.getValues(), _function); }
protected void _toJavaLiteral(final JvmCustomAnnotationValue it, final ITreeAppendable appendable, final GeneratorConfig config) { boolean _isEmpty = it.getValues().isEmpty(); if (_isEmpty) { appendable.append("{}"); } else { final Procedure1<XExpression> _function = (XExpression it_1) -> { this.compiler.toJavaExpression(it_1, appendable); }; this._loopExtensions.<XExpression>forEachWithShortcut(appendable, Iterables.<XExpression>filter(it.getValues(), XExpression.class), _function); } }
protected void _toJavaLiteral(final JvmTypeAnnotationValue it, final ITreeAppendable appendable, final GeneratorConfig config) { final Procedure1<JvmTypeReference> _function = (JvmTypeReference it_1) -> { appendable.append(it_1.getType()).append(".class"); }; this._loopExtensions.<JvmTypeReference>forEachWithShortcut(appendable, it.getValues(), _function); }
protected void _toJavaLiteral(final JvmEnumAnnotationValue it, final ITreeAppendable appendable, final GeneratorConfig config) { final Procedure1<JvmEnumerationLiteral> _function = (JvmEnumerationLiteral it_1) -> { appendable.append(it_1.getDeclaringType()); appendable.append("."); appendable.append(this.makeJavaIdentifier(it_1.getSimpleName())); }; this._loopExtensions.<JvmEnumerationLiteral>forEachWithShortcut(appendable, it.getValues(), _function); }