当前位置: 首页>>代码示例>>Java>>正文


Java GenericAttributeValue类代码示例

本文整理汇总了Java中com.intellij.util.xml.GenericAttributeValue的典型用法代码示例。如果您正苦于以下问题:Java GenericAttributeValue类的具体用法?Java GenericAttributeValue怎么用?Java GenericAttributeValue使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。


GenericAttributeValue类属于com.intellij.util.xml包,在下文中一共展示了GenericAttributeValue类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: expectDomAttributeValue

import com.intellij.util.xml.GenericAttributeValue; //导入依赖的package包/类
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);
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:26,代码来源:BeansUtils.java

示例2: resolveModifier

import com.intellij.util.xml.GenericAttributeValue; //导入依赖的package包/类
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)");
    }

}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:20,代码来源:TSStructureTreeElement.java

示例3: findAlternativeDoms

import com.intellij.util.xml.GenericAttributeValue; //导入依赖的package包/类
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());
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:24,代码来源:TypeSystemGutterAnnotator.java

示例4: getName

import com.intellij.util.xml.GenericAttributeValue; //导入依赖的package包/类
/**
 * 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();
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:12,代码来源:Property.java

示例5: resolveToPsiField

import com.intellij.util.xml.GenericAttributeValue; //导入依赖的package包/类
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);
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:28,代码来源:BeansUtils.java

示例6: useAttributeValue

import com.intellij.util.xml.GenericAttributeValue; //导入依赖的package包/类
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);

}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:13,代码来源:TypeSystemConverterBase.java

示例7: navigateToValue

import com.intellij.util.xml.GenericAttributeValue; //导入依赖的package包/类
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);

}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:13,代码来源:TypeSystemConverterBase.java

示例8: findAllExtendingXmlAttributes

import com.intellij.util.xml.GenericAttributeValue; //导入依赖的package包/类
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());
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:9,代码来源:TypeSystemGutterAnnotator.java

示例9: getElement

import com.intellij.util.xml.GenericAttributeValue; //导入依赖的package包/类
@Nullable
@Override
public PsiElement getElement() {
    final GenericAttributeValue<String> codeAttr = myDomItemType.getCode();
    return codeAttr == null ? null : codeAttr.getXmlAttributeValue();
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:7,代码来源:TypeSystemItemReference.java

示例10: resolveValue

import com.intellij.util.xml.GenericAttributeValue; //导入依赖的package包/类
private String resolveValue(final GenericAttributeValue<String> attributeValue) {
    if (attributeValue != null) {
        return attributeValue.getStringValue();
    }
    return null;
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:7,代码来源:TSStructureTreeElement.java

示例11: getExtends

import com.intellij.util.xml.GenericAttributeValue; //导入依赖的package包/类
/**
 * 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();
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:13,代码来源:AtomicType.java

示例12: getScope

import com.intellij.util.xml.GenericAttributeValue; //导入依赖的package包/类
/**
 * Returns the value of the scope child.
 *
 * @return the value of the scope child.
 */
@NotNull
GenericAttributeValue<Scope> getScope();
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:8,代码来源:Annotations.java

示例13: getExtends

import com.intellij.util.xml.GenericAttributeValue; //导入依赖的package包/类
/**
 * Returns the value of the extends child.
 *
 * @return the value of the extends child.
 */
@NotNull
GenericAttributeValue<String> getExtends();
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:8,代码来源:Bean.java

示例14: getType

import com.intellij.util.xml.GenericAttributeValue; //导入依赖的package包/类
/**
 * 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();
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:12,代码来源:Bean.java

示例15: getDeprecated

import com.intellij.util.xml.GenericAttributeValue; //导入依赖的package包/类
/**
 * 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();
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:12,代码来源:Bean.java


注:本文中的com.intellij.util.xml.GenericAttributeValue类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。