Java 类org.eclipse.xtext.xbase.lib.util.ToStringBuilder 实例源码

项目:xtext-extras    文件:JvmTypesBuilder.java   
/**
 * Creates a <code>toString()</code> method accumulating the values of all fields.
 *
 * @return a result representing a Java toString() method, <code>null</code> if sourceElement or declaredType are <code>null</code>.
 */
/* @Nullable */ 
public JvmOperation toToStringMethod(/* @Nullable */ final EObject sourceElement, /* @Nullable */ final JvmDeclaredType declaredType) {
    if(sourceElement == null || declaredType == null)
        return null;
    JvmOperation result = toMethod(sourceElement, "toString", newTypeRef(sourceElement, String.class), null);
    if (result == null)
        return null;
    JvmType overrideType = references.findDeclaredType(Override.class, sourceElement);
    if (overrideType != null)
        result.getAnnotations().add(toAnnotation(sourceElement, Override.class));
    setBody(result, new Procedure1<ITreeAppendable>() {
        @Override
        public void apply(/* @Nullable */ ITreeAppendable p) {
            if (p == null)
                return;
            p.append("String result = new ");
            p.append(ToStringBuilder.class);
            p.append("(this).addAllFields().toString();");
            p.newLine().append("return result;");
        }
    });
    return result;
}
项目:xtext-lib    文件:ToStringHelperTest.java   
@Test
public void testExplicitFieldListing() {
  ToStringHelperTest.MyEntity _myEntity = new ToStringHelperTest.MyEntity();
  final ToStringBuilder helper = new ToStringBuilder(_myEntity).add("boolProp", Boolean.valueOf(false)).addField("intProp");
  StringConcatenation _builder = new StringConcatenation();
  _builder.append("MyEntity [");
  _builder.newLine();
  _builder.append("  ");
  _builder.append("boolProp = false");
  _builder.newLine();
  _builder.append("  ");
  _builder.append("intProp = 42");
  _builder.newLine();
  _builder.append("]");
  Assert.assertEquals(
    ToStringHelperTest.toUnix(_builder.toString()), helper.toString());
}
项目:lsp4j    文件:CompletionItem.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("label", this.label);
  b.add("kind", this.kind);
  b.add("detail", this.detail);
  b.add("documentation", this.documentation);
  b.add("sortText", this.sortText);
  b.add("filterText", this.filterText);
  b.add("insertText", this.insertText);
  b.add("insertTextFormat", this.insertTextFormat);
  b.add("textEdit", this.textEdit);
  b.add("additionalTextEdits", this.additionalTextEdits);
  b.add("command", this.command);
  b.add("data", this.data);
  return b.toString();
}
项目:xtext-core    文件:ContentAssistEntry.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.skipNulls();
  b.add("prefix", this.prefix);
  b.add("proposal", this.proposal);
  b.add("label", this.label);
  b.add("description", this.description);
  b.add("documentation", this.documentation);
  b.add("escapePosition", this.escapePosition);
  b.add("textReplacements", this.textReplacements);
  b.add("editPositions", this.editPositions);
  b.add("kind", this.kind);
  return b.toString();
}
项目:lsp4j    文件:RegistrationParams.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("registrations", this.registrations);
  return b.toString();
}
项目:lsp4j    文件:SetExceptionBreakpointsArguments.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("filters", this.filters);
  b.add("exceptionOptions", this.exceptionOptions);
  return b.toString();
}
项目:xtext-extras    文件:LightweightMergedBoundTypeArgument.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("typeReference", this.typeReference);
  b.add("variance", this.variance);
  return b.toString();
}
项目:lsp4j    文件:CompletionsArguments.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("frameId", this.frameId);
  b.add("text", this.text);
  b.add("column", this.column);
  b.add("line", this.line);
  return b.toString();
}
项目:lsp4j    文件:MessageActionItem.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("title", this.title);
  return b.toString();
}
项目:lsp4j    文件:CompletionRegistrationOptions.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("triggerCharacters", this.triggerCharacters);
  b.add("resolveProvider", this.resolveProvider);
  b.add("documentSelector", getDocumentSelector());
  return b.toString();
}
项目:xtext-extras    文件:ThisReference.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("type", this.type);
  return b.toString();
}
项目:xtext-extras    文件:EvaluationResult.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("rawValue", this.rawValue);
  b.add("compileTimeConstant", this.compileTimeConstant);
  return b.toString();
}
项目:lsp4j    文件:OnTypeFormattingCapabilities.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("dynamicRegistration", getDynamicRegistration());
  return b.toString();
}
项目:xtext-extras    文件:TypeWithRestrictedNamesBucket.java   
@Override
@Pure
public String toString() {
  String result = new ToStringBuilder(this)
    .addAllFields()
    .toString();
  return result;
}
项目:SOMns-vscode    文件:WillSaveTextDocumentParams.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("textDocument", this.textDocument);
  b.add("reason", this.reason);
  return b.toString();
}
项目:lsp4j    文件:SignatureHelpOptions.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("triggerCharacters", this.triggerCharacters);
  return b.toString();
}
项目:lsp4j    文件:Breakpoint.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("id", this.id);
  b.add("verified", this.verified);
  b.add("message", this.message);
  b.add("source", this.source);
  b.add("line", this.line);
  b.add("column", this.column);
  b.add("endLine", this.endLine);
  b.add("endColumn", this.endColumn);
  return b.toString();
}
项目:xtext-extras    文件:HiddenLeafs.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("offset", this.offset);
  b.add("leafs", this.leafs);
  return b.toString();
}
项目:lsp4j    文件:ModuleEventArguments.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("reason", this.reason);
  b.add("module", this.module);
  return b.toString();
}
项目:lsp4j    文件:Checksum.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("algorithm", this.algorithm);
  b.add("checksum", this.checksum);
  return b.toString();
}
项目:xtext-extras    文件:NewLineData.java   
@Override
@Pure
public String toString() {
  String result = new ToStringBuilder(this)
    .addAllFields()
    .toString();
  return result;
}
项目:xtext-extras    文件:FormattingData.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("offset", this.offset);
  b.add("length", this.length);
  b.add("increaseIndentationChange", this.increaseIndentationChange);
  b.add("decreaseIndentationChange", this.decreaseIndentationChange);
  b.add("trace", this.trace);
  return b.toString();
}
项目:xtext-extras    文件:WhitespaceData.java   
@Override
@Pure
public String toString() {
  String result = new ToStringBuilder(this)
    .addAllFields()
    .toString();
  return result;
}
项目:xtext-extras    文件:LeafInfo.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("container", this.container);
  b.add("node", this.node);
  b.add("newLines", this.newLines);
  return b.toString();
}
项目:lsp4j    文件:SignatureHelp.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("signatures", this.signatures);
  b.add("activeSignature", this.activeSignature);
  b.add("activeParameter", this.activeParameter);
  return b.toString();
}
项目:lsp4j    文件:CodeLensCapabilities.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("dynamicRegistration", getDynamicRegistration());
  return b.toString();
}
项目:lsp4j    文件:MessageParams.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("type", this.type);
  b.add("message", this.message);
  return b.toString();
}
项目:lsp4j    文件:TextDocumentContentChangeEvent.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("range", this.range);
  b.add("rangeLength", this.rangeLength);
  b.add("text", this.text);
  return b.toString();
}
项目:SOMns-vscode    文件:ClientCapabilities.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("workspace", this.workspace);
  b.add("textDocument", this.textDocument);
  b.add("experimental", this.experimental);
  return b.toString();
}
项目:xtext-core    文件:EPackageInfo.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("ePackage", this.ePackage);
  b.add("ePackageImportURI", this.ePackageImportURI);
  b.add("genmodelURI", this.genmodelURI);
  b.add("ePackageJavaFQN", this.ePackageJavaFQN);
  b.add("bundleID", this.bundleID);
  return b.toString();
}
项目:xtext-core    文件:ProjectDescription.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("name", this.name);
  b.add("dependencies", this.dependencies);
  return b.toString();
}
项目:xtext-core    文件:AlternativeImageDescription.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("imageIDs", this.imageIDs);
  return b.toString();
}
项目:lsp4j    文件:SetBreakpointsResponse.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("breakpoints", this.breakpoints);
  return b.toString();
}
项目:lsp4j    文件:ApplyWorkspaceEditParams.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("edit", this.edit);
  return b.toString();
}
项目:lsp4j    文件:CompletionItem.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("label", this.label);
  b.add("text", this.text);
  b.add("type", this.type);
  b.add("start", this.start);
  b.add("length", this.length);
  return b.toString();
}
项目:lsp4j    文件:Position.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("line", this.line);
  b.add("character", this.character);
  return b.toString();
}
项目:lsp4j    文件:DidChangeWorkspaceFoldersParams.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("event", this.event);
  return b.toString();
}
项目:lsp4j    文件:TextDocumentRegistrationOptions.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("documentSelector", this.documentSelector);
  return b.toString();
}
项目:SOMns-vscode    文件:CompletionCapabilities.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("completionItem", this.completionItem);
  b.add("dynamicRegistration", getDynamicRegistration());
  return b.toString();
}
项目:SOMns-vscode    文件:HoverCapabilities.java   
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("dynamicRegistration", getDynamicRegistration());
  return b.toString();
}