• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

Java ConvertContext类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

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



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

示例1: fromString

import com.intellij.util.xml.ConvertContext; //导入依赖的package包/类
@Override
public String fromString(@Nullable @NonNls String s, final ConvertContext context) {
  if (s == null) return null;

  if (myAllowEmpty && s.trim().length() == 0) return s;

  if (s.trim().length() == 1) return s;

  if (isUnicodeCharacterSequence(s)) {
    try {
      Integer.parseInt(s.substring(UNICODE_PREFIX.length()), 16);
      return s;
    }  catch (NumberFormatException e) {}

  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:CharacterValueConverter.java


示例2: doIsValid

import com.intellij.util.xml.ConvertContext; //导入依赖的package包/类
@Override
protected boolean doIsValid(MavenId id, MavenProjectIndicesManager manager, ConvertContext context) {
  if (StringUtil.isEmpty(id.getGroupId()) || StringUtil.isEmpty(id.getArtifactId())) return false;
  if (manager.hasArtifactId(id.getGroupId(), id.getArtifactId())) {
    return true;
  }

  // Check if artifact was found on importing.
  MavenProject mavenProject = findMavenProject(context);
  if (mavenProject != null) {
    for (MavenArtifact artifact : mavenProject.findDependencies(id.getGroupId(), id.getArtifactId())) {
      if (artifact.isResolved()) {
        return true;
      }
    }
  }

  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:20,代码来源:MavenArtifactCoordinatesArtifactIdConverter.java


示例3: fromString

import com.intellij.util.xml.ConvertContext; //导入依赖的package包/类
public TargetResolver.Result fromString(@Nullable @NonNls String s, ConvertContext context) {
  final AntDomProject project = context.getInvocationElement().getParentOfType(AntDomProject.class, false);
  if (project == null) {
    return null;
  }
  final AntDomTarget contextTarget = context.getInvocationElement().getParentOfType(AntDomTarget.class, false);
  if (contextTarget == null) {
    return null;
  }
  final List<String> refs;
  if (s == null) {
    refs = Collections.emptyList();
  }
  else {
    refs = new ArrayList<String>();
    final StringTokenizer tokenizer = new StringTokenizer(s, ",", false);
    while (tokenizer.hasMoreTokens()) {
      final String ref = tokenizer.nextToken();
      refs.add(ref.trim());
    }
  }
  final TargetResolver.Result result = TargetResolver.resolve(project.getContextAntProject(), contextTarget, refs);
  result.setRefsString(s);
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:AntDomTargetDependsListConverter.java


示例4: fromString

import com.intellij.util.xml.ConvertContext; //导入依赖的package包/类
@Nullable
public TargetResolver.Result fromString(@Nullable @NonNls String s, ConvertContext context) {
  final AntDomElement element = AntSupport.getInvocationAntDomElement(context);
  if (element != null && s != null) {
    final AntDomProject project = element.getAntProject();
    AntDomProject projectToSearchFrom;
    final AntDomAnt antDomAnt = element.getParentOfType(AntDomAnt.class, false);
    if (antDomAnt != null) {
      final PsiFileSystemItem antFile = antDomAnt.getAntFilePath().getValue();
      projectToSearchFrom = antFile instanceof PsiFile? AntSupport.getAntDomProjectForceAntFile((PsiFile)antFile) : null; 
    }
    else {
      projectToSearchFrom = project.getContextAntProject();
    }
    if (projectToSearchFrom == null) {
      return null;
    }
    final TargetResolver.Result result = TargetResolver.resolve(projectToSearchFrom, null, s);
    result.setRefsString(s);
    return result;
  }
  return null;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:24,代码来源:AntDomDefaultTargetConverter.java


示例5: fromString

import com.intellij.util.xml.ConvertContext; //导入依赖的package包/类
@Nullable
@Override
public ActionOrGroup fromString(@Nullable @NonNls final String value, ConvertContext context) {
  if (StringUtil.isEmptyOrSpaces(value)) return null;

  final ActionOrGroup[] result = {null};
  PairProcessor<String, ActionOrGroup> findProcessor = new PairProcessor<String, ActionOrGroup>() {
    @Override
    public boolean process(String s, ActionOrGroup actionOrGroup) {
      if (isRelevant(actionOrGroup) &&
          Comparing.strEqual(value, s)) {
        result[0] = actionOrGroup;
        return false;
      }
      return true;
    }
  };
  processActionOrGroup(context, findProcessor);
  return result[0];
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:21,代码来源:ActionOrGroupResolveConverter.java


示例6: collectLibraryLanguages

import com.intellij.util.xml.ConvertContext; //导入依赖的package包/类
private static List<LanguageDefinition> collectLibraryLanguages(final ConvertContext context,
                                                                final Collection<PsiClass> allLanguages) {
  return ContainerUtil.mapNotNull(Language.getRegisteredLanguages(), new NullableFunction<Language, LanguageDefinition>() {
    @Override
    public LanguageDefinition fun(Language language) {
      if (language.getID().isEmpty() ||
          language instanceof DependentLanguage) {
        return null;
      }
      final PsiClass psiClass = DomJavaUtil.findClass(language.getClass().getName(), context.getInvocationElement());
      if (psiClass == null) {
        return null;
      }

      if (!allLanguages.contains(psiClass)) {
        return null;
      }

      final LanguageFileType type = language.getAssociatedFileType();
      final Icon icon = type != null ? type.getIcon() : null;
      return new LanguageDefinition(language.getID(),
                                    psiClass,
                                    icon, language.getDisplayName());
    }
  });
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:27,代码来源:LanguageResolvingUtil.java


示例7: getVariants

import com.intellij.util.xml.ConvertContext; //导入依赖的package包/类
@NotNull
@Override
public Collection<? extends String> getVariants(ConvertContext context) {
  final XmlElement element = context.getXmlElement();

  if (element == null) {
    return Collections.emptyList();
  }
  final String value = ResourceReferenceConverter.getValue(element);

  if (value == null) {
    return Collections.emptyList();
  }
  final String intPrefix = getIntegerPrefix(value);

  if (intPrefix.isEmpty()) {
    return Collections.emptyList();
  }
  final List<String> result = new ArrayList<String>(ourUnits.size());

  for (String unit : ourUnits.keySet()) {
    result.add(intPrefix + unit);
  }
  return result;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:26,代码来源:DimensionConverter.java


示例8: doIsValid

import com.intellij.util.xml.ConvertContext; //导入依赖的package包/类
@Override
protected boolean doIsValid(MavenId id, MavenProjectIndicesManager manager, ConvertContext context) {
  if (StringUtil.isEmpty(id.getGroupId())) return false;

  if (manager.hasGroupId(id.getGroupId())) return true;

      // Check if artifact was found on importing.
  MavenProject mavenProject = findMavenProject(context);
  if (mavenProject != null) {
    for (MavenArtifact artifact : mavenProject.findDependencies(id.getGroupId(), id.getArtifactId())) {
      if (artifact.isResolved()) {
        return true;
      }
    }
  }

  return false;
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:19,代码来源:MavenArtifactCoordinatesGroupIdConverter.java


示例9: createReferences

import com.intellij.util.xml.ConvertContext; //导入依赖的package包/类
@NotNull
@Override
public PsiReference[] createReferences(GenericDomValue value, final PsiElement element, final ConvertContext context) {
  return new PsiReference[]{new WebReference(element) {
    @NotNull
    @Override
    public Object[] getVariants() {
      Module module = context.getModule();

      if (module != null) {
        String name = MavenRepositoriesProvider.getInstance().getRepositoryUrl(getRepositoryId(context));
        if (!StringUtil.isEmptyOrSpaces(name)) return new Object[]{name};
      }
      return super.getVariants();
    }
  }};
}
 
开发者ID:jskierbi,项目名称:intellij-ce-playground,代码行数:18,代码来源:MavenRepositoryConverter.java


示例10: fromString

import com.intellij.util.xml.ConvertContext; //导入依赖的package包/类
@Nullable
@Override
public PsiField fromString(@Nullable final String text, final ConvertContext context) {
    DomElement host = context.getInvocationElement();
    if (host instanceof GenericAttributeValue<?>) {
        DomElement domProperty = host.getParent();
        return domProperty instanceof Property ? BeansUtils.resolveToPsiField((Property) domProperty, text) : null;
    }
    return null;
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:11,代码来源:BeansPropertyNameConverter.java


示例11: searchForName

import com.intellij.util.xml.ConvertContext; //导入依赖的package包/类
@Override
protected ItemType searchForName(
    @NotNull final String name, @NotNull final ConvertContext context, @NotNull final TSMetaModel meta
) {
    return Optional.ofNullable(meta.findMetaClassByName(name))
                   .map(TSMetaClass::retrieveAllDomsStream)
                   .orElse(Stream.empty())
                   .findFirst()
                   .orElse(null);
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:11,代码来源:ItemTypeConverter.java


示例12: searchAll

import com.intellij.util.xml.ConvertContext; //导入依赖的package包/类
@Override
protected Collection<? extends ItemType> searchAll(
    @NotNull final ConvertContext context, @NotNull final TSMetaModel meta
) {
    return meta.getMetaClassesStream()
               .map(TSMetaClass::retrieveAllDomsStream)
               .map(Stream::findFirst)
               .filter(Optional::isPresent)
               .map(Optional::get)
               .collect(Collectors.toList());
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:12,代码来源:ItemTypeConverter.java


示例13: fromString

import com.intellij.util.xml.ConvertContext; //导入依赖的package包/类
@Nullable
@Override
public final DOM fromString(
    @Nullable @NonNls final String s, final ConvertContext context
) {
    if (StringUtil.isEmpty(s)) {
        return null;
    }
    return searchForName(s, context, TSMetaModelAccess.getInstance(context.getProject()).
        getTypeSystemMeta(context.getFile()));
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:12,代码来源:TypeSystemConverterBase.java


示例14: searchForName

import com.intellij.util.xml.ConvertContext; //导入依赖的package包/类
@Override
protected AtomicType searchForName(
    @NotNull final String name, @NotNull final ConvertContext context, @NotNull final TSMetaModel meta
) {
    return Optional.ofNullable(meta.findMetaAtomicByName(name))
                   .map(TSMetaAtomic::retrieveDom)
                   .orElse(null);
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:9,代码来源:AtomicTypeConverter.java


示例15: searchAll

import com.intellij.util.xml.ConvertContext; //导入依赖的package包/类
@Override
protected Collection<? extends AtomicType> searchAll(
    @NotNull final ConvertContext context, @NotNull final TSMetaModel meta
) {
    return meta.getMetaAtomicStream()
               .map(TSMetaAtomic::retrieveDom)
               .filter(Objects::nonNull)
               .collect(Collectors.toList());
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:10,代码来源:AtomicTypeConverter.java


示例16: searchForName

import com.intellij.util.xml.ConvertContext; //导入依赖的package包/类
@Override
protected CollectionType searchForName(
    @NotNull final String name, @NotNull final ConvertContext context, @NotNull final TSMetaModel meta
) {
    return Optional.ofNullable(meta.findMetaCollectionByName(name))
                   .map(TSMetaCollection::retrieveDom)
                   .orElse(null);
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:9,代码来源:CollectionTypeConverter.java


示例17: searchAll

import com.intellij.util.xml.ConvertContext; //导入依赖的package包/类
@Override
protected Collection<? extends CollectionType> searchAll(
    @NotNull final ConvertContext context, @NotNull final TSMetaModel meta
) {
    return meta.getMetaCollectionsStream()
               .map(TSMetaCollection::retrieveDom)
               .filter(Objects::nonNull)
               .collect(Collectors.toList());
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:10,代码来源:CollectionTypeConverter.java


示例18: getVariants

import com.intellij.util.xml.ConvertContext; //导入依赖的package包/类
@NotNull
@Override
public Collection<? extends DOM> getVariants(final ConvertContext context) {
    final List<DOM> result = new LinkedList<>();
    for (TypeSystemConverterBase<? extends DOM> next : myDelegates) {
        result.addAll(next.getVariants(context));
    }
    return result;
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:10,代码来源:CompositeConverter.java


示例19: fromString

import com.intellij.util.xml.ConvertContext; //导入依赖的package包/类
@Nullable
@Override
public DOM fromString(
    @Nullable @NonNls final String s, final ConvertContext context
) {
    for (TypeSystemConverterBase<? extends DOM> next : myDelegates) {
        final DOM nextResult = next.fromString(s, context);
        if (nextResult != null) {
            return nextResult;
        }
    }
    return null;
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:14,代码来源:CompositeConverter.java


示例20: toString

import com.intellij.util.xml.ConvertContext; //导入依赖的package包/类
@Nullable
@Override
public String toString(@Nullable final DOM t, final ConvertContext context) {
    for (TypeSystemConverterBase<? extends DOM> next : myDelegates) {
        final String nextToString = next.tryToString(t, context);
        if (nextToString != null) {
            return nextToString;
        }
    }
    return null;
}
 
开发者ID:AlexanderBartash,项目名称:hybris-integration-intellij-idea-plugin,代码行数:12,代码来源:CompositeConverter.java



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java Strings类代码示例发布时间:2022-05-22
下一篇:
Java FontManager类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap