org.eclipse.xtext.xbase.lib.util.ToStringBuilder Java Examples

The following examples show how to use org.eclipse.xtext.xbase.lib.util.ToStringBuilder. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: JvmTypesBuilder.java    From xtext-extras with Eclipse Public License 2.0 6 votes vote down vote up
/**
 * 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;
}
 
Example #2
Source File: CompletionItem.java    From lsp4j with Eclipse Public License 2.0 6 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("label", this.label);
  b.add("kind", this.kind);
  b.add("tags", this.tags);
  b.add("detail", this.detail);
  b.add("documentation", this.documentation);
  b.add("deprecated", this.deprecated);
  b.add("preselect", this.preselect);
  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("commitCharacters", this.commitCharacters);
  b.add("command", this.command);
  b.add("data", this.data);
  return b.toString();
}
 
Example #3
Source File: BspConnectionDetails.java    From build-server-protocol with Apache License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("name", this.name);
  b.add("argv", this.argv);
  b.add("version", this.version);
  b.add("bspVersion", this.bspVersion);
  b.add("languages", this.languages);
  return b.toString();
}
 
Example #4
Source File: ResourceContentResult.java    From xtext-web with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public String toString() {
	ToStringBuilder b = new ToStringBuilder(this);
	b.add("fullText", this.fullText);
	b.add("stateId", this.stateId);
	b.add("dirty", this.dirty);
	return b.toString();
}
 
Example #5
Source File: WorkspaceEditCapabilities.java    From lsp4j with Eclipse Public License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("documentChanges", this.documentChanges);
  b.add("resourceChanges", this.resourceChanges);
  b.add("resourceOperations", this.resourceOperations);
  b.add("failureHandling", this.failureHandling);
  return b.toString();
}
 
Example #6
Source File: DidChangeWorkspaceFoldersParams.java    From lsp4j with Eclipse Public License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("event", this.event);
  return b.toString();
}
 
Example #7
Source File: Event.java    From sarl with Apache License 2.0 5 votes vote down vote up
@Override
@Pure
public final String toString() {
	final ToStringBuilder builder = new ToStringBuilder(this);
	toString(builder);
	return builder.toString();
}
 
Example #8
Source File: GuiceModuleAccess.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public String toString() {
	ToStringBuilder b = new ToStringBuilder(this);
	b.add("expression", expression);
	b.add("type", type);
	b.add("provider", provider);
	b.add("statements", statements);
	return b.toString();
}
 
Example #9
Source File: TextDocumentIdentifier.java    From build-server-protocol with Apache License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("uri", this.uri);
  return b.toString();
}
 
Example #10
Source File: Location.java    From build-server-protocol with Apache License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("uri", this.uri);
  b.add("range", this.range);
  return b.toString();
}
 
Example #11
Source File: CompileTask.java    From build-server-protocol with Apache License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("target", this.target);
  return b.toString();
}
 
Example #12
Source File: AttachRequestArguments.java    From lsp4j with Eclipse Public License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("__restart", this.__restart);
  return b.toString();
}
 
Example #13
Source File: DebugSessionAddress.java    From build-server-protocol with Apache License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("uri", this.uri);
  return b.toString();
}
 
Example #14
Source File: VariablesResponse.java    From lsp4j with Eclipse Public License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("variables", this.variables);
  return b.toString();
}
 
Example #15
Source File: DocumentRangeFormattingParams.java    From lsp4j with Eclipse Public License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("range", this.range);
  b.add("textDocument", getTextDocument());
  b.add("options", getOptions());
  return b.toString();
}
 
Example #16
Source File: CompileReport.java    From build-server-protocol with Apache License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("target", this.target);
  b.add("originId", this.originId);
  b.add("errors", this.errors);
  b.add("warnings", this.warnings);
  b.add("time", this.time);
  return b.toString();
}
 
Example #17
Source File: ModulesResponse.java    From lsp4j with Eclipse Public License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("modules", this.modules);
  b.add("totalModules", this.totalModules);
  return b.toString();
}
 
Example #18
Source File: H2.java    From xtext-xtend with Eclipse Public License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  return new ToStringBuilder(this)
  	.addAllFields()
  	.toString();
}
 
Example #19
Source File: Color.java    From lsp4j with Eclipse Public License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("red", this.red);
  b.add("green", this.green);
  b.add("blue", this.blue);
  b.add("alpha", this.alpha);
  return b.toString();
}
 
Example #20
Source File: DeleteFileOptions.java    From lsp4j with Eclipse Public License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("recursive", this.recursive);
  b.add("ignoreIfNotExists", this.ignoreIfNotExists);
  return b.toString();
}
 
Example #21
Source File: SelectionRangeParams.java    From lsp4j with Eclipse Public License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("textDocument", this.textDocument);
  b.add("positions", this.positions);
  return b.toString();
}
 
Example #22
Source File: ColorProviderCapabilities.java    From lsp4j with Eclipse Public License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("dynamicRegistration", getDynamicRegistration());
  return b.toString();
}
 
Example #23
Source File: DecoratedImageDescription.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public String toString() {
	ToStringBuilder b = new ToStringBuilder(this);
	b.add("baseImage", baseImage);
	b.add("decorators", decorators);
	return b.toString();
}
 
Example #24
Source File: ScalaTestClassesItem.java    From build-server-protocol with Apache License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("target", this.target);
  b.add("classes", this.classes);
  return b.toString();
}
 
Example #25
Source File: ColorPresentation.java    From lsp4j with Eclipse Public License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("label", this.label);
  b.add("textEdit", this.textEdit);
  b.add("additionalTextEdits", this.additionalTextEdits);
  return b.toString();
}
 
Example #26
Source File: ReadMemoryResponse.java    From lsp4j with Eclipse Public License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("address", this.address);
  b.add("unreadableBytes", this.unreadableBytes);
  b.add("data", this.data);
  return b.toString();
}
 
Example #27
Source File: CodeLensCapabilities.java    From lsp4j with Eclipse Public License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("dynamicRegistration", getDynamicRegistration());
  return b.toString();
}
 
Example #28
Source File: VersionedTextDocumentIdentifier.java    From lsp4j with Eclipse Public License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("version", this.version);
  b.add("uri", getUri());
  return b.toString();
}
 
Example #29
Source File: DefinitionParams.java    From lsp4j with Eclipse Public License 2.0 5 votes vote down vote up
@Override
@Pure
public String toString() {
  ToStringBuilder b = new ToStringBuilder(this);
  b.add("textDocument", getTextDocument());
  b.add("uri", getUri());
  b.add("position", getPosition());
  return b.toString();
}
 
Example #30
Source File: BuildManager.java    From xtext-core with Eclipse Public License 2.0 5 votes vote down vote up
@Override
public String toString() {
	ToStringBuilder b = new ToStringBuilder(this);
	b.add("dirtyFiles", dirtyFiles);
	b.add("deletedFiles", deletedFiles);
	return b.toString();
}