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

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

本文整理了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

  1. /**
  2. * Returns the line separator used by the given buffer.
  3. * Uses the given text if none found.
  4. *
  5. * @return </code>"\n"</code> or </code>"\r"</code> or </code>"\r\n"</code>
  6. */
  7. private static String getLineSeparator(char[] text, char[] buffer) {
  8. // search in this buffer's contents first
  9. String lineSeparator = findLineSeparator(buffer);
  10. if (lineSeparator == null) {
  11. // search in the given text
  12. lineSeparator = findLineSeparator(text);
  13. if (lineSeparator == null) {
  14. // default to system line separator
  15. return getLineSeparator((String) null, (IJavaProject) null);
  16. }
  17. }
  18. return lineSeparator;
  19. }

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

  1. /**
  2. * Returns the line separator used by the given buffer.
  3. * Uses the given text if none found.
  4. *
  5. * @return </code>"\n"</code> or </code>"\r"</code> or </code>"\r\n"</code>
  6. */
  7. private static String getLineSeparator(char[] text, char[] buffer) {
  8. // search in this buffer's contents first
  9. String lineSeparator = findLineSeparator(buffer);
  10. if (lineSeparator == null) {
  11. // search in the given text
  12. lineSeparator = findLineSeparator(text);
  13. if (lineSeparator == null) {
  14. // default to system line separator
  15. return getLineSeparator((String) null, (IJavaProject) null);
  16. }
  17. }
  18. return lineSeparator;
  19. }

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

  1. /**
  2. * Returns the line separator used by the given buffer.
  3. * Uses the given text if none found.
  4. *
  5. * @return </code>"\n"</code> or </code>"\r"</code> or </code>"\r\n"</code>
  6. */
  7. private static String getLineSeparator(char[] text, char[] buffer) {
  8. // search in this buffer's contents first
  9. String lineSeparator = findLineSeparator(buffer);
  10. if (lineSeparator == null) {
  11. // search in the given text
  12. lineSeparator = findLineSeparator(text);
  13. if (lineSeparator == null) {
  14. // default to system line separator
  15. return getLineSeparator((String) null, (IJavaProject) null);
  16. }
  17. }
  18. return lineSeparator;
  19. }

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

  1. /**
  2. * Returns the line separator used by the given buffer.
  3. * Uses the given text if none found.
  4. *
  5. * @return </code>"\n"</code> or </code>"\r"</code> or </code>"\r\n"</code>
  6. */
  7. private static String getLineSeparator(char[] text, char[] buffer) {
  8. // search in this buffer's contents first
  9. String lineSeparator = findLineSeparator(buffer);
  10. if (lineSeparator == null) {
  11. // search in the given text
  12. lineSeparator = findLineSeparator(text);
  13. if (lineSeparator == null) {
  14. // default to system line separator
  15. return getLineSeparator((String) null, (IJavaProject) null);
  16. }
  17. }
  18. return lineSeparator;
  19. }

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

  1. /**
  2. * Returns the line separator used by the given buffer.
  3. * Uses the given text if none found.
  4. *
  5. * @return </code>"\n"</code> or </code>"\r"</code> or </code>"\r\n"</code>
  6. */
  7. private static String getLineSeparator(char[] text, char[] buffer) {
  8. // search in this buffer's contents first
  9. String lineSeparator = findLineSeparator(buffer);
  10. if (lineSeparator == null) {
  11. // search in the given text
  12. lineSeparator = findLineSeparator(text);
  13. if (lineSeparator == null) {
  14. // default to system line separator
  15. return getLineSeparator((String) null, (IJavaProject) null);
  16. }
  17. }
  18. return lineSeparator;
  19. }

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

  1. /**
  2. * Returns the line separator used by the given buffer.
  3. * Uses the given text if none found.
  4. *
  5. * @return </code>"\n"</code> or </code>"\r"</code> or </code>"\r\n"</code>
  6. */
  7. private static String getLineSeparator(char[] text, char[] buffer) {
  8. // search in this buffer's contents first
  9. String lineSeparator = findLineSeparator(buffer);
  10. if (lineSeparator == null) {
  11. // search in the given text
  12. lineSeparator = findLineSeparator(text);
  13. if (lineSeparator == null) {
  14. // default to system line separator
  15. return getLineSeparator((String) null, (IJavaProject) null);
  16. }
  17. }
  18. return lineSeparator;
  19. }

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

  1. /**
  2. * Returns the line separator used by the given buffer.
  3. * Uses the given text if none found.
  4. *
  5. * @return </code>"\n"</code> or </code>"\r"</code> or </code>"\r\n"</code>
  6. */
  7. private static String getLineSeparator(char[] text, char[] buffer) {
  8. // search in this buffer's contents first
  9. String lineSeparator = findLineSeparator(buffer);
  10. if (lineSeparator == null) {
  11. // search in the given text
  12. lineSeparator = findLineSeparator(text);
  13. if (lineSeparator == null) {
  14. // default to system line separator
  15. return getLineSeparator((String) null, (IJavaProject) null);
  16. }
  17. }
  18. return lineSeparator;
  19. }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

相关文章

Util类方法