本文整理汇总了Java中com.intellij.patterns.XmlAttributeValuePattern类的典型用法代码示例。如果您正苦于以下问题:Java XmlAttributeValuePattern类的具体用法?Java XmlAttributeValuePattern怎么用?Java XmlAttributeValuePattern使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
XmlAttributeValuePattern类属于com.intellij.patterns包,在下文中一共展示了XmlAttributeValuePattern类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: tagAttributeValuePattern
import com.intellij.patterns.XmlAttributeValuePattern; //导入依赖的package包/类
/**
* <tagName attributeName="XmlAttributeValue">
*/
public static XmlAttributeValuePattern tagAttributeValuePattern(
String tagName,
String attributeName,
String fileName
) {
return XmlPatterns
.xmlAttributeValue()
.withParent(
XmlPatterns
.xmlAttribute(attributeName)
.withParent(
XmlPatterns
.xmlTag()
.withName(tagName)
)
).inside(
insideTagPattern(tagName)
).inFile(XmlPatterns.psiFile()
.withName(XmlPatterns.string().endsWith(fileName + ".xml")));
}
示例2: registerReferenceProviders
import com.intellij.patterns.XmlAttributeValuePattern; //导入依赖的package包/类
@Override
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar psiReferenceRegistrar) {
// <service class="\Namespace\Interface" />
XmlAttributeValuePattern serviceTag = XmlHelper.getTagAttributeValuePattern(
XmlHelper.SERVICE_TAG,
XmlHelper.CLASS_ATTRIBUTE
);
psiReferenceRegistrar.registerReferenceProvider(
serviceTag,
new XmlReferenceProvider(new ReferenceResultsFiller[]{
InterfacesResultsFiller.INSTANCE
}));
// <service method="MethodName"/>
XmlAttributeValuePattern methodAttribute = XmlHelper.getMethodAttributePattern();
psiReferenceRegistrar.registerReferenceProvider(
methodAttribute,
new XmlReferenceProvider(new ReferenceResultsFiller[]{
new ServiceMethodResultsFiller()
})
);
}
示例3: getXmlTargetDocumentClass
import com.intellij.patterns.XmlAttributeValuePattern; //导入依赖的package包/类
/**
* <reference-one target-document="Foo"/>
* <reference-many target-document="Foo"/>
* <embed-many target-document="Foo"/>
* <embed-one target-document="Foo"/>
*/
public static XmlAttributeValuePattern getXmlTargetDocumentClass() {
return XmlPatterns
.xmlAttributeValue()
.withParent(XmlPatterns
.xmlAttribute("target-document")
.withParent(XmlPatterns
.xmlTag().withName(PlatformPatterns.string().oneOf("reference-one", "reference-many", "embed-many", "embed-one"))
.withParent(
XmlPatterns.xmlTag().withName(XmlPatterns.string().oneOf("embedded-document", "embedded", "document")).withParent(
XmlPatterns.xmlTag().withName(PlatformPatterns.string().matches(DOCTRINE_MAPPING))
)
)
)
);
}
示例4: getXmlTargetEntityClass
import com.intellij.patterns.XmlAttributeValuePattern; //导入依赖的package包/类
/**
* <one-to-one target-entity="Foo">
* <one-to-many target-entity="Foo">
* <many-to-one target-entity="Foo">
* <many-to-many target-entity="Foo">
*/
public static XmlAttributeValuePattern getXmlTargetEntityClass() {
return XmlPatterns
.xmlAttributeValue()
.withParent(XmlPatterns
.xmlAttribute("target-entity")
.withParent(XmlPatterns
.xmlTag().withName(PlatformPatterns.string().oneOf("one-to-one", "one-to-many", "many-to-one", "many-to-many"))
.withParent(
XmlPatterns.xmlTag().withName("entity").withParent(
XmlPatterns.xmlTag().withName(PlatformPatterns.string().matches(DOCTRINE_MAPPING))
)
)
)
);
}
示例5: getFieldType
import com.intellij.patterns.XmlAttributeValuePattern; //导入依赖的package包/类
/**
* <doctrine-mapping|doctrine-*-mapping>
* <field type="Class\Name"/>
* </doctrine-mapping>
*/
public static XmlAttributeValuePattern getFieldType() {
return XmlPatterns
.xmlAttributeValue()
.withParent(XmlPatterns
.xmlAttribute("type")
.withParent(XmlPatterns
.xmlTag().withName("field")
.withParent(
XmlPatterns.xmlTag().withName(XmlPatterns.string().oneOf("entity", "document", "embedded-document", "embedded")).withParent(
XmlPatterns.xmlTag().withName(PlatformPatterns.string().matches(DOCTRINE_MAPPING))
)
)
)
);
}
示例6: getFieldName
import com.intellij.patterns.XmlAttributeValuePattern; //导入依赖的package包/类
/**
* <doctrine-mapping|doctrine-*-mapping>
* <document><field name="Foo"/></document>
* <document><id name="Foo"/></document>
* </doctrine-mapping>
*/
public static XmlAttributeValuePattern getFieldName() {
return XmlPatterns
.xmlAttributeValue()
.withParent(XmlPatterns
.xmlAttribute("name")
.withParent(XmlPatterns
.xmlTag().withName(XmlPatterns.string().oneOf("field", "id"))
.withParent(
XmlPatterns.xmlTag().withName(XmlPatterns.string().oneOf("entity", "document", "embedded-document", "embedded")).withParent(
XmlPatterns.xmlTag().withName(PlatformPatterns.string().matches(DOCTRINE_MAPPING))
)
)
)
);
}
示例7: getFieldNameRelation
import com.intellij.patterns.XmlAttributeValuePattern; //导入依赖的package包/类
/**
* <doctrine-mapping|doctrine-*-mapping>
* <document><embed-one field="Foo"/></document>
* </doctrine-mapping>
*/
public static XmlAttributeValuePattern getFieldNameRelation() {
return XmlPatterns
.xmlAttributeValue()
.withParent(XmlPatterns
.xmlAttribute("field")
.withParent(XmlPatterns
.xmlTag().withName(XmlPatterns.string().oneOf("embed-one", "embed-many", "reference-one", "reference-many", "one-to-one", "one-to-many", "many-to-one", "many-to-many"))
.withParent(
XmlPatterns.xmlTag().withName(XmlPatterns.string().oneOf("entity", "document", "embedded-document", "embedded")).withParent(
XmlPatterns.xmlTag().withName(PlatformPatterns.string().matches(DOCTRINE_MAPPING))
)
)
)
);
}
示例8: attributeValuePattern
import com.intellij.patterns.XmlAttributeValuePattern; //导入依赖的package包/类
public static XmlAttributeValuePattern attributeValuePattern(final String tagName, final String attributeName) {
return XmlPatterns
.xmlAttributeValue()
.withParent(
XmlPatterns
.xmlAttribute(attributeName)
.withParent(
XmlPatterns
.xmlTag()
.withName(tagName)
)
);
}
示例9: getXmlModelClass
import com.intellij.patterns.XmlAttributeValuePattern; //导入依赖的package包/类
/**
* <doctrine-mapping|doctrine-*-mapping>
* <entity name="Class\Name"/>
* </doctrine-mapping>
*
* <doctrine-mapping|doctrine-*-mapping>
* <document name="Class\Name"/>
* </doctrine-mapping>
*/
public static XmlAttributeValuePattern getXmlModelClass() {
return XmlPatterns
.xmlAttributeValue()
.withParent(XmlPatterns
.xmlAttribute("name")
.withParent(XmlPatterns
.xmlTag().withName(PlatformPatterns.string().oneOf("document", "entity", "embedded-document", "embedded"))
.withParent(XmlPatterns
.xmlTag().withName(PlatformPatterns.string().matches(DOCTRINE_MAPPING))
)
)
);
}
示例10: getEmbeddableNameClassPattern
import com.intellij.patterns.XmlAttributeValuePattern; //导入依赖的package包/类
public static XmlAttributeValuePattern getEmbeddableNameClassPattern() {
return XmlPatterns
.xmlAttributeValue()
.withParent(XmlPatterns
.xmlAttribute("name")
.withParent(XmlPatterns
.xmlTag().withName("embeddable")
.withParent(XmlPatterns
.xmlTag().withName(PlatformPatterns.string().matches(DOCTRINE_MAPPING))
)
)
);
}
示例11: getXmlRepositoryClass
import com.intellij.patterns.XmlAttributeValuePattern; //导入依赖的package包/类
/**
* <doctrine-mapping|doctrine-*-mapping>
* <document repository-class="Class\Name"/>
* <entity repository-class="Class\Name"/>
* </doctrine-mapping>
*/
public static XmlAttributeValuePattern getXmlRepositoryClass() {
return XmlPatterns
.xmlAttributeValue()
.withParent(XmlPatterns
.xmlAttribute("repository-class")
.withParent(XmlPatterns
.xmlTag().withName(PlatformPatterns.string().oneOf("document", "entity"))
.withParent(XmlPatterns
.xmlTag().withName(PlatformPatterns.string().matches(DOCTRINE_MAPPING))
)
)
);
}
示例12: ResolvingVisitor
import com.intellij.patterns.XmlAttributeValuePattern; //导入依赖的package包/类
public ResolvingVisitor(XmlAttributeValuePattern pattern, ProcessingContext context) {
myPattern = pattern;
myProcessingContext = context;
myProcessingContext.put(VISITED_KEY, new THashSet<XmlFile>());
}
示例13: registerReferenceProviders
import com.intellij.patterns.XmlAttributeValuePattern; //导入依赖的package包/类
@Override
public void registerReferenceProviders(@NotNull PsiReferenceRegistrar registrar) {
final XmlAttributeValuePattern attributeValueInFxml = XmlPatterns.xmlAttributeValue().inVirtualFile(
virtualFile().withExtension(JavaFxFileTypeFactory.FXML_EXTENSION));
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withParent(XmlPatterns.xmlAttribute().withName(FxmlConstants.FX_CONTROLLER))
.and(attributeValueInFxml),
CLASS_REFERENCE_PROVIDER);
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue()
.withParent(XmlPatterns.xmlAttribute().withName("type")
.withParent(XmlPatterns.xmlTag().withName(FxmlConstants.FX_ROOT)))
.and(attributeValueInFxml),
new MyJavaClassReferenceProvider());
registrar.registerReferenceProvider(XmlPatterns.xmlTag().inVirtualFile(virtualFile().withExtension(JavaFxFileTypeFactory.FXML_EXTENSION)),
new MyJavaClassReferenceProvider());
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withParent(XmlPatterns.xmlAttribute().withName(FxmlConstants.FX_ID))
.and(attributeValueInFxml),
new JavaFxFieldIdReferenceProvider());
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withParent(XmlPatterns.xmlAttribute().withName(FxmlConstants.FX_ELEMENT_SOURCE)
.withParent(XmlPatterns.xmlTag()
.withName(FxmlConstants.FX_INCLUDE)))
.and(attributeValueInFxml),
new JavaFxSourceReferenceProvider());
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withParent(XmlPatterns.xmlAttribute().withName(FxmlConstants.FX_ELEMENT_SOURCE)
.withParent(XmlPatterns.xmlTag()
.withName(FxmlConstants.FX_SCRIPT)))
.and(attributeValueInFxml),
new JavaFxSourceReferenceProvider());
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withParent(XmlPatterns.xmlAttribute().withName(FxmlConstants.FX_ELEMENT_SOURCE)
.withParent(XmlPatterns.xmlTag()
.withName(string().oneOf(FxmlConstants.FX_REFERENCE, FxmlConstants.FX_COPY))))
.and(attributeValueInFxml),
new JavaFxComponentIdReferenceProvider());
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withParent(XmlPatterns.xmlAttribute().withName(FxmlConstants.FX_FACTORY))
.and(attributeValueInFxml),
new JavaFxFactoryReferenceProvider());
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withValue(string().startsWith("#"))
.and(attributeValueInFxml),
new JavaFxEventHandlerReferenceProvider());
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withValue(string().startsWith("@")).and(attributeValueInFxml),
new JavaFxLocationReferenceProvider());
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withValue(string().startsWith("$")).and(attributeValueInFxml),
new JavaFxComponentIdReferenceProvider());
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withParent(XmlPatterns.xmlAttribute().withName("url")).and(attributeValueInFxml),
new JavaFxLocationReferenceProvider(false, "png"));
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().withParent(XmlPatterns.xmlAttribute().withName(FxmlConstants.STYLESHEETS)).and(attributeValueInFxml),
new JavaFxLocationReferenceProvider(true, "css"));
registrar.registerReferenceProvider(PlatformPatterns.psiElement(XmlProcessingInstruction.class).inVirtualFile(virtualFile().withExtension(JavaFxFileTypeFactory.FXML_EXTENSION)),
new ImportReferenceProvider());
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue().and(attributeValueInFxml),
new JavaFxColorReferenceProvider());
registrar.registerReferenceProvider(XmlPatterns.xmlAttributeValue()
.withParent(XmlPatterns.xmlAttribute().withName(FxmlConstants.FX_VALUE)
.withParent(XmlPatterns.xmlTag().withParent(XmlPatterns.xmlTag().withName(FxmlConstants.STYLESHEETS))))
.and(attributeValueInFxml),
new JavaFxLocationReferenceProvider(true, "css"));
}
示例14: getTagAttributeValuePattern
import com.intellij.patterns.XmlAttributeValuePattern; //导入依赖的package包/类
/**
* <tagName attributeName="XmlAttributeValue">
*/
public static XmlAttributeValuePattern getTagAttributeValuePattern(String tagName, String attributeName) {
return getTagAttributeValuePattern(tagName, attributeName, FILE_TYPE);
}
示例15: getMethodAttributePattern
import com.intellij.patterns.XmlAttributeValuePattern; //导入依赖的package包/类
/**
* <service method="MethodName">
*/
public static XmlAttributeValuePattern getMethodAttributePattern() {
return getTagAttributeValuePattern(SERVICE_TAG, METHOD_ATTRIBUTE, FILE_TYPE);
}