Ejemplo n.º 1
0
  @Nullable
  private static JavaMethod getGetterMethod(final DomElement element, final DomElement parent) {
    final String xmlElementName = element.getXmlElementName();
    final String namespace = element.getXmlElementNamespaceKey();
    final DomGenericInfo genericInfo = parent.getGenericInfo();

    if (element instanceof GenericAttributeValue) {
      final DomAttributeChildDescription description =
          genericInfo.getAttributeChildDescription(xmlElementName, namespace);
      assert description != null;
      return description.getGetterMethod();
    }

    final DomFixedChildDescription description =
        genericInfo.getFixedChildDescription(xmlElementName, namespace);
    return description != null
        ? description.getGetterMethod(description.getValues(parent).indexOf(element))
        : null;
  }
  @Nullable
  public String getNamespace(@NotNull XmlTag context) {
    final DomInvocationHandler handler =
        DomManagerImpl.getDomManager(myProject).getDomHandler(context);

    if (handler == null) {
      return null;
    }
    return handler
        .createEvaluatedXmlName(myDescription.getXmlName())
        .getNamespace(context, handler.getFile());
  }
 @NonNls
 public String getName(final PsiElement context) {
   return getQualifiedAttributeName(context, myDescription.getXmlName());
 }
 @Nullable
 public PsiElement getDeclaration() {
   return myDescription.getDeclaration(myProject);
 }
 public boolean isRequired() {
   return myDescription.getAnnotation(Required.class) != null;
 }
 private String getLocalName() {
   return myDescription.getXmlName().getLocalName();
 }