org.eclipse.jdt.internal.core.util.Util.getLineSeparator()方法的使用及代码示例

x33g5p2x  于2022-02-01 转载在 其他  
字(6.8k)|赞(0)|评价(0)|浏览(166)

本文整理了Java中org.eclipse.jdt.internal.core.util.Util.getLineSeparator()方法的一些代码示例,展示了Util.getLineSeparator()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Util.getLineSeparator()方法的具体详情如下:
包路径:org.eclipse.jdt.internal.core.util.Util
类名称:Util
方法名:getLineSeparator

Util.getLineSeparator介绍

[英]Returns the line separator found in the given text. If it is null, or not found return the line delimiter for the given project. If the project is null, returns the line separator for the workspace. If still null, return the system line separator.
[中]返回在给定文本中找到的行分隔符。如果为空或未找到,请返回给定项目的行分隔符。如果项目为空,则返回工作区的行分隔符。如果仍然为空,则返回系统行分隔符。

代码示例

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

/**
 * Creates a new DOM factory.
 */
public DOMFactory() {
  // constructor is explicitly API
  this.lineSeparator = org.eclipse.jdt.internal.core.util.Util.getLineSeparator(null, null/*take the workspace line separator as no project is available*/);
}
/* (non-Javadoc)

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

/**
 * Creates a new DOM factory.
 */
public DOMFactory() {
  // constructor is explicitly API
  this.lineSeparator = org.eclipse.jdt.internal.core.util.Util.getLineSeparator(null, null/*take the workspace line separator as no project is available*/);
}
/* (non-Javadoc)

代码示例来源:origin: trylimits/Eclipse-Postfix-Code-Completion

/**
 * Creates a new DOM factory.
 */
public DOMFactory() {
  // constructor is explicitly API
  this.lineSeparator = org.eclipse.jdt.internal.core.util.Util.getLineSeparator(null, null/*take the workspace line separator as no project is available*/);
}
/* (non-Javadoc)

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

public XMLWriter(Writer writer, IJavaProject project, boolean printXmlVersion) {
    super(writer, Util.getLineSeparator((String) null, project), printXmlVersion);
  }
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

/**
 * Creates a new DOM factory.
 */
public DOMFactory() {
  // constructor is explicitly API
  this.lineSeparator = org.eclipse.jdt.internal.core.util.Util.getLineSeparator(null, null/*take the workspace line separator as no project is available*/);
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

public XMLWriter(Writer writer, IJavaProject project, boolean printXmlVersion) {
    super(writer, Util.getLineSeparator((String) null, project), printXmlVersion);
  }
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

public XMLWriter(Writer writer, IJavaProject project, boolean printXmlVersion) {
    super(writer, Util.getLineSeparator((String) null, project), printXmlVersion);
  }
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

public XMLWriter(Writer writer, IJavaProject project, boolean printXmlVersion) {
    super(writer, Util.getLineSeparator((String) null, project), printXmlVersion);
  }
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

public String findRecommendedLineSeparator() throws JavaModelException {
  IBuffer buffer = getBuffer();
  String source = buffer == null ? null : buffer.getContents();
  return Util.getLineSeparator(source, getJavaProject());
}
protected void generateInfos(Object info, HashMap newElements, IProgressMonitor monitor) throws JavaModelException {

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

/**
 * @see IJavaProject#newEvaluationContext()
 */
@Override
public IEvaluationContext newEvaluationContext() {
  EvaluationContext context = new EvaluationContext();
  context.setLineSeparator(Util.getLineSeparator(null/*no existing source*/, this));
  return new EvaluationContextWrapper(context, this);
}

代码示例来源:origin: org.eclipse.jdt/org.eclipse.jdt.core

@Override
public String findRecommendedLineSeparator() throws JavaModelException {
  IBuffer buffer = getBuffer();
  String source = buffer == null ? null : buffer.getContents();
  return Util.getLineSeparator(source, getJavaProject());
}
@Override

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

public String findRecommendedLineSeparator() throws JavaModelException {
  IBuffer buffer = getBuffer();
  String source = buffer == null ? null : buffer.getContents();
  return Util.getLineSeparator(source, getJavaProject());
}
protected void generateInfos(Object info, HashMap newElements, IProgressMonitor monitor) throws JavaModelException {

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

public String findRecommendedLineSeparator() throws JavaModelException {
  IBuffer buffer = getBuffer();
  String source = buffer == null ? null : buffer.getContents();
  return Util.getLineSeparator(source, getJavaProject());
}
protected void generateInfos(Object info, HashMap newElements, IProgressMonitor monitor) throws JavaModelException {

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

public String findRecommendedLineSeparator() throws JavaModelException {
  IBuffer buffer = getBuffer();
  String source = buffer == null ? null : buffer.getContents();
  return Util.getLineSeparator(source, getJavaProject());
}
protected void generateInfos(Object info, HashMap newElements, IProgressMonitor monitor) throws JavaModelException {

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

/**
 * @see IJavaProject#newEvaluationContext()
 */
public IEvaluationContext newEvaluationContext() {
  EvaluationContext context = new EvaluationContext();
  context.setLineSeparator(Util.getLineSeparator(null/*no existing source*/, this));
  return new EvaluationContextWrapper(context, this);
}

代码示例来源:origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

/**
 * @see IJavaProject#newEvaluationContext()
 */
public IEvaluationContext newEvaluationContext() {
  EvaluationContext context = new EvaluationContext();
  context.setLineSeparator(Util.getLineSeparator(null/*no existing source*/, this));
  return new EvaluationContextWrapper(context, this);
}

代码示例来源:origin: org.jibx.config.3rdparty.org.eclipse/org.eclipse.jdt.core

/**
 * @see IJavaProject#newEvaluationContext()
 */
public IEvaluationContext newEvaluationContext() {
  EvaluationContext context = new EvaluationContext();
  context.setLineSeparator(Util.getLineSeparator(null/*no existing source*/, this));
  return new EvaluationContextWrapper(context, this);
}

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

/**
 * @see IDOMMethod#setBody
 */
public void setBody(String body) {
  becomeDetailed();
  fragment();
  this.fBody= body;
  setHasBody(body != null);
  if (!hasBody()) {
    this.fBody= ";" + Util.getLineSeparator(body, null); //$NON-NLS-1$
  }
}
/**

代码示例来源:origin: org.eclipse.tycho/org.eclipse.jdt.core

/**
 * @see DOMMember#appendMemberBodyContents(CharArrayBuffer)
 */
protected void appendMemberBodyContents(CharArrayBuffer buffer) {
  if (hasBody()) {
    buffer
      .append(getBody())
      .append(this.fDocument, this.fBodyRange[1] + 1, this.fSourceRange[1] - this.fBodyRange[1]);
  } else {
    buffer.append("{}").append(Util.getLineSeparator(buffer.toString(), null)); //$NON-NLS-1$
  }
}
/**

代码示例来源:origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.core

/**
 * @see DOMMember#appendMemberBodyContents(CharArrayBuffer)
 */
protected void appendMemberBodyContents(CharArrayBuffer buffer) {
  if (hasBody()) {
    buffer
      .append(getBody())
      .append(this.fDocument, this.fBodyRange[1] + 1, this.fSourceRange[1] - this.fBodyRange[1]);
  } else {
    buffer.append("{}").append(Util.getLineSeparator(buffer.toString(), null)); //$NON-NLS-1$
  }
}
/**

相关文章

微信公众号

最新文章

更多

Util类方法