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

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

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

Util.getNameWithoutJavaLikeExtension介绍

[英]Returns the substring of the given file name, ending at the start of a Java like extension. The entire file name is returned if it doesn't end with a Java like extension.
[中]

代码示例

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

  1. /**
  2. * Removes the file extension from the given file name, if it has a Java-like file
  3. * extension. Otherwise the file name itself is returned.
  4. * Note this removes the dot ('.') before the extension as well.
  5. *
  6. * @param fileName the name of a file
  7. * @return the fileName without the Java-like extension
  8. * @since 3.2
  9. */
  10. public static String removeJavaLikeExtension(String fileName) {
  11. return Util.getNameWithoutJavaLikeExtension(fileName);
  12. }

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

  1. /**
  2. * Removes the file extension from the given file name, if it has a Java-like file
  3. * extension. Otherwise the file name itself is returned.
  4. * Note this removes the dot ('.') before the extension as well.
  5. *
  6. * @param fileName the name of a file
  7. * @return the fileName without the Java-like extension
  8. * @since 3.2
  9. */
  10. public static String removeJavaLikeExtension(String fileName) {
  11. return Util.getNameWithoutJavaLikeExtension(fileName);
  12. }

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

  1. /**
  2. * Removes the file extension from the given file name, if it has a Java-like file
  3. * extension. Otherwise the file name itself is returned.
  4. * Note this removes the dot ('.') before the extension as well.
  5. *
  6. * @param fileName the name of a file
  7. * @return the fileName without the Java-like extension
  8. * @since 3.2
  9. */
  10. public static String removeJavaLikeExtension(String fileName) {
  11. return Util.getNameWithoutJavaLikeExtension(fileName);
  12. }

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

  1. /**
  2. * Removes the file extension from the given file name, if it has a Java-like file
  3. * extension. Otherwise the file name itself is returned.
  4. * Note this removes the dot ('.') before the extension as well.
  5. *
  6. * @param fileName the name of a file
  7. * @return the fileName without the Java-like extension
  8. * @since 3.2
  9. */
  10. public static String removeJavaLikeExtension(String fileName) {
  11. return Util.getNameWithoutJavaLikeExtension(fileName);
  12. }

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

  1. /**
  2. * Removes the file extension from the given file name, if it has a Java-like file
  3. * extension. Otherwise the file name itself is returned.
  4. * Note this removes the dot ('.') before the extension as well.
  5. *
  6. * @param fileName the name of a file
  7. * @return the fileName without the Java-like extension
  8. * @since 3.2
  9. */
  10. public static String removeJavaLikeExtension(String fileName) {
  11. return Util.getNameWithoutJavaLikeExtension(fileName);
  12. }

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

  1. /**
  2. * Removes the file extension from the given file name, if it has a Java-like file
  3. * extension. Otherwise the file name itself is returned.
  4. * Note this removes the dot ('.') before the extension as well.
  5. *
  6. * @param fileName the name of a file
  7. * @return the fileName without the Java-like extension
  8. * @since 3.2
  9. */
  10. public static String removeJavaLikeExtension(String fileName) {
  11. return Util.getNameWithoutJavaLikeExtension(fileName);
  12. }

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

  1. /**
  2. * @see org.eclipse.jdt.internal.compiler.env.ICompilationUnit#getMainTypeName()
  3. */
  4. @Override
  5. public char[] getMainTypeName(){
  6. return Util.getNameWithoutJavaLikeExtension(getElementName()).toCharArray();
  7. }
  8. /**

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

  1. /**
  2. * @see org.eclipse.jdt.internal.compiler.env.ICompilationUnit#getMainTypeName()
  3. */
  4. public char[] getMainTypeName(){
  5. return Util.getNameWithoutJavaLikeExtension(getElementName()).toCharArray();
  6. }
  7. /**

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

  1. /**
  2. * @see org.eclipse.jdt.internal.compiler.env.ICompilationUnit#getMainTypeName()
  3. */
  4. public char[] getMainTypeName(){
  5. return Util.getNameWithoutJavaLikeExtension(getElementName()).toCharArray();
  6. }
  7. /**

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

  1. /**
  2. * @see org.eclipse.jdt.internal.compiler.env.ICompilationUnit#getMainTypeName()
  3. */
  4. public char[] getMainTypeName(){
  5. return Util.getNameWithoutJavaLikeExtension(getElementName()).toCharArray();
  6. }
  7. /**

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

  1. /**
  2. * @see org.eclipse.jdt.internal.compiler.env.ICompilationUnit#getMainTypeName()
  3. */
  4. public char[] getMainTypeName(){
  5. return Util.getNameWithoutJavaLikeExtension(getElementName()).toCharArray();
  6. }
  7. /**

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

  1. /**
  2. * @see ICompilationUnit#findPrimaryType()
  3. */
  4. public IType findPrimaryType() {
  5. String typeName = Util.getNameWithoutJavaLikeExtension(getElementName());
  6. IType primaryType= getType(typeName);
  7. if (primaryType.exists()) {
  8. return primaryType;
  9. }
  10. return null;
  11. }

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

  1. /**
  2. * @see ICompilationUnit#findPrimaryType()
  3. */
  4. @Override
  5. public IType findPrimaryType() {
  6. String typeName = Util.getNameWithoutJavaLikeExtension(getElementName());
  7. IType primaryType= getType(typeName);
  8. if (primaryType.exists()) {
  9. return primaryType;
  10. }
  11. return null;
  12. }

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

  1. /**
  2. * @see ICompilationUnit#findPrimaryType()
  3. */
  4. public IType findPrimaryType() {
  5. String typeName = Util.getNameWithoutJavaLikeExtension(getElementName());
  6. IType primaryType= getType(typeName);
  7. if (primaryType.exists()) {
  8. return primaryType;
  9. }
  10. return null;
  11. }

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

  1. /**
  2. * @see ICompilationUnit#findPrimaryType()
  3. */
  4. public IType findPrimaryType() {
  5. String typeName = Util.getNameWithoutJavaLikeExtension(getElementName());
  6. IType primaryType= getType(typeName);
  7. if (primaryType.exists()) {
  8. return primaryType;
  9. }
  10. return null;
  11. }

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

  1. /**
  2. * @see ICompilationUnit#findPrimaryType()
  3. */
  4. public IType findPrimaryType() {
  5. String typeName = Util.getNameWithoutJavaLikeExtension(getElementName());
  6. IType primaryType= getType(typeName);
  7. if (primaryType.exists()) {
  8. return primaryType;
  9. }
  10. return null;
  11. }

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

  1. /**
  2. * @see ICompilationUnit#findPrimaryType()
  3. */
  4. public IType findPrimaryType() {
  5. String typeName = Util.getNameWithoutJavaLikeExtension(getElementName());
  6. IType primaryType= getType(typeName);
  7. if (primaryType.exists()) {
  8. return primaryType;
  9. }
  10. return null;
  11. }

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

  1. /**
  2. * Returns <code>true</code> if this element is the main type of its compilation unit.
  3. */
  4. protected boolean isRenamingMainType(IJavaElement element, IJavaElement dest) throws JavaModelException {
  5. if ((isRename() || getNewNameFor(element) != null)
  6. && dest.getElementType() == IJavaElement.COMPILATION_UNIT) {
  7. String typeName = dest.getElementName();
  8. typeName = org.eclipse.jdt.internal.core.util.Util.getNameWithoutJavaLikeExtension(typeName);
  9. return element.getElementName().equals(typeName) && element.getParent().equals(dest);
  10. }
  11. return false;
  12. }
  13. /**

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

  1. /**
  2. * Returns <code>true</code> if this element is the main type of its compilation unit.
  3. */
  4. protected boolean isRenamingMainType(IJavaElement element, IJavaElement dest) throws JavaModelException {
  5. if ((isRename() || getNewNameFor(element) != null)
  6. && dest.getElementType() == IJavaElement.COMPILATION_UNIT) {
  7. String typeName = dest.getElementName();
  8. typeName = org.eclipse.jdt.internal.core.util.Util.getNameWithoutJavaLikeExtension(typeName);
  9. return element.getElementName().equals(typeName) && element.getParent().equals(dest);
  10. }
  11. return false;
  12. }
  13. /**

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

  1. /**
  2. * Returns <code>true</code> if this element is the main type of its compilation unit.
  3. */
  4. protected boolean isRenamingMainType(IJavaElement element, IJavaElement dest) throws JavaModelException {
  5. if ((isRename() || getNewNameFor(element) != null)
  6. && dest.getElementType() == IJavaElement.COMPILATION_UNIT) {
  7. String typeName = dest.getElementName();
  8. typeName = org.eclipse.jdt.internal.core.util.Util.getNameWithoutJavaLikeExtension(typeName);
  9. return element.getElementName().equals(typeName) && element.getParent().equals(dest);
  10. }
  11. return false;
  12. }
  13. /**

相关文章

Util类方法