Codota Logo
IType.isAnonymous
Code IndexAdd Codota to your IDE (free)

How to use
isAnonymous
method
in
org.eclipse.jdt.core.IType

Best Java code snippets using org.eclipse.jdt.core.IType.isAnonymous (Showing top 20 results out of 315)

  • Common ways to obtain IType
private void myMethod () {
IType i =
  • Codota IconIMethod method;method.getDeclaringType()
  • Codota IconIJavaProject javaProject;String fullyQualifiedName;javaProject.findType(fullyQualifiedName)
  • Codota IconIMember member;member.getDeclaringType()
  • Smart code suggestions by Codota
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

protected final boolean isAnonymous(IType type) {
  try {
    return type.isAnonymous();
  } catch (JavaModelException e) {
    return false;
  }
}
origin: com.google.code.maven-play-plugin.org.eclipse.jdt/org.eclipse.jdt.core

@Override
public boolean isAnonymous() {
  try {
    return this.handle.isAnonymous();
  } catch (JavaModelException e) {
    return false;
  }
}
/*
origin: eclipse/eclipse.jdt.ls

private static boolean hasAnonymousClassDeclarations(IJavaElement[] javaElements) throws JavaModelException {
  for (int i= 0; i < javaElements.length; i++) {
    if (javaElements[i] instanceof IType) {
      IType type= (IType) javaElements[i];
      if (type.isAnonymous()) {
        return true;
      }
    }
  }
  return false;
}
origin: org.eclipse.jdt/org.eclipse.jdt.core

@Override
public boolean isAnonymous() {
  try {
    return this.handle.isAnonymous();
  } catch (JavaModelException e) {
    return false;
  }
}
/*
origin: eclipse/eclipse.jdt.ls

private static boolean isAnonymousType(IMember member) throws JavaModelException {
  return member.getElementType() == IJavaElement.TYPE &&
      ((IType)member).isAnonymous();
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private ITypeBinding typeToBinding(IType type, CompilationUnit root) throws JavaModelException {
  ASTNode typeNode= typeToDeclaration(type, root);
  if (type.isAnonymous()) {
    return ((AnonymousClassDeclaration) typeNode).resolveBinding();
  } else {
    return ((AbstractTypeDeclaration) typeNode).resolveBinding();
  }
}
origin: org.eclipse/org.eclipse.jst.jsf.core

private boolean isInnerOrAnonymousClass(IType res) {
  try {
    if (res.isClass() && (res.isAnonymous() || 
                (Flags.isPrivate(res.getFlags())) || 
                res.getFullyQualifiedName().indexOf("$") > 0)) //must be better way to discover if it is an inner class //$NON-NLS-1$
      return true;
  } catch (JavaModelException e) {
    //ignore
  }
  return false;
}
origin: eclipse/eclipse.jdt.ls

public static boolean isConvertAnonymousAvailable(final IType type) throws JavaModelException {
  if (Checks.isAvailable(type)) {
    final IJavaElement element = type.getParent();
    if (element instanceof IField && JdtFlags.isEnum((IMember) element)) {
      return false;
    }
    return type.isAnonymous();
  }
  return false;
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

public static boolean isConvertAnonymousAvailable(final IType type) throws JavaModelException {
  if (Checks.isAvailable(type)) {
    final IJavaElement element= type.getParent();
    if (element instanceof IField && JdtFlags.isEnum((IMember) element))
      return false;
    return type.isAnonymous();
  }
  return false;
}
origin: eclipse/eclipse.jdt.ls

  public static boolean isExtractClassAvailable(IType type) throws JavaModelException {
    if (type == null) {
      return false;
    }
    if (!type.exists()) {
      return false;
    }
    return ReorgUtils.isInsideCompilationUnit(type) && type.isClass() && !type.isAnonymous() && !type.isLambda();
  }
}
origin: org.eclipse/org.eclipse.jdt.ui

private ASTNode typeToDeclaration(IType type, CompilationUnit root) throws JavaModelException {
  Name intermediateName= (Name) NodeFinder.perform(root, type.getNameRange());
  if (type.isAnonymous()) {
    return ASTNodes.getParent(intermediateName, AnonymousClassDeclaration.class);
  } else {
    return ASTNodes.getParent(intermediateName, AbstractTypeDeclaration.class);
  }
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private ASTNode typeToDeclaration(IType type, CompilationUnit root) throws JavaModelException {
  Name intermediateName= (Name) NodeFinder.perform(root, type.getNameRange());
  if (type.isAnonymous()) {
    return ASTNodes.getParent(intermediateName, AnonymousClassDeclaration.class);
  } else {
    return ASTNodes.getParent(intermediateName, AbstractTypeDeclaration.class);
  }
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

  public static boolean isExtractClassAvailable(IType type) throws JavaModelException {
    if (type == null)
      return false;
    if (!type.exists())
      return false;
    return ReorgUtils.isInsideCompilationUnit(type) && type.isClass() && !type.isAnonymous()  && !type.isLambda();
  }
}
origin: eclipse/eclipse.jdt.ls

public static List<BodyDeclaration> getBodyDeclarationList(IType iType, CompilationUnit cuNode) throws JavaModelException {
  if (iType.isAnonymous()) {
    return getClassInstanceCreationNode(iType, cuNode).getAnonymousClassDeclaration().bodyDeclarations();
  } else {
    return getAbstractTypeDeclarationNode(iType, cuNode).bodyDeclarations();
  }
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

public static List<BodyDeclaration> getBodyDeclarationList(IType iType, CompilationUnit cuNode) throws JavaModelException {
  if (iType.isAnonymous())
    return getClassInstanceCreationNode(iType, cuNode).getAnonymousClassDeclaration().bodyDeclarations();
  else
    return getAbstractTypeDeclarationNode(iType, cuNode).bodyDeclarations();
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

private boolean canEnable(IStructuredSelection selection) throws JavaModelException {
  if (getSelectedFields(selection) != null)
    return true;
  if ((selection.size() == 1) && (selection.getFirstElement() instanceof IType)) {
    IType type= (IType) selection.getFirstElement();
    return type.getCompilationUnit() != null && !type.isInterface() && !type.isAnonymous();
  }
  if ((selection.size() == 1) && (selection.getFirstElement() instanceof ICompilationUnit))
    return true;
  return false;
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

private boolean canEnable(IStructuredSelection selection) throws JavaModelException {
  if (getSelectedFields(selection) != null)
    return true;
  if ((selection.size() == 1) && (selection.getFirstElement() instanceof IType)) {
    IType type= (IType) selection.getFirstElement();
    return type.getCompilationUnit() != null && !type.isInterface() && !type.isAnonymous();
  }
  if ((selection.size() == 1) && (selection.getFirstElement() instanceof ICompilationUnit))
    return true;
  return false;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private boolean canEnable(IStructuredSelection selection) throws JavaModelException {
  if (getSelectedFields(selection) != null)
    return true;
  if ((selection.size() == 1) && (selection.getFirstElement() instanceof IType)) {
    IType type= (IType) selection.getFirstElement();
    return type.getCompilationUnit() != null && !type.isInterface() && !type.isAnonymous();
  }
  if ((selection.size() == 1) && (selection.getFirstElement() instanceof ICompilationUnit))
    return true;
  return false;
}
origin: org.eclipse.scout.sdk.deps/org.eclipse.jdt.ui

private boolean canEnable(IStructuredSelection selection) throws JavaModelException {
  if ((selection.size() == 1) && (selection.getFirstElement() instanceof IType)) {
    IType type= (IType) selection.getFirstElement();
    return type.getCompilationUnit() != null && !type.isInterface() && !type.isEnum() && !type.isAnonymous();
  }
  if ((selection.size() == 1) && (selection.getFirstElement() instanceof ICompilationUnit))
    return true;
  return false;
}
origin: org.eclipse.jdt/org.eclipse.jdt.ui

private boolean canEnable(IStructuredSelection selection) throws JavaModelException {
  if (getSelectedFields(selection) != null)
    return true;
  if ((selection.size() == 1) && (selection.getFirstElement() instanceof IType)) {
    IType type= (IType) selection.getFirstElement();
    return type.getCompilationUnit() != null && !type.isInterface() && !type.isAnnotation() && !type.isAnonymous();
  }
  if ((selection.size() == 1) && (selection.getFirstElement() instanceof ICompilationUnit))
    return true;
  return false;
}
org.eclipse.jdt.coreITypeisAnonymous

Javadoc

Returns whether this type represents an anonymous type.

Popular methods of IType

  • getFullyQualifiedName
    Returns the fully qualified name of this type, including qualification for any containing types and
  • getElementName
    Returns the simple name of this type, unqualified by package or enclosing type. This is a handle-onl
  • getMethods
    Returns the methods and constructors declared by this type. For binary types, this may include the s
  • getFlags
  • getPackageFragment
    Returns the package fragment in which this element is defined. This is a handle-only method.
  • getCompilationUnit
  • newSupertypeHierarchy
    Creates and returns a type hierarchy for this type containing this type and all of its supertypes, c
  • exists
  • getJavaProject
  • isInterface
    Returns whether this type represents an interface. Note that an interface can also be an annotation
  • getDeclaringType
  • getMethod
    Returns the method with the specified name and parameter types in this type (for example, "foo", {"I
  • getDeclaringType,
  • getMethod,
  • getParent,
  • isClass,
  • getSourceRange,
  • newTypeHierarchy,
  • isBinary,
  • getResource,
  • getTypeParameters

Popular in Java

  • Creating JSON documents from java classes using gson
  • getOriginalFilename (MultipartFile)
    Return the original filename in the client's filesystem.This may contain path information depending
  • getSharedPreferences (Context)
  • getExternalFilesDir (Context)
  • GridLayout (java.awt)
    The GridLayout class is a layout manager that lays out a container's components in a rectangular gri
  • Pattern (java.util.regex)
    A compiled representation of a regular expression. A regular expression, specified as a string, must
  • Notification (javax.management)
  • JList (javax.swing)
  • Join (org.hibernate.mapping)
  • Logger (org.slf4j)
    The main user interface to logging. It is expected that logging takes place through concrete impleme
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now