本文整理了Java中com.intellij.psi.xml.XmlTag.getProject()
方法的一些代码示例,展示了XmlTag.getProject()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。XmlTag.getProject()
方法的具体详情如下:
包路径:com.intellij.psi.xml.XmlTag
类名称:XmlTag
方法名:getProject
暂无
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
private ContainerCollectionResolver.LazyServiceCollector getLazyServiceCollector(XmlTag xmlTag) {
if(this.lazyServiceCollector != null) {
return this.lazyServiceCollector;
}
return this.lazyServiceCollector = new ContainerCollectionResolver.LazyServiceCollector(xmlTag.getProject());
}
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
public static void fixServiceArgument(@NotNull List<String> args, final @NotNull XmlTag xmlTag) {
fixServiceArgument(xmlTag.getProject(), args, new XmlInsertServicesCallback(xmlTag));
}
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
@Nullable
private Pair<String, Method> findMethodParameterHint(@NotNull XmlTag argumentTag) {
PsiElement serviceTag = argumentTag.getParent();
if("service".equalsIgnoreCase(((XmlTag) serviceTag).getName())) {
String aClass = XmlHelper.getClassFromServiceDefinition((XmlTag) serviceTag);
if(aClass != null && StringUtils.isNotBlank(aClass)) {
return getParamater(argumentTag.getProject(), aClass, aVoid -> XmlHelper.getArgumentIndex(argumentTag));
}
}
return null;
}
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
public static void addServices(List<String> items, XmlTag xmlTag) {
for (String item : items) {
if(StringUtils.isBlank(item)) {
item = "?";
}
XmlTag tag = XmlElementFactory.getInstance(xmlTag.getProject()).createTagFromText(String.format("<argument type=\"service\" id=\"%s\"/>", item), xmlTag.getLanguage());
xmlTag.addSubTag(tag, false);
}
}
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
@Nullable
public static PhpClass getPhpClassFromXmlTag(@NotNull XmlTag xmlTag, @NotNull ContainerCollectionResolver.LazyServiceCollector collector) {
String className = xmlTag.getAttributeValue("class");
if(className == null) {
String id = xmlTag.getAttributeValue("id");
if(id == null || !YamlHelper.isClassServiceId(id)) {
return null;
}
className = id;
}
// @TODO: cache defs
PhpClass resolvedClassDefinition = ServiceUtil.getResolvedClassDefinition(xmlTag.getProject(), className, collector);
if(resolvedClassDefinition == null) {
return null;
}
return resolvedClassDefinition;
}
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
xmlTag.getProject(),
ServiceUtil.ServiceLineMarker.DECORATE,
lazyDecoratedParentServiceValues.getDecoratedServices(),
xmlTag.getProject(),
ServiceUtil.ServiceLineMarker.PARENT,
lazyDecoratedParentServiceValues.getParentServices(),
代码示例来源:origin: Haehnchen/idea-php-symfony2-plugin
PhpClass phpClass = ServiceUtil.getResolvedClassDefinition(argumentTag.getProject(), aClass);
if(phpClass != null) {
int parameter = PhpElementsUtil.getConstructorArgumentByName(phpClass, StringUtils.stripStart(keyAttr, "$"));
String aClass = XmlHelper.getClassFromServiceDefinition((XmlTag) serviceTag);
if(aClass != null) {
PhpClass phpClass = ServiceUtil.getResolvedClassDefinition(argumentTag.getProject(), aClass);
if(phpClass != null) {
Method methodByName = phpClass.findMethodByName(methodName);
代码示例来源:origin: jiaolong1021/ElementPlugin
/**
* 给特定标签添加属性
* @param xmlTag
* @return
*/
@Override
public XmlAttributeDescriptor[] getAttributeDescriptors(XmlTag xmlTag) {
final Project project = xmlTag.getProject();
for (Map.Entry<String, HashMap<String, String[]>> next : ElementTagConstant.TAG_CONSTANT.entrySet()) {
if (next.getKey().equals(xmlTag.getName())) {
HashMap<String, String[]> attrMap = next.getValue();
XmlAttributeDescriptor[] attributeDescriptors = new ElementAttributeDescriptor[attrMap.size()];
int i = 0;
for(Map.Entry<String, String[]> attr : attrMap.entrySet()){
attributeDescriptors[i] = new ElementAttributeDescriptor(project, attr.getKey(), attr.getValue());
i++;
}
return attributeDescriptors;
}
}
return XmlAttributeDescriptor.EMPTY;
}
代码示例来源:origin: mustfun/mybatis-plus
@SuppressWarnings("unchecked")
@NotNull
@Override
public Optional<PsiNameIdentifierOwner> apply(@NotNull XmlTag from) {
Optional<PsiNameIdentifierOwner> optional = Optional.absent();
DomElement domElement = DomUtil.getDomElement(from);
//如果是Mapper
if (domElement instanceof Mapper){
String namespace = ((Mapper) domElement).getNamespace().toString();
Optional<PsiClass> clazz = JavaUtils.findClazz(from.getProject(), namespace);
//有可能找不到
if (clazz.isPresent()){
return Optional.of(clazz.get());
}
}else{
if (null == domElement) {
optional = Optional.absent();
} else {
Optional<PsiMethod> method = JavaUtils.findMethod(from.getProject(), (IdDomElement) domElement);
if (!method.isPresent()){
return Optional.absent();
}
optional = Optional.of(method.get());
}
}
return optional;
}
代码示例来源:origin: AlexanderBartash/hybris-integration-intellij-idea-plugin
return;
final DomElement dom = DomManager.getDomManager(parentTag.getProject()).getDomElement(parentTag);
内容来源于网络,如有侵权,请联系作者删除!