public class XmlUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static interface |
XmlUtil.DuplicationInfoProvider<T extends PsiElement> |
Modifier and Type | Field and Description |
---|---|
static Key<java.lang.Boolean> |
ANT_FILE_SIGN |
static java.lang.String |
ANT_URI |
static java.lang.String |
APACHE_I18N_URI |
static java.lang.String |
APACHE_TRINIDAD_HTML_URI |
static java.lang.String |
APACHE_TRINIDAD_URI |
static java.lang.ThreadLocal<java.lang.Boolean> |
BUILDING_DOM_STUBS |
static java.lang.String |
EMPTY_URI |
static java.lang.String |
ENUMERATION_TAG_NAME |
static java.lang.String |
FACELETS_URI |
static java.lang.String |
FACELETS_URI_JAVAEE_7 |
static java.lang.String[] |
FACELETS_URIS |
static java.lang.String |
HTML_URI |
static java.lang.String |
HTML4_LOOSE_URI |
static java.lang.String |
JSF_CORE_URI |
static java.lang.String |
JSF_CORE_URI_JAVAEE_7 |
static java.lang.String[] |
JSF_CORE_URIS |
static java.lang.String |
JSF_HTML_URI |
static java.lang.String |
JSF_HTML_URI_JAVAEE_7 |
static java.lang.String[] |
JSF_HTML_URIS |
static java.lang.String |
JSF_PASS_THROUGH_ATTR_URI_JAVAEE7 |
static java.lang.String |
JSF_PASSTHROUGH_URI |
static java.lang.String |
JSP_URI |
static java.lang.String |
JSTL_CORE_FACELET_URI |
static java.lang.String |
JSTL_CORE_URI |
static java.lang.String |
JSTL_CORE_URI_JAVAEE_7 |
static java.lang.String |
JSTL_CORE_URI2 |
static java.lang.String |
JSTL_CORE_URI3 |
static java.lang.String[] |
JSTL_CORE_URIS |
static java.lang.String |
JSTL_FN_FACELET_URI |
static java.lang.String |
JSTL_FORMAT_URI |
static java.lang.String |
JSTL_FORMAT_URI2 |
static java.lang.String[] |
JSTL_FORMAT_URIS |
static java.lang.String |
JSTL_FUNCTIONS_JAVAEE_7 |
static java.lang.String |
JSTL_FUNCTIONS_URI |
static java.lang.String |
JSTL_FUNCTIONS_URI2 |
static java.lang.String[] |
JSTL_FUNCTIONS_URIS |
static java.lang.String |
NO_NAMESPACE_SCHEMA_LOCATION_ATT |
static java.util.List<java.lang.String> |
ourSchemaUrisList |
static java.lang.String |
SCHEMA_LOCATION_ATT |
static java.lang.String[] |
SCHEMA_URIS |
static java.lang.String |
SPRING_FORMS_URI |
static java.lang.String |
SPRING_URI |
static java.lang.String |
STRUTS_BEAN_URI |
static java.lang.String |
STRUTS_BEAN_URI2 |
static java.lang.String |
STRUTS_HTML_URI |
static java.lang.String |
STRUTS_HTML_URI2 |
static java.lang.String |
STRUTS_LOGIC_URI |
static java.lang.String |
TAG_DIR_NS_PREFIX |
static java.lang.String |
TAGLIB_1_2_URI |
static java.lang.String |
TARGET_NAMESPACE_ATTR_NAME |
static Key<java.lang.String> |
TEST_PATH |
static java.lang.String |
VALUE_ATTR_NAME |
static java.lang.String[] |
WEB_XML_URIS |
static java.lang.String |
WSDL_SCHEMA_URI |
static java.lang.String |
XHTML_URI |
static java.lang.String |
XHTML4_SCHEMA_LOCATION |
static java.lang.String |
XINCLUDE_URI |
static java.lang.String |
XML_NAMESPACE_URI |
static java.lang.String |
XML_SCHEMA_INSTANCE_URI |
static java.lang.String |
XML_SCHEMA_URI |
static java.lang.String |
XML_SCHEMA_URI2 |
static java.lang.String |
XML_SCHEMA_URI3 |
static java.lang.String |
XML_SCHEMA_VERSIONING_URI |
static java.lang.String |
XSD_SIMPLE_CONTENT_TAG |
static java.lang.String |
XSLT_URI |
Modifier and Type | Method and Description |
---|---|
static XmlTag |
addChildTag(XmlTag parent,
XmlTag child,
int index) |
static boolean |
attributeFromTemplateFramework(java.lang.String name,
XmlTag tag) |
static boolean |
collectEnumerationValues(XmlTag element,
java.util.HashSet<? super java.lang.String> variants) |
static XmlTag |
createChildTag(XmlTag xmlTag,
java.lang.String localName,
java.lang.String namespace,
java.lang.String bodyText,
boolean enforceNamespacesDeep) |
static <T extends PsiElement> |
doDuplicationCheckForElements(T[] elements,
java.util.Map<java.lang.String,T> presentNames,
XmlUtil.DuplicationInfoProvider<? super T> provider,
Validator.ValidationHost host) |
static java.lang.String |
escape(java.lang.String text) |
static void |
expandTag(XmlTag tag) |
static java.lang.String |
extractXmlEncodingFromProlog(byte [] content) |
static java.lang.String |
extractXmlEncodingFromProlog(java.lang.CharSequence text) |
static XmlFile |
findDescriptorFile(XmlTag tag,
XmlFile containingFile) |
static java.lang.String |
findLocalNameByQualifiedName(java.lang.String name) |
static XmlFile |
findNamespace(PsiFile base,
java.lang.String nsLocation) |
static XmlFile |
findNamespaceByLocation(PsiFile base,
java.lang.String nsLocation) |
static java.lang.String |
findNamespaceByPrefix(java.lang.String prefix,
XmlTag contextTag) |
static java.lang.String |
findNamespacePrefixByURI(XmlFile file,
java.lang.String uri) |
static java.util.Collection<XmlFile> |
findNSFilesByURI(java.lang.String namespace,
Project project,
Module module) |
static java.lang.String |
findPrefixByQualifiedName(java.lang.String name) |
static XmlComment |
findPreviousComment(PsiElement element) |
static PsiNamedElement |
findRealNamedElement(PsiNamedElement _element) |
static PsiFile |
findRelativeFile(java.lang.String uri,
PsiElement base) |
static Pair<XmlTagChild,XmlTagChild> |
findTagChildrenInRange(PsiFile file,
int startOffset,
int endOffset) |
static XmlElementDescriptor |
findXmlDescriptorByType(XmlTag xmlTag) |
static XmlElementDescriptor |
findXmlDescriptorByType(XmlTag xmlTag,
XmlTag context) |
static XmlFile |
findXmlFile(PsiFile base,
java.lang.String uri) |
static java.lang.String |
generateDocumentDTD(XmlDocument doc,
boolean full) |
static java.lang.String |
generateElementDTD(java.lang.String name,
java.util.List<java.lang.String> tags,
java.util.List<? extends com.intellij.xml.util.XmlUtil.MyAttributeInfo> attributes) |
static char |
getCharFromEntityRef(java.lang.String text) |
static java.lang.String |
getCommentText(XmlComment comment)
Deprecated.
|
static XmlFile |
getContainingFile(PsiElement element) |
static java.lang.String[] [] |
getDefaultNamespaces(XmlDocument document) |
static java.lang.String |
getDefaultXhtmlNamespace(Project project) |
static XmlElementDescriptor |
getDescriptorFromContext(XmlTag tag) |
static java.lang.String |
getDtdUri(XmlDoctype doctype) |
static java.lang.String |
getDtdUri(XmlDocument document) |
static java.lang.CharSequence |
getLocalName(java.lang.CharSequence tagName) |
static int |
getPrefixLength(java.lang.String s) |
static java.lang.String |
getSchemaLocation(XmlTag tag,
java.lang.String namespace) |
static XmlTag |
getSchemaSimpleContent(XmlTag tag) |
static java.lang.String |
getTargetSchemaNsFromTag(XmlTag xmlTag) |
static XmlToken |
getTokenOfType(PsiElement element,
IElementType type) |
static boolean |
isAntFile(PsiFile file) |
static boolean |
isSimpleValue(java.lang.String unquotedValue,
PsiElement context) |
static boolean |
isStubBuilding() |
static boolean |
isTagDefinedByNamespace(XmlTag xmlTag) |
static boolean |
isUrlText(java.lang.String s,
Project project) |
static boolean |
isValidTagNameChar(char c) |
static boolean |
isXmlToken(PsiElement element,
IElementType tokenType) |
static boolean |
nsFromTemplateFramework(java.lang.String ns) |
static boolean |
processEnumerationValues(XmlTag element,
Processor<? super XmlTag> tagProcessor) |
static boolean |
processXmlElementChildren(XmlElement element,
PsiElementProcessor processor,
boolean deepFlag) |
static boolean |
processXmlElements(XmlElement element,
PsiElementProcessor processor,
boolean deepFlag) |
static boolean |
processXmlElements(XmlElement element,
PsiElementProcessor processor,
boolean deepFlag,
boolean wideFlag) |
static boolean |
processXmlElements(XmlElement element,
PsiElementProcessor processor,
boolean deepFlag,
boolean wideFlag,
PsiFile baseFile) |
static boolean |
processXmlElements(XmlElement element,
PsiElementProcessor processor,
boolean deepFlag,
boolean wideFlag,
PsiFile baseFile,
boolean processIncludes) |
static void |
reformatTagStart(XmlTag tag) |
static void |
registerXmlAttributeValueReferenceProvider(PsiReferenceRegistrar registrar,
java.lang.String [] attributeNames,
ElementFilter elementFilter,
boolean caseSensitive,
PsiReferenceProvider provider) |
static void |
registerXmlAttributeValueReferenceProvider(PsiReferenceRegistrar registrar,
java.lang.String [] attributeNames,
ElementFilter elementFilter,
boolean caseSensitive,
PsiReferenceProvider provider,
double priority) |
static void |
registerXmlAttributeValueReferenceProvider(PsiReferenceRegistrar registrar,
java.lang.String [] attributeNames,
ElementFilter elementFilter,
PsiReferenceProvider provider) |
static void |
registerXmlTagReferenceProvider(PsiReferenceRegistrar registrar,
java.lang.String[] names,
ElementFilter elementFilter,
boolean caseSensitive,
PsiReferenceProvider provider) |
static boolean |
tagFromTemplateFramework(XmlTag tag) |
static boolean |
toCode(char ch) |
static boolean |
toCode(java.lang.String str) |
static java.lang.String |
unescape(java.lang.String text) |
public static final java.lang.String XML_SCHEMA_URI
public static final java.lang.String XML_SCHEMA_URI2
public static final java.lang.String XML_SCHEMA_URI3
public static final java.lang.String[] SCHEMA_URIS
public static final java.lang.String XML_SCHEMA_INSTANCE_URI
public static final java.lang.String XML_SCHEMA_VERSIONING_URI
public static final java.lang.String XSLT_URI
public static final java.lang.String XINCLUDE_URI
public static final java.lang.String ANT_URI
public static final java.lang.String XHTML_URI
public static final java.lang.String HTML_URI
public static final java.lang.String EMPTY_URI
public static final Key<java.lang.String> TEST_PATH
public static final java.lang.String TAGLIB_1_2_URI
public static final java.lang.String JSP_URI
public static final java.lang.String JSTL_CORE_URI
public static final java.lang.String JSTL_CORE_URI2
public static final java.lang.String JSTL_CORE_URI3
public static final java.lang.String JSTL_CORE_URI_JAVAEE_7
public static final java.lang.String[] JSTL_CORE_URIS
public static final java.lang.String JSF_HTML_URI
public static final java.lang.String JSF_HTML_URI_JAVAEE_7
public static final java.lang.String[] JSF_HTML_URIS
public static final java.lang.String JSF_CORE_URI
public static final java.lang.String JSF_CORE_URI_JAVAEE_7
public static final java.lang.String[] JSF_CORE_URIS
public static final java.lang.String JSF_PASS_THROUGH_ATTR_URI_JAVAEE7
public static final java.lang.String JSF_PASSTHROUGH_URI
public static final java.lang.String JSTL_FORMAT_URI
public static final java.lang.String JSTL_FORMAT_URI2
public static final java.lang.String SPRING_URI
public static final java.lang.String SPRING_FORMS_URI
public static final java.lang.String STRUTS_BEAN_URI
public static final java.lang.String STRUTS_BEAN_URI2
public static final java.lang.String APACHE_I18N_URI
public static final java.lang.String STRUTS_LOGIC_URI
public static final java.lang.String STRUTS_HTML_URI
public static final java.lang.String STRUTS_HTML_URI2
public static final java.lang.String APACHE_TRINIDAD_URI
public static final java.lang.String APACHE_TRINIDAD_HTML_URI
public static final java.lang.String XSD_SIMPLE_CONTENT_TAG
public static final java.lang.String NO_NAMESPACE_SCHEMA_LOCATION_ATT
public static final java.lang.String SCHEMA_LOCATION_ATT
public static final java.lang.String[] WEB_XML_URIS
public static final java.lang.String FACELETS_URI
public static final java.lang.String FACELETS_URI_JAVAEE_7
public static final java.lang.String[] FACELETS_URIS
public static final java.lang.String JSTL_FUNCTIONS_URI
public static final java.lang.String JSTL_FUNCTIONS_URI2
public static final java.lang.String JSTL_FUNCTIONS_JAVAEE_7
public static final java.lang.String[] JSTL_FUNCTIONS_URIS
public static final java.lang.String JSTL_FN_FACELET_URI
public static final java.lang.String JSTL_CORE_FACELET_URI
public static final java.lang.String TARGET_NAMESPACE_ATTR_NAME
public static final java.lang.String XML_NAMESPACE_URI
public static final java.util.List<java.lang.String> ourSchemaUrisList
public static final Key<java.lang.Boolean> ANT_FILE_SIGN
public static final java.lang.String TAG_DIR_NS_PREFIX
public static final java.lang.String VALUE_ATTR_NAME
public static final java.lang.String ENUMERATION_TAG_NAME
public static final java.lang.String HTML4_LOOSE_URI
public static final java.lang.String WSDL_SCHEMA_URI
public static final java.lang.String XHTML4_SCHEMA_LOCATION
public static final java.lang.ThreadLocal<java.lang.Boolean> BUILDING_DOM_STUBS
public static final java.lang.String[] JSTL_FORMAT_URIS
public static java.lang.String getSchemaLocation(XmlTag tag, java.lang.String namespace)
public static java.lang.String findNamespacePrefixByURI(XmlFile file, java.lang.String uri)
public static XmlFile findNamespaceByLocation(PsiFile base, java.lang.String nsLocation)
public static java.util.Collection<XmlFile> findNSFilesByURI(java.lang.String namespace, Project project, Module module)
public static boolean isXmlToken(PsiElement element, IElementType tokenType)
public static XmlToken getTokenOfType(PsiElement element, IElementType type)
public static boolean processXmlElements(XmlElement element, PsiElementProcessor processor, boolean deepFlag)
public static boolean processXmlElements(XmlElement element, PsiElementProcessor processor, boolean deepFlag, boolean wideFlag)
public static boolean processXmlElements(XmlElement element, PsiElementProcessor processor, boolean deepFlag, boolean wideFlag, PsiFile baseFile)
public static boolean processXmlElements(XmlElement element, PsiElementProcessor processor, boolean deepFlag, boolean wideFlag, PsiFile baseFile, boolean processIncludes)
public static boolean processXmlElementChildren(XmlElement element, PsiElementProcessor processor, boolean deepFlag)
public static boolean tagFromTemplateFramework(XmlTag tag)
public static boolean nsFromTemplateFramework(java.lang.String ns)
public static char getCharFromEntityRef(java.lang.String text)
public static boolean attributeFromTemplateFramework(java.lang.String name, XmlTag tag)
public static java.lang.String getTargetSchemaNsFromTag(XmlTag xmlTag)
public static <T extends PsiElement> void doDuplicationCheckForElements(T[] elements, java.util.Map<java.lang.String,T> presentNames, XmlUtil.DuplicationInfoProvider<? super T> provider, Validator.ValidationHost host)
public static boolean isAntFile(PsiFile file)
public static PsiFile findRelativeFile(java.lang.String uri, PsiElement base)
@Deprecated public static java.lang.String getCommentText(XmlComment comment)
XmlComment.getCommentText()
public static void reformatTagStart(XmlTag tag)
public static XmlElementDescriptor getDescriptorFromContext(XmlTag tag)
public static void expandTag(XmlTag tag)
public static java.lang.String getDefaultXhtmlNamespace(Project project)
public static java.lang.CharSequence getLocalName(java.lang.CharSequence tagName)
public static boolean isStubBuilding()
public static XmlTag addChildTag(XmlTag parent, XmlTag child, int index) throws IncorrectOperationException
IncorrectOperationException
public static java.lang.String[] [] getDefaultNamespaces(XmlDocument document)
public static java.lang.String getDtdUri(XmlDocument document)
public static java.lang.String getDtdUri(XmlDoctype doctype)
public static XmlElementDescriptor findXmlDescriptorByType(XmlTag xmlTag)
public static XmlElementDescriptor findXmlDescriptorByType(XmlTag xmlTag, XmlTag context)
public static boolean collectEnumerationValues(XmlTag element, java.util.HashSet<? super java.lang.String> variants)
public static boolean processEnumerationValues(XmlTag element, Processor<? super XmlTag> tagProcessor)
public static XmlTag createChildTag(XmlTag xmlTag, java.lang.String localName, java.lang.String namespace, java.lang.String bodyText, boolean enforceNamespacesDeep)
xmlTag
- localName
- namespace
- bodyText
- pass null to create collapsed tag, empty string means creating expanded oneenforceNamespacesDeep
- public static Pair<XmlTagChild,XmlTagChild> findTagChildrenInRange(PsiFile file, int startOffset, int endOffset)
public static boolean isSimpleValue(java.lang.String unquotedValue, PsiElement context)
public static boolean toCode(java.lang.String str)
public static boolean toCode(char ch)
public static PsiNamedElement findRealNamedElement(PsiNamedElement _element)
public static int getPrefixLength(java.lang.String s)
public static boolean isUrlText(java.lang.String s, Project project)
public static java.lang.String generateDocumentDTD(XmlDocument doc, boolean full)
public static java.lang.String generateElementDTD(java.lang.String name, java.util.List<java.lang.String> tags, java.util.List<? extends com.intellij.xml.util.XmlUtil.MyAttributeInfo> attributes)
public static java.lang.String findNamespaceByPrefix(java.lang.String prefix, XmlTag contextTag)
public static java.lang.String findPrefixByQualifiedName(java.lang.String name)
public static java.lang.String findLocalNameByQualifiedName(java.lang.String name)
public static XmlFile getContainingFile(PsiElement element)
public static java.lang.String unescape(java.lang.String text)
public static java.lang.String escape(java.lang.String text)
public static boolean isValidTagNameChar(char c)
public static java.lang.String extractXmlEncodingFromProlog(byte [] content)
public static java.lang.String extractXmlEncodingFromProlog(java.lang.CharSequence text)
public static void registerXmlAttributeValueReferenceProvider(PsiReferenceRegistrar registrar, java.lang.String [] attributeNames, ElementFilter elementFilter, PsiReferenceProvider provider)
public static void registerXmlAttributeValueReferenceProvider(PsiReferenceRegistrar registrar, java.lang.String [] attributeNames, ElementFilter elementFilter, boolean caseSensitive, PsiReferenceProvider provider)
public static void registerXmlAttributeValueReferenceProvider(PsiReferenceRegistrar registrar, java.lang.String [] attributeNames, ElementFilter elementFilter, boolean caseSensitive, PsiReferenceProvider provider, double priority)
public static void registerXmlTagReferenceProvider(PsiReferenceRegistrar registrar, java.lang.String[] names, ElementFilter elementFilter, boolean caseSensitive, PsiReferenceProvider provider)
public static boolean isTagDefinedByNamespace(XmlTag xmlTag)
public static XmlComment findPreviousComment(PsiElement element)