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

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

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

Util.getUnresolvedJavaElement介绍

[英]Returns the IInitializer that contains the given local variable in the given type
[中]返回在给定类型中包含给定局部变量的IIInitializer

代码示例

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

  1. /**
  2. * Return the java element corresponding to the given compiler binding.
  3. */
  4. public static JavaElement getUnresolvedJavaElement(FieldBinding binding, WorkingCopyOwner workingCopyOwner, BindingsToNodesMap bindingsToNodes) {
  5. if (binding.declaringClass == null) return null; // array length
  6. JavaElement unresolvedJavaElement = getUnresolvedJavaElement(binding.declaringClass, workingCopyOwner, bindingsToNodes);
  7. if (unresolvedJavaElement == null || unresolvedJavaElement.getElementType() != IJavaElement.TYPE) {
  8. return null;
  9. }
  10. return (JavaElement) ((IType) unresolvedJavaElement).getField(String.valueOf(binding.name));
  11. }

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

  1. /**
  2. * Return the java element corresponding to the given compiler binding.
  3. */
  4. public static JavaElement getUnresolvedJavaElement(FieldBinding binding, WorkingCopyOwner workingCopyOwner, BindingsToNodesMap bindingsToNodes) {
  5. if (binding.declaringClass == null) return null; // array length
  6. JavaElement unresolvedJavaElement = getUnresolvedJavaElement(binding.declaringClass, workingCopyOwner, bindingsToNodes);
  7. if (unresolvedJavaElement == null || unresolvedJavaElement.getElementType() != IJavaElement.TYPE) {
  8. return null;
  9. }
  10. return (JavaElement) ((IType) unresolvedJavaElement).getField(String.valueOf(binding.name));
  11. }

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

  1. /**
  2. * Return the java element corresponding to the given compiler binding.
  3. */
  4. public static JavaElement getUnresolvedJavaElement(FieldBinding binding, WorkingCopyOwner workingCopyOwner, BindingsToNodesMap bindingsToNodes) {
  5. if (binding.declaringClass == null) return null; // array length
  6. JavaElement unresolvedJavaElement = getUnresolvedJavaElement(binding.declaringClass, workingCopyOwner, bindingsToNodes);
  7. if (unresolvedJavaElement == null || unresolvedJavaElement.getElementType() != IJavaElement.TYPE) {
  8. return null;
  9. }
  10. return (JavaElement) ((IType) unresolvedJavaElement).getField(String.valueOf(binding.name));
  11. }

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

  1. /**
  2. * Return the java element corresponding to the given compiler binding.
  3. */
  4. public static JavaElement getUnresolvedJavaElement(FieldBinding binding, WorkingCopyOwner workingCopyOwner, BindingsToNodesMap bindingsToNodes) {
  5. if (binding.declaringClass == null) return null; // array length
  6. JavaElement unresolvedJavaElement = getUnresolvedJavaElement(binding.declaringClass, workingCopyOwner, bindingsToNodes);
  7. if (unresolvedJavaElement == null || unresolvedJavaElement.getElementType() != IJavaElement.TYPE) {
  8. return null;
  9. }
  10. return (JavaElement) ((IType) unresolvedJavaElement).getField(String.valueOf(binding.name));
  11. }

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

  1. /**
  2. * Return the java element corresponding to the given compiler binding.
  3. */
  4. public static JavaElement getUnresolvedJavaElement(FieldBinding binding, WorkingCopyOwner workingCopyOwner, BindingsToNodesMap bindingsToNodes) {
  5. if (binding.declaringClass == null) return null; // array length
  6. JavaElement unresolvedJavaElement = getUnresolvedJavaElement(binding.declaringClass, workingCopyOwner, bindingsToNodes);
  7. if (unresolvedJavaElement == null || unresolvedJavaElement.getElementType() != IJavaElement.TYPE) {
  8. return null;
  9. }
  10. return (JavaElement) ((IType) unresolvedJavaElement).getField(String.valueOf(binding.name));
  11. }

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

  1. /**
  2. * Return the java element corresponding to the given compiler binding.
  3. */
  4. public static JavaElement getUnresolvedJavaElement(FieldBinding binding, WorkingCopyOwner workingCopyOwner, BindingsToNodesMap bindingsToNodes) {
  5. if (binding.declaringClass == null) return null; // array length
  6. JavaElement unresolvedJavaElement = getUnresolvedJavaElement(binding.declaringClass, workingCopyOwner, bindingsToNodes);
  7. if (unresolvedJavaElement == null || unresolvedJavaElement.getElementType() != IJavaElement.TYPE) {
  8. return null;
  9. }
  10. return (JavaElement) ((IType) unresolvedJavaElement).getField(String.valueOf(binding.name));
  11. }

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

  1. /**
  2. * Return the java element corresponding to the given compiler binding.
  3. */
  4. public static JavaElement getUnresolvedJavaElement(FieldBinding binding, WorkingCopyOwner workingCopyOwner, BindingsToNodesMap bindingsToNodes) {
  5. if (binding.declaringClass == null) return null; // array length
  6. JavaElement unresolvedJavaElement = getUnresolvedJavaElement(binding.declaringClass, workingCopyOwner, bindingsToNodes);
  7. if (unresolvedJavaElement == null || unresolvedJavaElement.getElementType() != IJavaElement.TYPE) {
  8. return null;
  9. }
  10. return (JavaElement) ((IType) unresolvedJavaElement).getField(String.valueOf(binding.name));
  11. }

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

  1. private JavaElement getUnresolvedJavaElement() {
  2. if (JavaCore.getPlugin() == null) {
  3. return null;
  4. }
  5. if (!(this.resolver instanceof DefaultBindingResolver)) return null;
  6. DefaultBindingResolver defaultBindingResolver = (DefaultBindingResolver) this.resolver;
  7. if (!defaultBindingResolver.fromJavaProject) return null;
  8. return Util.getUnresolvedJavaElement(
  9. this.binding,
  10. defaultBindingResolver.workingCopyOwner,
  11. defaultBindingResolver.getBindingsToNodesMap());
  12. }

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

  1. private JavaElement getUnresolvedJavaElement() {
  2. if (JavaCore.getPlugin() == null) {
  3. return null;
  4. }
  5. if (!(this.resolver instanceof DefaultBindingResolver)) return null;
  6. DefaultBindingResolver defaultBindingResolver = (DefaultBindingResolver) this.resolver;
  7. if (!defaultBindingResolver.fromJavaProject) return null;
  8. return Util.getUnresolvedJavaElement(
  9. this.binding,
  10. defaultBindingResolver.workingCopyOwner,
  11. defaultBindingResolver.getBindingsToNodesMap());
  12. }

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

  1. private JavaElement getUnresolvedJavaElement() {
  2. if (JavaCore.getPlugin() == null) {
  3. return null;
  4. }
  5. if (!(this.resolver instanceof DefaultBindingResolver)) return null;
  6. DefaultBindingResolver defaultBindingResolver = (DefaultBindingResolver) this.resolver;
  7. if (!defaultBindingResolver.fromJavaProject) return null;
  8. return Util.getUnresolvedJavaElement(
  9. this.binding,
  10. defaultBindingResolver.workingCopyOwner,
  11. defaultBindingResolver.getBindingsToNodesMap());
  12. }

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

  1. private JavaElement getUnresolvedJavaElement() {
  2. if (JavaCore.getPlugin() == null) {
  3. return null;
  4. }
  5. if (!(this.resolver instanceof DefaultBindingResolver)) return null;
  6. DefaultBindingResolver defaultBindingResolver = (DefaultBindingResolver) this.resolver;
  7. if (!defaultBindingResolver.fromJavaProject) return null;
  8. return Util.getUnresolvedJavaElement(
  9. this.binding,
  10. defaultBindingResolver.workingCopyOwner,
  11. defaultBindingResolver.getBindingsToNodesMap());
  12. }

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

  1. private JavaElement getUnresolvedJavaElement() {
  2. if (JavaCore.getPlugin() == null) {
  3. return null;
  4. }
  5. if (!(this.resolver instanceof DefaultBindingResolver)) return null;
  6. DefaultBindingResolver defaultBindingResolver = (DefaultBindingResolver) this.resolver;
  7. if (!defaultBindingResolver.fromJavaProject) return null;
  8. return Util.getUnresolvedJavaElement(
  9. this.binding,
  10. defaultBindingResolver.workingCopyOwner,
  11. defaultBindingResolver.getBindingsToNodesMap());
  12. }

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

  1. private JavaElement getUnresolvedJavaElement() {
  2. if (JavaCore.getPlugin() == null) {
  3. return null;
  4. }
  5. if (!(this.resolver instanceof DefaultBindingResolver)) return null;
  6. DefaultBindingResolver defaultBindingResolver = (DefaultBindingResolver) this.resolver;
  7. if (!defaultBindingResolver.fromJavaProject) return null;
  8. return Util.getUnresolvedJavaElement(
  9. this.binding,
  10. defaultBindingResolver.workingCopyOwner,
  11. defaultBindingResolver.getBindingsToNodesMap());
  12. }

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

  1. private JavaElement getUnresolvedJavaElement(org.eclipse.jdt.internal.compiler.lookup.TypeBinding typeBinding ) {
  2. if (JavaCore.getPlugin() == null) {
  3. return null;
  4. }
  5. if (this.resolver instanceof DefaultBindingResolver) {
  6. DefaultBindingResolver defaultBindingResolver = (DefaultBindingResolver) this.resolver;
  7. if (!defaultBindingResolver.fromJavaProject) return null;
  8. return org.eclipse.jdt.internal.core.util.Util.getUnresolvedJavaElement(
  9. typeBinding,
  10. defaultBindingResolver.workingCopyOwner,
  11. defaultBindingResolver.getBindingsToNodesMap());
  12. }
  13. return null;
  14. }

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

  1. private JavaElement getUnresolvedJavaElement(org.eclipse.jdt.internal.compiler.lookup.TypeBinding typeBinding ) {
  2. if (JavaCore.getPlugin() == null) {
  3. return null;
  4. }
  5. if (this.resolver instanceof DefaultBindingResolver) {
  6. DefaultBindingResolver defaultBindingResolver = (DefaultBindingResolver) this.resolver;
  7. if (!defaultBindingResolver.fromJavaProject) return null;
  8. return org.eclipse.jdt.internal.core.util.Util.getUnresolvedJavaElement(
  9. typeBinding,
  10. defaultBindingResolver.workingCopyOwner,
  11. defaultBindingResolver.getBindingsToNodesMap());
  12. }
  13. return null;
  14. }

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

  1. private JavaElement getUnresolvedJavaElement(org.eclipse.jdt.internal.compiler.lookup.TypeBinding typeBinding ) {
  2. if (JavaCore.getPlugin() == null) {
  3. return null;
  4. }
  5. if (this.resolver instanceof DefaultBindingResolver) {
  6. DefaultBindingResolver defaultBindingResolver = (DefaultBindingResolver) this.resolver;
  7. if (!defaultBindingResolver.fromJavaProject) return null;
  8. return org.eclipse.jdt.internal.core.util.Util.getUnresolvedJavaElement(
  9. typeBinding,
  10. defaultBindingResolver.workingCopyOwner,
  11. defaultBindingResolver.getBindingsToNodesMap());
  12. }
  13. return null;
  14. }

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

  1. private JavaElement getUnresolvedJavaElement(org.eclipse.jdt.internal.compiler.lookup.TypeBinding typeBinding ) {
  2. if (JavaCore.getPlugin() == null) {
  3. return null;
  4. }
  5. if (this.resolver instanceof DefaultBindingResolver) {
  6. DefaultBindingResolver defaultBindingResolver = (DefaultBindingResolver) this.resolver;
  7. if (!defaultBindingResolver.fromJavaProject) return null;
  8. return org.eclipse.jdt.internal.core.util.Util.getUnresolvedJavaElement(
  9. typeBinding,
  10. defaultBindingResolver.workingCopyOwner,
  11. defaultBindingResolver.getBindingsToNodesMap());
  12. }
  13. return null;
  14. }

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

  1. private JavaElement getUnresolvedJavaElement(org.eclipse.jdt.internal.compiler.lookup.TypeBinding typeBinding ) {
  2. if (JavaCore.getPlugin() == null) {
  3. return null;
  4. }
  5. if (this.resolver instanceof DefaultBindingResolver) {
  6. DefaultBindingResolver defaultBindingResolver = (DefaultBindingResolver) this.resolver;
  7. if (!defaultBindingResolver.fromJavaProject) return null;
  8. return org.eclipse.jdt.internal.core.util.Util.getUnresolvedJavaElement(
  9. typeBinding,
  10. defaultBindingResolver.workingCopyOwner,
  11. defaultBindingResolver.getBindingsToNodesMap());
  12. }
  13. return null;
  14. }

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

  1. private JavaElement getUnresolvedJavaElement(org.eclipse.jdt.internal.compiler.lookup.TypeBinding typeBinding ) {
  2. if (JavaCore.getPlugin() == null) {
  3. return null;
  4. }
  5. if (this.resolver instanceof DefaultBindingResolver) {
  6. DefaultBindingResolver defaultBindingResolver = (DefaultBindingResolver) this.resolver;
  7. if (!defaultBindingResolver.fromJavaProject) return null;
  8. return org.eclipse.jdt.internal.core.util.Util.getUnresolvedJavaElement(
  9. typeBinding,
  10. defaultBindingResolver.workingCopyOwner,
  11. defaultBindingResolver.getBindingsToNodesMap());
  12. }
  13. return null;
  14. }

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

  1. private JavaElement getJavaElement(LocalVariableBinding binding) {
  2. LocalDeclaration local = binding.declaration;
  3. JavaElement parent = null;
  4. ReferenceContext referenceContext = binding.declaringScope.referenceContext();
  5. if (referenceContext instanceof AbstractMethodDeclaration) {
  6. AbstractMethodDeclaration methodDeclaration = (AbstractMethodDeclaration) referenceContext;
  7. parent = this.getJavaElementOfCompilationUnit(methodDeclaration, methodDeclaration.binding);
  8. } else if (referenceContext instanceof TypeDeclaration){
  9. // Local variable is declared inside an initializer
  10. TypeDeclaration typeDeclaration = (TypeDeclaration) referenceContext;
  11. JavaElement type = this.getJavaElementOfCompilationUnit(typeDeclaration, typeDeclaration.binding);
  12. parent = Util.getUnresolvedJavaElement(local.sourceStart, local.sourceEnd, type);
  13. }
  14. if (parent == null) return null;
  15. return new LocalVariable(
  16. parent,
  17. new String(local.name),
  18. local.declarationSourceStart,
  19. local.declarationSourceEnd,
  20. local.sourceStart,
  21. local.sourceEnd,
  22. Util.typeSignature(local.type),
  23. binding.declaration.annotations,
  24. local.modifiers,
  25. local.getKind() == AbstractVariableDeclaration.PARAMETER);
  26. }

相关文章

Util类方法