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

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

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

Util.findLineSeparator介绍

[英]Finds the first line separator used by the given text.
[中]查找给定文本使用的第一行分隔符。

代码示例

代码示例来源:origin: com.vaadin/vaadin-client-compiler-deps

/**
 * Returns the line separator used by the given buffer.
 * Uses the given text if none found.
 *
 * @return </code>"\n"</code> or </code>"\r"</code> or  </code>"\r\n"</code>
 */
private static String getLineSeparator(char[] text, char[] buffer) {
  // search in this buffer's contents first
  String lineSeparator = findLineSeparator(buffer);
  if (lineSeparator == null) {
    // search in the given text
    lineSeparator = findLineSeparator(text);
    if (lineSeparator == null) {
      // default to system line separator
      return getLineSeparator((String) null, (IJavaProject) null);
    }
  }
  return lineSeparator;
}

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

/**
 * Returns the line separator used by the given buffer.
 * Uses the given text if none found.
 *
 * @return </code>"\n"</code> or </code>"\r"</code> or  </code>"\r\n"</code>
 */
private static String getLineSeparator(char[] text, char[] buffer) {
  // search in this buffer's contents first
  String lineSeparator = findLineSeparator(buffer);
  if (lineSeparator == null) {
    // search in the given text
    lineSeparator = findLineSeparator(text);
    if (lineSeparator == null) {
      // default to system line separator
      return getLineSeparator((String) null, (IJavaProject) null);
    }
  }
  return lineSeparator;
}

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

/**
 * Returns the line separator used by the given buffer.
 * Uses the given text if none found.
 *
 * @return </code>"\n"</code> or </code>"\r"</code> or  </code>"\r\n"</code>
 */
private static String getLineSeparator(char[] text, char[] buffer) {
  // search in this buffer's contents first
  String lineSeparator = findLineSeparator(buffer);
  if (lineSeparator == null) {
    // search in the given text
    lineSeparator = findLineSeparator(text);
    if (lineSeparator == null) {
      // default to system line separator
      return getLineSeparator((String) null, (IJavaProject) null);
    }
  }
  return lineSeparator;
}

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

/**
 * Returns the line separator used by the given buffer.
 * Uses the given text if none found.
 *
 * @return </code>"\n"</code> or </code>"\r"</code> or  </code>"\r\n"</code>
 */
private static String getLineSeparator(char[] text, char[] buffer) {
  // search in this buffer's contents first
  String lineSeparator = findLineSeparator(buffer);
  if (lineSeparator == null) {
    // search in the given text
    lineSeparator = findLineSeparator(text);
    if (lineSeparator == null) {
      // default to system line separator
      return getLineSeparator((String) null, (IJavaProject) null);
    }
  }
  return lineSeparator;
}

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

/**
 * Returns the line separator used by the given buffer.
 * Uses the given text if none found.
 *
 * @return </code>"\n"</code> or </code>"\r"</code> or  </code>"\r\n"</code>
 */
private static String getLineSeparator(char[] text, char[] buffer) {
  // search in this buffer's contents first
  String lineSeparator = findLineSeparator(buffer);
  if (lineSeparator == null) {
    // search in the given text
    lineSeparator = findLineSeparator(text);
    if (lineSeparator == null) {
      // default to system line separator
      return getLineSeparator((String) null, (IJavaProject) null);
    }
  }
  return lineSeparator;
}

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

/**
 * Returns the line separator used by the given buffer.
 * Uses the given text if none found.
 *
 * @return </code>"\n"</code> or </code>"\r"</code> or  </code>"\r\n"</code>
 */
private static String getLineSeparator(char[] text, char[] buffer) {
  // search in this buffer's contents first
  String lineSeparator = findLineSeparator(buffer);
  if (lineSeparator == null) {
    // search in the given text
    lineSeparator = findLineSeparator(text);
    if (lineSeparator == null) {
      // default to system line separator
      return getLineSeparator((String) null, (IJavaProject) null);
    }
  }
  return lineSeparator;
}

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

/**
 * Returns the line separator used by the given buffer.
 * Uses the given text if none found.
 *
 * @return </code>"\n"</code> or </code>"\r"</code> or  </code>"\r\n"</code>
 */
private static String getLineSeparator(char[] text, char[] buffer) {
  // search in this buffer's contents first
  String lineSeparator = findLineSeparator(buffer);
  if (lineSeparator == null) {
    // search in the given text
    lineSeparator = findLineSeparator(text);
    if (lineSeparator == null) {
      // default to system line separator
      return getLineSeparator((String) null, (IJavaProject) null);
    }
  }
  return lineSeparator;
}

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

lineSeparator = findLineSeparator(text.toCharArray());
if (lineSeparator != null)
  return lineSeparator;

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

if (bugs != null) {
      StringBuffer message = new StringBuffer("Bad AST node structure:");  //$NON-NLS-1$
      String lineDelimiter = Util.findLineSeparator(source);
      if (lineDelimiter == null) lineDelimiter = System.getProperty("line.separator");//$NON-NLS-1$
      message.append(lineDelimiter);
} catch(IllegalArgumentException e) {
  StringBuffer message = new StringBuffer("Exception occurred during compilation unit conversion:");  //$NON-NLS-1$
  String lineDelimiter = Util.findLineSeparator(source);
  if (lineDelimiter == null) lineDelimiter = System.getProperty("line.separator");//$NON-NLS-1$
  message.append(lineDelimiter);

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

lineSeparator = findLineSeparator(text.toCharArray());
if (lineSeparator != null)
  return lineSeparator;

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

lineSeparator = findLineSeparator(text.toCharArray());
if (lineSeparator != null)
  return lineSeparator;

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

lineSeparator = findLineSeparator(text.toCharArray());
if (lineSeparator != null)
  return lineSeparator;

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

lineSeparator = findLineSeparator(text.toCharArray());
if (lineSeparator != null)
  return lineSeparator;

代码示例来源:origin: com.vaadin/vaadin-client-compiler-deps

lineSeparator = findLineSeparator(text.toCharArray());
if (lineSeparator != null)
  return lineSeparator;

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

lineSeparator = findLineSeparator(text.toCharArray());
if (lineSeparator != null)
  return lineSeparator;

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

if (bugs != null) {
      StringBuffer message = new StringBuffer("Bad AST node structure:");  //$NON-NLS-1$
      String lineDelimiter = Util.findLineSeparator(source);
      if (lineDelimiter == null) lineDelimiter = System.getProperty("line.separator");//$NON-NLS-1$
      message.append(lineDelimiter);
} catch(IllegalArgumentException e) {
  StringBuffer message = new StringBuffer("Exception occurred during compilation unit conversion:");  //$NON-NLS-1$
  String lineDelimiter = Util.findLineSeparator(source);
  if (lineDelimiter == null) lineDelimiter = System.getProperty("line.separator");//$NON-NLS-1$
  message.append(lineDelimiter);

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

if (bugs != null) {
      StringBuffer message = new StringBuffer("Bad AST node structure:");  //$NON-NLS-1$
      String lineDelimiter = Util.findLineSeparator(source);
      if (lineDelimiter == null) lineDelimiter = System.getProperty("line.separator");//$NON-NLS-1$
      message.append(lineDelimiter);
} catch(IllegalArgumentException e) {
  StringBuffer message = new StringBuffer("Exception occurred during compilation unit conversion:");  //$NON-NLS-1$
  String lineDelimiter = Util.findLineSeparator(source);
  if (lineDelimiter == null) lineDelimiter = System.getProperty("line.separator");//$NON-NLS-1$
  message.append(lineDelimiter);

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

if (bugs != null) {
      StringBuffer message = new StringBuffer("Bad AST node structure:");  //$NON-NLS-1$
      String lineDelimiter = Util.findLineSeparator(source);
      if (lineDelimiter == null) lineDelimiter = System.getProperty("line.separator");//$NON-NLS-1$
      message.append(lineDelimiter);
} catch(IllegalArgumentException e) {
  StringBuffer message = new StringBuffer("Exception occurred during compilation unit conversion:");  //$NON-NLS-1$
  String lineDelimiter = Util.findLineSeparator(source);
  if (lineDelimiter == null) lineDelimiter = System.getProperty("line.separator");//$NON-NLS-1$
  message.append(lineDelimiter);

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

if (bugs != null) {
      StringBuffer message = new StringBuffer("Bad AST node structure:");  //$NON-NLS-1$
      String lineDelimiter = Util.findLineSeparator(source);
      if (lineDelimiter == null) lineDelimiter = System.getProperty("line.separator");//$NON-NLS-1$
      message.append(lineDelimiter);
} catch(IllegalArgumentException e) {
  StringBuffer message = new StringBuffer("Exception occurred during compilation unit conversion:");  //$NON-NLS-1$
  String lineDelimiter = Util.findLineSeparator(source);
  if (lineDelimiter == null) lineDelimiter = System.getProperty("line.separator");//$NON-NLS-1$
  message.append(lineDelimiter);

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

} catch(IllegalArgumentException e) {
  StringBuffer message = new StringBuffer("Exception occurred during compilation unit conversion:");  //$NON-NLS-1$
  String lineDelimiter = Util.findLineSeparator(source);
  if (lineDelimiter == null) lineDelimiter = System.getProperty("line.separator");//$NON-NLS-1$
  message.append(lineDelimiter);

相关文章

微信公众号

最新文章

更多

Util类方法