@Override public TreeAppendable increaseIndentation() { closeLastChild(); state.increaseIndentation(); return this; }
@Override public ITreeAppendable append(Class<?> type) { closeLastChild(); state.appendType(type, this); return this; }
protected ITreeAppendable openErrorAppendable(final ITreeAppendable parent, final ITreeAppendable child) { ITreeAppendable _xifexpression = null; if ((!(child instanceof ErrorTreeAppendable))) { _xifexpression = parent.errorChild().append("/* "); } else { _xifexpression = child; } return _xifexpression; }
protected void writeElse() { currentAppendable = null; appendable.decreaseIndentation(); appendable.newLine(); appendable.append("} else {"); appendable.increaseIndentation(); }
/** * Close a block of code. * * @param appendable the receiver of the block closing code. */ protected void closeBlock(ITreeAppendable appendable) { appendable.decreaseIndentation(); appendable.newLine().append("}"); }
/** Generate the Java code related to the expression for the continue keyword. * * @param breakExpression the expression. * @param appendable the output. * @since 0.7 */ @SuppressWarnings("static-method") protected void _toJavaExpression(SarlContinueExpression breakExpression, ITreeAppendable appendable) { appendable.append("/* error - couldn't compile nested continue */"); //$NON-NLS-1$ }
@Override public ITreeAppendable newLine() { this.delegate.newLine(); return this; }
protected String getVarName(Object ex, ITreeAppendable appendable) { String name = appendable.getName(ex); return name; }
@Override public TreeAppendable decreaseIndentation() { closeLastChild(); state.decreaseIndentation(); return this; }
@Override public TreeAppendable newLine() { closeLastChild(); state.appendNewLineAndIndentation(this); return this; }
protected boolean hasVisibleChildren(TreeAppendable castedChild) { for(Object o: castedChild.getChildren()) { if (o instanceof String) return true; if (hasVisibleChildren((TreeAppendable) o)) return true; } return false; }
public ImportingStringConcatenation(final SharedAppendableState state, final ITypeReferenceOwner typeReferenceOwner) { super(state.getLineSeparator()); this.importManager = state.getImportManager(); this.typeReferenceOwner = typeReferenceOwner; }
protected void compressTrace(String completeContent) { leftCompressTrace(completeContent); rightCompressTrace(completeContent); }
/** * Manipulate the given appendable or return a new one. * @param original the visited {@link TreeAppendable} * @return the original appendable or a new one. */ protected TreeAppendable visit(TreeAppendable original) { visitChildren(original); return original; }
@Override public String toString() { return this.delegate.toString(); } }
@Override protected String getRemoteText(SourceRelativeURI uri) { return AppendableBasedTraceRegion.this.getRoot().sourceText; }
@Override public ITreeAppendable append(CharSequence content) { this.delegate.append(content); return this; }
@Override public TreeAppendable append(JvmType type) { closeLastChild(); state.appendType(type, this); return this; }
public Function1<? super ITreeAppendable, ? extends ITreeAppendable> setSuffix(final String suffix) { final Function1<ITreeAppendable, ITreeAppendable> _function = (ITreeAppendable it) -> { return it.append(suffix); }; return this.suffix = _function; }
@Override public ITreeAppendable append(Class<?> type) { this.delegate.append(type); return this; }