本文整理匯總了Java中org.intellij.lang.xpath.context.XPathVersion.V1屬性的典型用法代碼示例。如果您正苦於以下問題:Java XPathVersion.V1屬性的具體用法?Java XPathVersion.V1怎麽用?Java XPathVersion.V1使用的例子?那麽, 這裏精選的屬性代碼示例或許可以為您提供幫助。您也可以進一步了解該屬性所在類org.intellij.lang.xpath.context.XPathVersion
的用法示例。
在下文中一共展示了XPathVersion.V1屬性的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: 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);
}
}
示例2: getType
@NotNull
public XPathType getType() {
if (getXPathVersion() == XPathVersion.V1) {
return XPathType.NUMBER;
} else {
if (isScientificNotation()) {
return XPath2Type.DOUBLE;
} else if (textContains('.')) {
return XPath2Type.DECIMAL;
}
return XPath2Type.INTEGER;
}
}
示例3: getType
@NotNull
public XPathType getType() {
final XPathStep step = getFirstStep();
if (step != null) {
final XPathExpression expr = step.getStep();
if (expr != null) {
return expr.getType();
}
}
return getXPathVersion() == XPathVersion.V1 ?
XPathType.NODESET : XPath2Type.SEQUENCE;
}
示例4: isXPath1
private static boolean isXPath1(XPathExpression expression) {
return expression.getXPathVersion() == XPathVersion.V1;
}
示例5: getXPathVersion
@Override
public XPathVersion getXPathVersion() {
return getLanguage() instanceof XPath2Language ? XPathVersion.V2 : XPathVersion.V1;
}
示例6: getNodeTypeCompletions
public static Collection<Lookup> getNodeTypeCompletions(XPathElement context) {
final Set<String> funcs = context.getXPathVersion() == XPathVersion.V1 ?
NODE_TYPE_FUNCS : NODE_TYPE_FUNCS_V2;
return ContainerUtil.map(funcs, FUNCTION_MAPPING);
}