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

项目:hybris-integration-intellij-idea-plugin    文件:BeansUtils.java   
public static <T extends DomElement, V> GenericAttributeValue<V> expectDomAttributeValue(
    @NotNull final PsiElement element,
    @NotNull final Class<? extends T> domTagClass,
    @NotNull final Function<T, GenericAttributeValue<V>> domGetter
) {
    final DomManager domManager = DomManager.getDomManager(element.getProject());

    if (!(element instanceof XmlElement)) {
        return null;
    }

    final XmlAttribute xmlAttribute = PsiTreeUtil.getParentOfType(element, XmlAttribute.class, false);
    if (xmlAttribute == null) {
        return null;
    }

    final XmlTag xmlParentTag = PsiTreeUtil.getParentOfType(element, XmlTag.class, false);
    DomElement domParentTag = domManager.getDomElement(xmlParentTag);

    return Optional.ofNullable(domParentTag)
                   .map(o -> ObjectUtils.tryCast(o, domTagClass))
                   .map(domGetter)
                   .filter(val -> val == domManager.getDomElement(xmlAttribute))
                   .orElse(null);
}
项目:hybris-integration-intellij-idea-plugin    文件:TSStructureTreeElement.java   
private void resolveModifier(
    final GenericAttributeValue<Boolean> attribute,
    final String methodName,
    final List<String> resultList
) {
    if (attribute == null) {
        return;
    }
    final Boolean value = BooleanUtils.toBooleanObject(attribute.getStringValue());
    if (value == null) {
        return;
    }
    if (value) {
        resultList.add(methodName);
    } else {
        resultList.add(methodName + "(false)");
    }

}
项目:hybris-integration-intellij-idea-plugin    文件:TypeSystemGutterAnnotator.java   
private static Collection<XmlAttributeValue> findAlternativeDoms(@NotNull final ItemType source) {
    final String code = source.getCode().getStringValue();

    if (StringUtil.isEmpty(code)) {
        return Collections.emptyList();
    }
    final XmlElement element = source.getXmlElement();
    final PsiFile psiFile = element == null ? null : element.getContainingFile();

    if (psiFile == null) {
        return Collections.emptyList();
    }
    final TSMetaModel externalModel = TSMetaModelAccess.getInstance(psiFile.getProject()).
        getExternalTypeSystemMeta(psiFile);

    return Optional.ofNullable(externalModel.findMetaClassForDom(source))
                   .map(TSMetaClass::retrieveAllDomsStream)
                   .orElse(Stream.empty())
                   .filter(dom -> !dom.equals(source))
                   .map(ItemType::getCode)
                   .map(GenericAttributeValue::getXmlAttributeValue)
                   .collect(Collectors.toList());
}
项目:hybris-integration-intellij-idea-plugin    文件:Property.java   
/**
 * Returns the value of the name child.
 *
 * @return the value of the name child.
 */
@NotNull
@Required
//NOTE: We have to avoid @Convert since PsiField is in the read-only file and thus can't be renamed by platform
//NOTE: Instead we are renaming the attribute value itself, see BeansRenamePsiElementProcessor
//@Convert(soft = true, value = BeansPropertyNameConverter.class)
GenericAttributeValue<String> getName();
项目:hybris-integration-intellij-idea-plugin    文件:BeansUtils.java   
public static PsiField resolveToPsiField(@NotNull final Property property, @Nullable final String name) {
    if (StringUtil.isEmptyOrSpaces(name)) {
        return null;
    }

    if (!(property.getParent() instanceof Bean)) {
        return null;
    }
    final Bean bean = (Bean) property.getParent();
    final GenericAttributeValue<String> clazz = bean.getClazz();
    if (!clazz.exists()) {
        return null;
    }

    final XmlAttributeValue xmlValue = clazz.getXmlAttributeValue();
    if (xmlValue == null) {
        return null;
    }
    return Arrays.stream(xmlValue.getReferences())
                 .map(PsiReference::resolve)
                 .map(o -> ObjectUtils.tryCast(o, PsiClass.class))
                 .filter(Objects::nonNull)
                 .map(nextClass -> nextClass.findFieldByName(name, false))
                 .filter(Objects::nonNull)
                 .findAny()
                 .orElse(null);
}
项目:hybris-integration-intellij-idea-plugin    文件:TypeSystemConverterBase.java   
protected static <D extends DomElement, R> R useAttributeValue(
    @Nullable final D dom,
    @NotNull final Function<? super D, GenericAttributeValue<R>> attribute
) {

    return
        Optional.ofNullable(dom)
                .map(attribute)
                .map(GenericAttributeValue::getValue)
                .orElse(null);

}
项目:hybris-integration-intellij-idea-plugin    文件:TypeSystemConverterBase.java   
protected static <D extends DomElement> XmlAttributeValue navigateToValue(
    @Nullable final D dom,
    @NotNull final Function<? super D, GenericAttributeValue<?>> attribute
) {

    return
        Optional.ofNullable(dom)
                .map(attribute)
                .map(GenericAttributeValue::getXmlAttributeValue)
                .orElse(null);

}
项目:hybris-integration-intellij-idea-plugin    文件:TypeSystemGutterAnnotator.java   
private static Collection<PsiElement> findAllExtendingXmlAttributes(@NotNull final ItemType source) {
    return getExtendingMetaClassNamesStream(source)
        .flatMap(TSMetaClass::retrieveAllDomsStream)
        .map(ItemType::getCode)
        .map(GenericAttributeValue::getXmlAttributeValue)
        .filter(Objects::nonNull)
        .collect(Collectors.toList());
}
项目:hybris-integration-intellij-idea-plugin    文件:TypeSystemItemReference.java   
@Nullable
@Override
public PsiElement getElement() {
    final GenericAttributeValue<String> codeAttr = myDomItemType.getCode();
    return codeAttr == null ? null : codeAttr.getXmlAttributeValue();
}
项目:hybris-integration-intellij-idea-plugin    文件:TSStructureTreeElement.java   
private String resolveValue(final GenericAttributeValue<String> attributeValue) {
    if (attributeValue != null) {
        return attributeValue.getStringValue();
    }
    return null;
}
项目:hybris-integration-intellij-idea-plugin    文件:TypeSystemItemReference.java   
@Nullable
@Override
public PsiElement getElement() {
    final GenericAttributeValue<String> codeAttr = myDomItemType.getCode();
    return codeAttr == null ? null : codeAttr.getXmlAttributeValue();
}
项目:hybris-integration-intellij-idea-plugin    文件:AtomicType.java   
/**
 * Returns the value of the extends child.
 * <pre>
 * <h3>Attribute null:extends documentation</h3>
 * Defines the class which will be extended. Default is 'java.lang.Object'.
 * </pre>
 *
 * @return the value of the extends child.
 */
@NotNull
@com.intellij.util.xml.Attribute("extends")
GenericAttributeValue<String> getExtends();
项目:hybris-integration-intellij-idea-plugin    文件:Annotations.java   
/**
 * Returns the value of the scope child.
 *
 * @return the value of the scope child.
 */
@NotNull
GenericAttributeValue<Scope> getScope();
项目:hybris-integration-intellij-idea-plugin    文件:Bean.java   
/**
 * Returns the value of the extends child.
 *
 * @return the value of the extends child.
 */
@NotNull
GenericAttributeValue<String> getExtends();
项目:hybris-integration-intellij-idea-plugin    文件:Bean.java   
/**
 * Returns the value of the type child.
 * <pre>
 * <h3>Attribute null:type documentation</h3>
 * Defines the type of bean. Allowed are 'bean' or 'event'.
 * </pre>
 *
 * @return the value of the type child.
 */
@NotNull
GenericAttributeValue<String> getType();
项目:hybris-integration-intellij-idea-plugin    文件:Bean.java   
/**
 * Returns the value of the deprecated child.
 * <pre>
 * <h3>Attribute null:deprecated documentation</h3>
 * Marks bean as deprecated. Allows defining a message.
 * </pre>
 *
 * @return the value of the deprecated child.
 */
@NotNull
GenericAttributeValue<String> getDeprecated();
项目:hybris-integration-intellij-idea-plugin    文件:Bean.java   
/**
 * Returns the value of the abstract child.
 *
 * @return the value of the abstract child.
 */
@NotNull
GenericAttributeValue<Boolean> getAbstract();
项目:hybris-integration-intellij-idea-plugin    文件:Bean.java   
/**
 * Returns the value of the superEquals child.
 *
 * @return the value of the superEquals child.
 */
@NotNull
GenericAttributeValue<Boolean> getSuperEquals();
项目:hybris-integration-intellij-idea-plugin    文件:Bean.java   
/**
 * Returns the value of the class child.
 *
 * @return the value of the class child.
 */
@NotNull
@Attribute("class")
@Required
GenericAttributeValue<String> getClazz();
项目:hybris-integration-intellij-idea-plugin    文件:Bean.java   
/**
 * Returns the value of the template child.
 *
 * @return the value of the template child.
 */
@NotNull
GenericAttributeValue<String> getTemplate();
项目:hybris-integration-intellij-idea-plugin    文件:Property.java   
/**
 * Returns the value of the type child.
 *
 * @return the value of the type child.
 */
@NotNull
@Required
GenericAttributeValue<String> getType();
项目:hybris-integration-intellij-idea-plugin    文件:Value.java   
/**
 * Returns the value of the code child.
 * <pre>
 * <h3>Attribute null:code documentation</h3>
 * The unique code of this element.
 * </pre>
 *
 * @return the value of the code child.
 */
@NotNull
@com.intellij.util.xml.Attribute("code")
@Required
GenericAttributeValue<String> getCode();
项目:hybris-integration-intellij-idea-plugin    文件:Property.java   
/**
 * Returns the value of the deprecated child.
 * <pre>
 * <h3>Attribute null:deprecated documentation</h3>
 * Marks property as deprecated. Allows defining a message.
 * </pre>
 *
 * @return the value of the deprecated child.
 */
@NotNull
GenericAttributeValue<String> getDeprecated();
项目:hybris-integration-intellij-idea-plugin    文件:Enum.java   
/**
 * Returns the value of the deprecated child.
 * <pre>
 * <h3>Attribute null:deprecated documentation</h3>
 * Marks bean as deprecated. Allows defining a message.
 * </pre>
 *
 * @return the value of the deprecated child.
 */
@NotNull
GenericAttributeValue<String> getDeprecated();
项目:hybris-integration-intellij-idea-plugin    文件:Enum.java   
/**
 * Returns the value of the class child.
 *
 * @return the value of the class child.
 */
@NotNull
@Attribute("class")
@Required
GenericAttributeValue<String> getClazz();
项目:hybris-integration-intellij-idea-plugin    文件:Enum.java   
/**
 * Returns the value of the template child.
 *
 * @return the value of the template child.
 */
@NotNull
GenericAttributeValue<String> getTemplate();
项目:hybris-integration-intellij-idea-plugin    文件:AbstractPojo.java   
/**
 * Returns the value of the class child.
 *
 * @return the value of the class child.
 */
@NotNull
@Attribute("class")
@Required
GenericAttributeValue<String> getClazz();
项目:hybris-integration-intellij-idea-plugin    文件:AbstractPojo.java   
/**
 * Returns the value of the template child.
 *
 * @return the value of the template child.
 */
@NotNull
GenericAttributeValue<String> getTemplate();
项目:hybris-integration-intellij-idea-plugin    文件:Import.java   
/**
 * Returns the value of the type child.
 *
 * @return the value of the type child.
 */
@NotNull
@Required
GenericAttributeValue<String> getType();
项目:hybris-integration-intellij-idea-plugin    文件:Import.java   
/**
 * Returns the value of the static child.
 *
 * @return the value of the static child.
 */
@NotNull
GenericAttributeValue<Boolean> getStatic();
项目:hybris-integration-intellij-idea-plugin    文件:Attribute.java   
/**
 * Returns the value of the redeclare child.
 * <pre>
 * <h3>Attribute null:redeclare documentation</h3>
 * Lets you re-define the attribute definition from an inherited type. In essence, you can use a different type of attribute as well as different modifier combinations than on the supertype. Default is 'false'.
 * </pre>
 *
 * @return the value of the redeclare child.
 */
@NotNull
@com.intellij.util.xml.Attribute("redeclare")
GenericAttributeValue<Boolean> getRedeclare();
项目:hybris-integration-intellij-idea-plugin    文件:Attribute.java   
/**
 * Returns the value of the qualifier child.
 * <pre>
 * <h3>Attribute null:qualifier documentation</h3>
 * Qualifier of this attribute. Attribute qualifiers    must be unique across a single type.
 * </pre>
 *
 * @return the value of the qualifier child.
 */
@NotNull
@com.intellij.util.xml.Attribute("qualifier")
@Required
GenericAttributeValue<String> getQualifier();
项目:hybris-integration-intellij-idea-plugin    文件:Attribute.java   
/**
 * Returns the value of the type child.
 * <pre>
 * <h3>Attribute null:type documentation</h3>
 * The type of the attribute, such as 'Product', 'int' or 'java.lang.String'. Primitive java types will be mapped to the corresponding atomic type. For example: 'int' will be mapped to the atomic type    'java.lang.Integer' with implicit default value.
 * </pre>
 *
 * @return the value of the type child.
 */
@NotNull
@com.intellij.util.xml.Attribute("type")
@Required
@Convert(value = CompositeConverter.AnyClassifier.class, soft = true)
GenericAttributeValue<String> getType();
项目:hybris-integration-intellij-idea-plugin    文件:Attribute.java   
/**
 * Returns the value of the metatype child.
 * <pre>
 * <h3>Attribute null:metatype documentation</h3>
 * Advanced setting. Specifies the metatype for the attributes definition. Must be a type extending AttributeDescriptor. Default is 'AttributeDescriptor'.
 * </pre>
 *
 * @return the value of the metatype child.
 */
@NotNull
@com.intellij.util.xml.Attribute("metatype")
GenericAttributeValue<String> getMetaType();
项目:hybris-integration-intellij-idea-plugin    文件:Attribute.java   
/**
 * Returns the value of the autocreate child.
 * <pre>
 * <h3>Attribute null:autocreate documentation</h3>
 * If 'true', the attribute descriptor will be created during initialization. Default is 'true'.
 * </pre>
 *
 * @return the value of the autocreate child.
 */
@NotNull
@com.intellij.util.xml.Attribute("autocreate")
GenericAttributeValue<Boolean> getAutoCreate();
项目:hybris-integration-intellij-idea-plugin    文件:Attribute.java   
/**
 * Returns the value of the generate child.
 * <pre>
 * <h3>Attribute null:generate documentation</h3>
 * If 'true', getter and setter methods for this    attribute will be generated during a hybris Suite build. Default is 'true'.
 * </pre>
 *
 * @return the value of the generate child.
 */
@NotNull
@com.intellij.util.xml.Attribute("generate")
GenericAttributeValue<Boolean> getGenerate();
项目:hybris-integration-intellij-idea-plugin    文件:Attribute.java   
/**
 * Returns the value of the isSelectionOf child.
 * <pre>
 * <h3>Attribute null:isSelectionOf documentation</h3>
 * References an attribute of the same type. Only values of the referenced attribute can be selected    as values for this attribute. Typical example: the default delivery address of a customer must be one of the addresses set for the customer. Default is 'false'.
 * </pre>
 *
 * @return the value of the isSelectionOf child.
 */
@NotNull
@com.intellij.util.xml.Attribute("isSelectionOf")
GenericAttributeValue<String> getIsSelectionOf();
项目:hybris-integration-intellij-idea-plugin    文件:CustomProperty.java   
/**
 * Returns the value of the name child.
 * <pre>
 * <h3>Attribute null:name documentation</h3>
 * The name of the custom property.
 * </pre>
 *
 * @return the value of the name child.
 */
@NotNull
@com.intellij.util.xml.Attribute("name")
@Required
GenericAttributeValue<String> getName();
项目:hybris-integration-intellij-idea-plugin    文件:Modifiers.java   
/**
 * Returns the value of the read child.
 * <pre>
 * <h3>Attribute null:read documentation</h3>
 * Defines if this attribute is readable (that is, if a getter method will be generated). Default is 'true'.    The visibility of the getter depends on the value of the private attribute.
 * </pre>
 *
 * @return the value of the read child.
 */
@NotNull
@com.intellij.util.xml.Attribute("read")
GenericAttributeValue<Boolean> getRead();
项目:hybris-integration-intellij-idea-plugin    文件:Modifiers.java   
/**
 * Returns the value of the write child.
 * <pre>
 * <h3>Attribute null:write documentation</h3>
 * Defines if this attribute is writable (that is, if a setter method will be generated). Default is 'true'.    The visibility of the setter depends on the value of the private attribute.
 * </pre>
 *
 * @return the value of the write child.
 */
@NotNull
@com.intellij.util.xml.Attribute("write")
GenericAttributeValue<Boolean> getWrite();