本文整理汇总了Java中org.intellij.lang.xpath.context.XPathVersion.V2属性的典型用法代码示例。如果您正苦于以下问题:Java XPathVersion.V2属性的具体用法?Java XPathVersion.V2怎么用?Java XPathVersion.V2使用的例子?那么, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在类org.intellij.lang.xpath.context.XPathVersion
的用法示例。
在下文中一共展示了XPathVersion.V2属性的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: isWellFormed
public boolean isWellFormed() {
final String text = getUnescapedText();
final char quoteChar = getQuoteChar();
if (!text.endsWith(String.valueOf(quoteChar)) || text.indexOf(quoteChar) == text.lastIndexOf(quoteChar)) {
return false;
}
if (getXPathVersion() == XPathVersion.V2) {
final String value = getStringBetweenQuotes();
final String unescaped = unescape(quoteChar, value);
return escape(quoteChar, unescaped).equals(value);
} else {
if (getValue().indexOf(quoteChar) != -1) {
return false;
}
}
return !textContains('\n') && !textContains('\r');
}
示例2: createFunctionMap
@Override
protected Map<Pair<QName, Integer>, Function> createFunctionMap(ContextType type) {
final XPathVersion version = type.getVersion();
if (version == XPathVersion.V1) {
return DEFAULT_FUNCTIONS_V1;
} else if (version == XPathVersion.V2) {
return DEFAULT_FUNCTIONS_V2;
} else {
throw new IllegalStateException("Unsupprted version: " + version);
}
}
示例3: getValue
public String getValue() {
final String value = getStringBetweenQuotes();
if (getXPathVersion() == XPathVersion.V2) {
return unescape(getQuoteChar(), value);
}
return value;
}
示例4: mapType
public static XPathType mapType(XPathExpression context, XPathType type) {
return context.getXPathVersion() == XPathVersion.V2 ? XPath2Type.mapType(type) : type;
}
示例5: getXPathVersion
@Override
public XPathVersion getXPathVersion() {
return getLanguage() instanceof XPath2Language ? XPathVersion.V2 : XPathVersion.V1;
}