Java 类com.intellij.util.xml.DomTarget 实例源码

项目:intellij-ce-playground    文件:AntDomMacrodefAttributeReference.java   
public PsiElement resolve(@NotNull PsiReference psiReference, boolean incompleteCode) {
  final PsiElement element = psiReference.getElement();
  if (element == null) {
    return null;
  }
  final DomElement domElement = DomUtil.getDomElement(element);
  if (domElement == null) {
    return null;
  }
  final AntDomMacroDef macrodef = domElement.getParentOfType(AntDomMacroDef.class, false);
  if (macrodef == null) {
    return null;
  }
  final String name = AntStringResolver.computeString(domElement, psiReference.getCanonicalText());
  for (AntDomMacrodefAttribute attribute : macrodef.getMacroAttributes()) {
    if (name.equals(attribute.getName().getStringValue())) {
      final DomTarget target = DomTarget.getTarget(attribute);
      return target != null? PomService.convertToPsi(target) : null;
    }
  }
  return null;
}
项目:intellij-ce-playground    文件:AntBuildTargetImpl.java   
public AntBuildTargetImpl(final AntDomTarget target, final AntBuildModelBase buildModel, final VirtualFile sourceFile, final boolean isImported, final boolean isDefault) {
  myModel = buildModel;
  myFile = sourceFile;
  myIsDefault = isDefault;
  myHashCode = target.hashCode();
  myName = target.getName().getRawText();
  String name = target.getName().getRawText();
  if (isImported) {
    final String projectName = target.getAntProject().getName().getRawText();
    name = projectName + "." + name;
  }
  myDisplayName = name;
  myProject = target.getManager().getProject();
  final DomTarget domTarget = DomTarget.getTarget(target);
  if (domTarget != null) {
    myTextOffset = domTarget.getTextOffset();
  }
  else {
    myTextOffset = target.getXmlTag().getTextOffset();
  }

  final String desc = target.getDescription().getRawText();
  myDescription = (desc != null && desc.trim().length() > 0) ? desc : null;
}
项目:intellij-ce-playground    文件:DevKitUseScopeEnlarger.java   
@Override
public SearchScope getAdditionalUseScope(@NotNull PsiElement element) {
  if (element instanceof PomTargetPsiElement) {
    PomTarget target = ((PomTargetPsiElement)element).getTarget();
    if (target instanceof DomTarget) {
      DomElement domElement = ((DomTarget)target).getDomElement();
      if (domElement instanceof ExtensionPoint) {
        return createProjectXmlFilesScope(element);
      }
    }
  }

  if (element instanceof PsiClass &&
      PsiUtil.isIdeaProject(element.getProject()) &&
      ((PsiClass)element).hasModifierProperty(PsiModifier.PUBLIC)) {
    return createProjectXmlFilesScope(element);
  }
  return null;
}
项目:tools-idea    文件:AntDomMacrodefAttributeReference.java   
public PsiElement resolve(@NotNull PsiReference psiReference, boolean incompleteCode) {
  final PsiElement element = psiReference.getElement();
  if (element == null) {
    return null;
  }
  final DomElement domElement = DomUtil.getDomElement(element);
  if (domElement == null) {
    return null;
  }
  final AntDomMacroDef macrodef = domElement.getParentOfType(AntDomMacroDef.class, false);
  if (macrodef == null) {
    return null;
  }
  final String name = AntStringResolver.computeString(domElement, psiReference.getCanonicalText());
  for (AntDomMacrodefAttribute attribute : macrodef.getMacroAttributes()) {
    if (name.equals(attribute.getName().getStringValue())) {
      final DomTarget target = DomTarget.getTarget(attribute);
      return target != null? PomService.convertToPsi(target) : null;
    }
  }
  return null;
}
项目:tools-idea    文件:AntBuildTargetImpl.java   
public AntBuildTargetImpl(final AntDomTarget target, final AntBuildModelBase buildModel, final VirtualFile sourceFile, final boolean isImported, final boolean isDefault) {
  myModel = buildModel;
  myFile = sourceFile;
  myIsDefault = isDefault;
  myHashCode = target.hashCode();
  myName = target.getName().getRawText();
  String name = target.getName().getRawText();
  if (isImported) {
    final String projectName = target.getAntProject().getName().getRawText();
    name = projectName + "." + name;
  }
  myDisplayName = name;
  myProject = target.getManager().getProject();
  final DomTarget domTarget = DomTarget.getTarget(target);
  if (domTarget != null) {
    myTextOffset = domTarget.getTextOffset();
  }
  else {
    myTextOffset = target.getXmlTag().getTextOffset();
  }

  final String desc = target.getDescription().getRawText();
  myDescription = (desc != null && desc.trim().length() > 0) ? desc : null;
}
项目:consulo-apache-ant    文件:AntDomMacrodefAttributeReference.java   
public PsiElement resolve(@NotNull PsiReference psiReference, boolean incompleteCode) {
  final PsiElement element = psiReference.getElement();
  if (element == null) {
    return null;
  }
  final DomElement domElement = DomUtil.getDomElement(element);
  if (domElement == null) {
    return null;
  }
  final AntDomMacroDef macrodef = domElement.getParentOfType(AntDomMacroDef.class, false);
  if (macrodef == null) {
    return null;
  }
  final String name = AntStringResolver.computeString(domElement, psiReference.getCanonicalText());
  for (AntDomMacrodefAttribute attribute : macrodef.getMacroAttributes()) {
    if (name.equals(attribute.getName().getStringValue())) {
      final DomTarget target = DomTarget.getTarget(attribute);
      return target != null? PomService.convertToPsi(target) : null;
    }
  }
  return null;
}
项目:consulo-apache-ant    文件:AntBuildTargetImpl.java   
public AntBuildTargetImpl(final AntDomTarget target, final AntBuildModelBase buildModel, final VirtualFile sourceFile, final boolean isImported, final boolean isDefault) {
  myModel = buildModel;
  myFile = sourceFile;
  myIsDefault = isDefault;
  myHashCode = target.hashCode();
  myName = target.getName().getRawText();
  String name = target.getName().getRawText();
  if (isImported) {
    final String projectName = target.getAntProject().getName().getRawText();
    name = projectName + "" + name;
  }
  myDisplayName = name;
  myProject = target.getManager().getProject();
  final DomTarget domTarget = DomTarget.getTarget(target);
  if (domTarget != null) {
    myTextOffset = domTarget.getTextOffset();
  }
  else {
    myTextOffset = target.getXmlTag().getTextOffset();
  }

  final String desc = target.getDescription().getRawText();
  myDescription = (desc != null && desc.trim().length() > 0) ? desc : null;
}
项目:intellij-ce-playground    文件:DomDeclarationSearcher.java   
@Override
@Nullable
protected DomTarget createDomTarget(DomElement parent, DomElement nameElement) {
  final NameValue nameValue = nameElement.getAnnotation(NameValue.class);
  if (nameValue != null && nameValue.referencable()) {
    return DomTarget.getTarget(parent);
  }
  return null;
}
项目:intellij-ce-playground    文件:DomPatterns.java   
public static ElementPattern<DomTarget> withDomTarget(final ElementPattern<? extends DomElement> pattern) {
  return new ObjectPattern.Capture<DomTarget>(DomTarget.class).with(new PatternCondition<DomTarget>("withDomTarget") {
    @Override
    public boolean accepts(@NotNull final DomTarget target, final ProcessingContext context) {
      return pattern.accepts(target.getDomElement(), context);
    }
  });
}
项目:intellij-ce-playground    文件:AntDomReferenceBase.java   
@Nullable 
public static DomElement toDomElement(PsiElement resolve) {
  if (resolve instanceof PomTargetPsiElement) {
    final PomTarget target = ((PomTargetPsiElement)resolve).getTarget();
    if(target instanceof DomTarget) {
      return ((DomTarget)target).getDomElement();
    }
    return null;
  }
  return DomUtil.getDomElement(resolve);
}
项目:intellij-ce-playground    文件:AntRenameProcessor.java   
@Nullable 
private static AntDomElement convertToAntDomElement(PsiElement element) {
  if (element instanceof PomTargetPsiElement) {
    final PomTarget target = ((PomTargetPsiElement)element).getTarget();
    if (target instanceof DomTarget) {
      final DomElement domElement = ((DomTarget)target).getDomElement();
      if (domElement instanceof AntDomElement) {
        return (AntDomElement)domElement;
      }
    }
  }
  return null;
}
项目:intellij-ce-playground    文件:AntDomDeclarationSearcher.java   
protected DomTarget createDomTarget(DomElement parent, DomElement nameElement) {
  if (parent instanceof AntDomElement && nameElement.equals(((AntDomElement)parent).getId())) { // id attrib is defined
    return DomTarget.getTarget(parent, (GenericDomValue)nameElement);
  }
  if (parent instanceof AntDomProperty && nameElement.equals(((AntDomProperty)parent).getEnvironment())) { // environment attrib is defined
    return DomTarget.getTarget(parent, (GenericDomValue)nameElement);
  }
  return null;
}
项目:intellij-ce-playground    文件:AntDomTargetReference.java   
public PsiElement resolve(@NotNull PsiReference psiReference, boolean incompleteCode) {
  final TargetResolver.Result result = ((AntDomTargetReference)psiReference).doResolve(psiReference.getCanonicalText());
  if (result == null) {
    return null;
  }
  final Pair<AntDomTarget,String> pair = result.getResolvedTarget(psiReference.getCanonicalText());
  final DomTarget domTarget = pair != null && pair.getFirst() != null ? DomTarget.getTarget(pair.getFirst()) : null;
  return domTarget != null? PomService.convertToPsi(domTarget) : null;
}
项目:intellij-ce-playground    文件:AntDomProperty.java   
public PsiElement getNavigationElement(final String propertyName) {
  DomTarget domTarget = DomTarget.getTarget(this);
  if (domTarget == null) {
    final GenericAttributeValue<String> environment = getEnvironment();
    if (environment.getRawText() != null) {
      domTarget = DomTarget.getTarget(this, environment);
    }
    if (domTarget == null) {
      final GenericAttributeValue<String> resource = getResource();
      if (resource.getRawText() != null) {
        domTarget = DomTarget.getTarget(this, resource);
      }
    }
  }

  if (domTarget != null) {
    final PsiElement psi = PomService.convertToPsi(domTarget);
    if (psi != null) {
      return psi;
    }
  }

  final PsiFileSystemItem psiFile = getFile().getValue();
  if (psiFile != null) {
    final String prefix = getPropertyPrefixValue();
    String _propertyName = propertyName;
    if (prefix != null) {
      if (!propertyName.startsWith(prefix)) {
        return null;
      }
      _propertyName = propertyName.substring(prefix.length());
    }
    final PropertiesFile pf = toPropertiesFile(psiFile);
    if (pf != null) {
      final IProperty property = pf.findPropertyByKey(_propertyName);
      return property != null? property.getPsiElement() : null;
    }
  }
  return null;
}
项目:intellij-ce-playground    文件:BuildTask.java   
public BuildTask(final AntBuildTargetBase target, final AntDomElement task) {
  myTarget = target;
  myName = task.getXmlElementName();
  final DomTarget domTarget = DomTarget.getTarget(task);
  if (domTarget != null) {
    myOffset = domTarget.getTextOffset();
  }
  else {
    myOffset = task.getXmlTag().getTextOffset();
  }
}
项目:intellij-ce-playground    文件:AntResolveTest.java   
public void testPropertyInMacrodefParam() throws Exception {
  PsiReference ref = configure();
  final PsiElement result = ref.resolve();
  assertTrue(result instanceof PomTargetPsiElement);
  final PsiElement naviElem = ((DomTarget)((PomTargetPsiElement)result).getTarget()).getNavigationElement();
  final DomElement domElement = DomUtil.getDomElement(naviElem);
  assertNotNull(domElement);
  assertNotNull(domElement.getParentOfType(AntDomMacrodefAttribute.class, false));
}
项目:intellij-ce-playground    文件:ExtensionPointDocumentationProvider.java   
@Nullable
private static ExtensionPoint findExtensionPoint(PsiElement element) {
  if (element instanceof PomTargetPsiElement &&
      DescriptorUtil.isPluginXml(element.getContainingFile())) {
    final PomTarget pomTarget = ((PomTargetPsiElement)element).getTarget();
    if (pomTarget instanceof DomTarget) {
      final DomElement domElement = ((DomTarget)pomTarget).getDomElement();
      if (domElement instanceof ExtensionPoint) {
        return (ExtensionPoint)domElement;
      }
    }
  }
  return null;
}
项目:tools-idea    文件:DomDeclarationSearcher.java   
@Nullable
protected DomTarget createDomTarget(DomElement parent, DomElement nameElement) {
  final NameValue nameValue = nameElement.getAnnotation(NameValue.class);
  if (nameValue != null && nameValue.referencable()) {
    return DomTarget.getTarget(parent);
  }
  return null;
}
项目:tools-idea    文件:DomPatterns.java   
public static ElementPattern<DomTarget> withDomTarget(final ElementPattern<? extends DomElement> pattern) {
  return new ObjectPattern.Capture<DomTarget>(DomTarget.class).with(new PatternCondition<DomTarget>("withDomTarget") {
    @Override
    public boolean accepts(@NotNull final DomTarget target, final ProcessingContext context) {
      return pattern.accepts(target.getDomElement(), context);
    }
  });
}
项目:tools-idea    文件:AntDomReferenceBase.java   
@Nullable 
public static DomElement toDomElement(PsiElement resolve) {
  if (resolve instanceof PomTargetPsiElement) {
    final PomTarget target = ((PomTargetPsiElement)resolve).getTarget();
    if(target instanceof DomTarget) {
      return ((DomTarget)target).getDomElement();
    }
    return null;
  }
  return DomUtil.getDomElement(resolve);
}
项目:tools-idea    文件:AntRenameProcessor.java   
@Nullable 
private static AntDomElement convertToAntDomElement(PsiElement element) {
  if (element instanceof PomTargetPsiElement) {
    final PomTarget target = ((PomTargetPsiElement)element).getTarget();
    if (target instanceof DomTarget) {
      final DomElement domElement = ((DomTarget)target).getDomElement();
      if (domElement instanceof AntDomElement) {
        return (AntDomElement)domElement;
      }
    }
  }
  return null;
}
项目:tools-idea    文件:AntDomDeclarationSearcher.java   
protected DomTarget createDomTarget(DomElement parent, DomElement nameElement) {
  if (parent instanceof AntDomElement && nameElement.equals(((AntDomElement)parent).getId())) { // id attrib is defined
    return DomTarget.getTarget(parent, (GenericDomValue)nameElement);
  }
  if (parent instanceof AntDomProperty && nameElement.equals(((AntDomProperty)parent).getEnvironment())) { // environment attrib is defined
    return DomTarget.getTarget(parent, (GenericDomValue)nameElement);
  }
  return null;
}
项目:tools-idea    文件:AntDomTargetReference.java   
public PsiElement resolve(@NotNull PsiReference psiReference, boolean incompleteCode) {
  final TargetResolver.Result result = ((AntDomTargetReference)psiReference).doResolve(psiReference.getCanonicalText());
  if (result == null) {
    return null;
  }
  final Pair<AntDomTarget,String> pair = result.getResolvedTarget(psiReference.getCanonicalText());
  final DomTarget domTarget = pair != null && pair.getFirst() != null ? DomTarget.getTarget(pair.getFirst()) : null;
  return domTarget != null? PomService.convertToPsi(domTarget) : null;
}
项目:tools-idea    文件:AntDomProperty.java   
public PsiElement getNavigationElement(final String propertyName) {
  DomTarget domTarget = DomTarget.getTarget(this);
  if (domTarget == null) {
    final GenericAttributeValue<String> environment = getEnvironment();
    if (environment.getRawText() != null) {
      domTarget = DomTarget.getTarget(this, environment);
    }
    if (domTarget == null) {
      final GenericAttributeValue<String> resource = getResource();
      if (resource.getRawText() != null) {
        domTarget = DomTarget.getTarget(this, resource);
      }
    }
  }

  if (domTarget != null) {
    final PsiElement psi = PomService.convertToPsi(domTarget);
    if (psi != null) {
      return psi;
    }
  }

  final PsiFileSystemItem psiFile = getFile().getValue();
  if (psiFile != null) {
    final String prefix = getPropertyPrefixValue();
    String _propertyName = propertyName;
    if (prefix != null) {
      if (!propertyName.startsWith(prefix)) {
        return null;
      }
      _propertyName = propertyName.substring(prefix.length());
    }
    if (psiFile instanceof PropertiesFile) {
      final IProperty property = ((PropertiesFile)psiFile).findPropertyByKey(_propertyName);
      return property != null? property.getPsiElement() : null;
    }
  }
  return null;
}
项目:tools-idea    文件:BuildTask.java   
public BuildTask(final AntBuildTargetBase target, final AntDomElement task) {
  myTarget = target;
  myName = task.getXmlElementName();
  final DomTarget domTarget = DomTarget.getTarget(task);
  if (domTarget != null) {
    myOffset = domTarget.getTextOffset();
  }
  else {
    myOffset = task.getXmlTag().getTextOffset();
  }
}
项目:tools-idea    文件:AntResolveTest.java   
public void testPropertyInMacrodefParam() throws Exception {
  PsiReference ref = configure();
  final PsiElement result = ref.resolve();
  assertTrue(result instanceof PomTargetPsiElement);
  final PsiElement naviElem = ((DomTarget)((PomTargetPsiElement)result).getTarget()).getNavigationElement();
  final DomElement domElement = DomUtil.getDomElement(naviElem);
  assertNotNull(domElement);
  assertNotNull(domElement.getParentOfType(AntDomMacrodefAttribute.class, false));
}
项目:tools-idea    文件:ExtensionImpl.java   
@Override
public ExtensionPoint getExtensionPoint() {
  PsiElement declaration = getChildDescription().getDeclaration(getManager().getProject());
  if (declaration instanceof PomTargetPsiElement) {
    PomTarget target = ((PomTargetPsiElement)declaration).getTarget();
    return target instanceof DomTarget ? (ExtensionPoint)((DomTarget)target).getDomElement() : null;
  }
  return null;
}
项目:tools-idea    文件:DevKitUseScopeEnlarger.java   
@Override
public SearchScope getAdditionalUseScope(@NotNull PsiElement element) {
  if (element instanceof PomTargetPsiElement) {
    PomTarget target = ((PomTargetPsiElement)element).getTarget();
    if (target instanceof DomTarget) {
      DomElement domElement = ((DomTarget)target).getDomElement();
      if (domElement instanceof ExtensionPoint) {
        return GlobalSearchScope.allScope(element.getProject());
      }
    }
  }
  return null;
}
项目:consulo-apache-ant    文件:AntDomReferenceBase.java   
@Nullable 
public static DomElement toDomElement(PsiElement resolve) {
  if (resolve instanceof PomTargetPsiElement) {
    final PomTarget target = ((PomTargetPsiElement)resolve).getTarget();
    if(target instanceof DomTarget) {
      return ((DomTarget)target).getDomElement();
    }
    return null;
  }
  return DomUtil.getDomElement(resolve);
}
项目:consulo-apache-ant    文件:AntRenameProcessor.java   
@Nullable 
private static AntDomElement convertToAntDomElement(PsiElement element) {
  if (element instanceof PomTargetPsiElement) {
    final PomTarget target = ((PomTargetPsiElement)element).getTarget();
    if (target instanceof DomTarget) {
      final DomElement domElement = ((DomTarget)target).getDomElement();
      if (domElement instanceof AntDomElement) {
        return (AntDomElement)domElement;
      }
    }
  }
  return null;
}
项目:consulo-apache-ant    文件:AntDomDeclarationSearcher.java   
protected DomTarget createDomTarget(DomElement parent, DomElement nameElement) {
  if (parent instanceof AntDomElement && nameElement.equals(((AntDomElement)parent).getId())) { // id attrib is defined
    return DomTarget.getTarget(parent, (GenericDomValue)nameElement);
  }
  if (parent instanceof AntDomProperty && nameElement.equals(((AntDomProperty)parent).getEnvironment())) { // environment attrib is defined
    return DomTarget.getTarget(parent, (GenericDomValue)nameElement);
  }
  return null;
}
项目:consulo-apache-ant    文件:AntDomExtender.java   
@Nullable
private static PomTarget doFindDeclaration(DomElement parent, XmlName xmlName) {
  if (!(parent instanceof AntDomElement)) {
    return null;
  }
  final AntDomElement parentElement = (AntDomElement)parent;
  final AntDomProject antDomProject = parentElement.getAntProject();
  if (antDomProject == null) {
    return null;
  }
  final CustomAntElementsRegistry registry = CustomAntElementsRegistry.getInstance(antDomProject);
  final AntDomElement declaringElement = registry.findDeclaringElement(parentElement, xmlName);
  if (declaringElement == null) {
    return null;
  }
  DomTarget target = DomTarget.getTarget(declaringElement);
  if (target == null && declaringElement instanceof AntDomTypeDef) {
    final AntDomTypeDef typedef = (AntDomTypeDef)declaringElement;
    final GenericAttributeValue<PsiFileSystemItem> resource = typedef.getResource();
    if (resource != null) {
      target = DomTarget.getTarget(declaringElement, resource);
    }
    if (target == null) {
      final GenericAttributeValue<PsiFileSystemItem> file = typedef.getFile();
      if (file != null) {
        target = DomTarget.getTarget(declaringElement, file);
      }
    }
  }
  return target;
}
项目:consulo-apache-ant    文件:AntDomProject.java   
@Nullable
public PsiElement getNavigationElement(String propertyName) {
  final DomTarget target = DomTarget.getTarget(this);
  final PsiElement nameElementPsi = target != null ? PomService.convertToPsi(target) : null;
  if (nameElementPsi != null) {
    return nameElementPsi;
  }
  final XmlElement xmlElement = getXmlElement();
  return xmlElement != null? xmlElement.getNavigationElement() : null;
}
项目:consulo-apache-ant    文件:AntDomTargetReference.java   
public PsiElement resolve(@NotNull PsiReference psiReference, boolean incompleteCode) {
  final TargetResolver.Result result = ((AntDomTargetReference)psiReference).doResolve(psiReference.getCanonicalText());
  if (result == null) {
    return null;
  }
  final Pair<AntDomTarget,String> pair = result.getResolvedTarget(psiReference.getCanonicalText());
  final DomTarget domTarget = pair != null && pair.getFirst() != null ? DomTarget.getTarget(pair.getFirst()) : null;
  return domTarget != null? PomService.convertToPsi(domTarget) : null;
}
项目:consulo-apache-ant    文件:AntDomProperty.java   
public PsiElement getNavigationElement(final String propertyName) {
  DomTarget domTarget = DomTarget.getTarget(this);
  if (domTarget == null) {
    final GenericAttributeValue<String> environment = getEnvironment();
    if (environment.getRawText() != null) {
      domTarget = DomTarget.getTarget(this, environment);
    }
    if (domTarget == null) {
      final GenericAttributeValue<String> resource = getResource();
      if (resource.getRawText() != null) {
        domTarget = DomTarget.getTarget(this, resource);
      }
    }
  }

  if (domTarget != null) {
    final PsiElement psi = PomService.convertToPsi(domTarget);
    if (psi != null) {
      return psi;
    }
  }

  final PsiFileSystemItem psiFile = getFile().getValue();
  if (psiFile != null) {
    final String prefix = getPropertyPrefixValue();
    String _propertyName = propertyName;
    if (prefix != null) {
      if (!propertyName.startsWith(prefix)) {
        return null;
      }
      _propertyName = propertyName.substring(prefix.length());
    }
    if (psiFile instanceof PropertiesFile) {
      final IProperty property = ((PropertiesFile)psiFile).findPropertyByKey(_propertyName);
      return property != null? property.getPsiElement() : null;
    }
  }
  return null;
}
项目:consulo-apache-ant    文件:BuildTask.java   
public BuildTask(final AntBuildTargetBase target, final AntDomElement task) {
  myTarget = target;
  myName = task.getXmlElementName();
  final DomTarget domTarget = DomTarget.getTarget(task);
  if (domTarget != null) {
    myOffset = domTarget.getTextOffset();
  }
  else {
    myOffset = task.getXmlTag().getTextOffset();
  }
}
项目:consulo-javaee    文件:JamCommonUtil.java   
@Nullable
public static Object getModelObject(PsiElement element)
{
    if(!(element instanceof PomTargetPsiElement))
    {
        return null;
    }
    final PomTarget target = ((PomTargetPsiElement) element).getTarget();
    return target instanceof CommonModelTarget ? ((CommonModelTarget) target).getCommonElement() : target instanceof JamPomTarget ? ((JamPomTarget) target).getJamElement() : target instanceof
            DomTarget ? ((DomTarget) target).getDomElement() : null;
}
项目:consulo-xml    文件:DomDeclarationSearcher.java   
@Nullable
protected DomTarget createDomTarget(DomElement parent, DomElement nameElement) {
  final NameValue nameValue = nameElement.getAnnotation(NameValue.class);
  if (nameValue != null && nameValue.referencable()) {
    return DomTarget.getTarget(parent);
  }
  return null;
}
项目:consulo-xml    文件:DomPatterns.java   
public static ElementPattern<DomTarget> withDomTarget(final ElementPattern<? extends DomElement> pattern) {
  return new ObjectPattern.Capture<DomTarget>(DomTarget.class).with(new PatternCondition<DomTarget>("withDomTarget") {
    @Override
    public boolean accepts(@NotNull final DomTarget target, final ProcessingContext context) {
      return pattern.accepts(target.getDomElement(), context);
    }
  });
}
项目:consulo-javaee    文件:BaseImpl.java   
public PsiElement getIdentifyingPsiElement() {
  final DomTarget target = DomTarget.getTarget(this);
  return target == null? getXmlElement() : PomService.convertToPsi(target);
}