/** * Get the item type of the function item * * @return the function item's type */ public FunctionItemType getFunctionItemType() { return new SpecificFunctionType( new SequenceType[]{SequenceType.ANY_SEQUENCE}, SequenceType.SINGLE_BOOLEAN); }
/** * Get the item type of the function item * * @return the function item's type */ public FunctionItemType getFunctionItemType() { // The function accepts any sequence as input, so it can do its own atomization return new SpecificFunctionType( new SequenceType[]{SequenceType.ANY_SEQUENCE}, SequenceType.SINGLE_BOOLEAN); }
/** * Get the item type of the function item * * @return the function item's type */ public FunctionItemType getFunctionItemType() { // The function accepts any sequence as input, so it can do its own atomization return new SpecificFunctionType( new SequenceType[]{SequenceType.ANY_SEQUENCE}, SequenceType.SINGLE_BOOLEAN); }
/** * Get the item type of the function item * * @return the function item's type */ public FunctionItemType getFunctionItemType() { return new SpecificFunctionType( new SequenceType[]{SequenceType.ANY_SEQUENCE}, SequenceType.SINGLE_BOOLEAN); }
/** * Get the item type of the function item * * @return the function item's type */ public FunctionItemType getFunctionItemType() { SequenceType resultType = targetType.getResultTypeOfCast(); SequenceType argType = allowEmpty ? SequenceType.OPTIONAL_ATOMIC : SequenceType.SINGLE_ATOMIC; return new SpecificFunctionType( new SequenceType[]{argType}, resultType); }
/** * Get the type of the function * * @return the function type */ public FunctionItemType getFunctionItemType() { SequenceType[] argTypes = new SequenceType[parameterDefinitions.length]; for (int i = 0; i < parameterDefinitions.length; i++) { UserFunctionParameter ufp = parameterDefinitions[i]; argTypes[i] = ufp.getRequiredType(); } return new SpecificFunctionType(argTypes, resultType, annotations); }
/** * Get the item type of the function item * * @return the function item's type */ @Override public FunctionItemType getFunctionItemType() { SequenceType[] argTypes = new SequenceType[getArity()]; Arrays.fill(argTypes, SequenceType.OPTIONAL_ATOMIC); return new SpecificFunctionType(argTypes, SequenceType.SINGLE_STRING); }
/** * Get the item type of the function item * * @return the function item's type */ public FunctionItemType getFunctionItemType() { SequenceType resultType = targetType.getResultTypeOfCast(); SequenceType argType = allowEmpty ? SequenceType.OPTIONAL_ATOMIC : SequenceType.SINGLE_ATOMIC; return new SpecificFunctionType( new SequenceType[]{argType}, resultType); }
/** * Get the item type of the function item * * @return the function item's type */ @Override public FunctionItemType getFunctionItemType() { SequenceType[] argTypes = new SequenceType[getArity()]; Arrays.fill(argTypes, SequenceType.OPTIONAL_ATOMIC); return new SpecificFunctionType(argTypes, SequenceType.SINGLE_STRING); }
/** * Get the type of the function * * @return the function type */ public FunctionItemType getFunctionItemType() { SequenceType[] argTypes = new SequenceType[parameterDefinitions.length]; for (int i = 0; i < parameterDefinitions.length; i++) { UserFunctionParameter ufp = parameterDefinitions[i]; argTypes[i] = ufp.getRequiredType(); } return new SpecificFunctionType(argTypes, resultType, annotations); }
/** * Get the item type of the function item * * @return the function item's type */ public FunctionItemType getFunctionItemType() { SequenceType resultType = SequenceType.makeSequenceType(getResultItemType(), details.cardinality); return new SpecificFunctionType(details.argumentTypes, resultType); }
/** * Get the item type of the function item * * @return the function item's type */ public FunctionItemType getFunctionItemType() { SequenceType resultType = SequenceType.makeSequenceType(getResultItemType(), details.cardinality); return new SpecificFunctionType(details.argumentTypes, resultType); }
/** * Get the item type of the function item * * @return the function item's type */ public FunctionItemType getFunctionItemType() { AtomicType resultType = BuiltInAtomicType.ANY_ATOMIC; if (memberType.isAtomicType()) { resultType = (AtomicType) memberType; } SequenceType argType = allowEmpty ? SequenceType.OPTIONAL_ATOMIC : SequenceType.SINGLE_ATOMIC; return new SpecificFunctionType( new SequenceType[]{argType}, SequenceType.makeSequenceType(resultType, StaticProperty.ALLOWS_ZERO_OR_MORE)); }
/** * Get the item type of the function item * * @return the function item's type */ public FunctionItemType getFunctionItemType() { AtomicType resultType = BuiltInAtomicType.ANY_ATOMIC; if (memberType.isAtomicType()) { resultType = (AtomicType) memberType; } SequenceType argType = allowEmpty ? SequenceType.OPTIONAL_ATOMIC : SequenceType.SINGLE_ATOMIC; return new SpecificFunctionType( new SequenceType[]{argType}, SequenceType.makeSequenceType(resultType, StaticProperty.ALLOWS_ZERO_OR_MORE)); }
@Override public Expression makeFunctionSequenceCoercer(Expression exp, RoleDiagnostic role) throws XPathException { return new SpecificFunctionType(getArgumentTypes(), getResultType()).makeFunctionSequenceCoercer(exp, role); }
@Override public Expression makeFunctionSequenceCoercer(Expression exp, RoleDiagnostic role) throws XPathException { return new SpecificFunctionType(getArgumentTypes(), getResultType()).makeFunctionSequenceCoercer(exp, role); }
/** * Get the item type of the function item * * @return the function item's type */ @Override public FunctionItemType getFunctionItemType() { return new SpecificFunctionType(getArgumentTypes(), getResultType(getArgumentTypes())); }
/** * Get the item type of the function item * * @return the function item's type */ @Override public FunctionItemType getFunctionItemType() { return new SpecificFunctionType(getArgumentTypes(), getResultType(getArgumentTypes())); }
public Item getItem(XPathContext context) { // Create a map for the result DictionaryMap map = new DictionaryMap(); // Add the custom properties of the resource for (Map.Entry<String, GroundedValue<?>> entry : properties.entrySet()) { map.initialPut(entry.getKey(), entry.getValue()); } // Add the resourceURI of the resource as the "name" property map.initialPut("name", StringValue.makeStringValue(resourceURI)); // Add a fetch() function, which can be used to fetch the resource Callable fetcher = (context1, arguments) -> content.getItem(context1); FunctionItemType fetcherType = new SpecificFunctionType(new SequenceType[0], SequenceType.SINGLE_ITEM); CallableFunction fetcherFunction = new CallableFunction(0, fetcher, fetcherType); map.initialPut("fetch", fetcherFunction); return map; } }
public Item getItem(XPathContext context) { // Create a map for the result HashTrieMap map = new HashTrieMap(); // Add the custom properties of the resource for (Map.Entry<String, GroundedValue<?>> entry : properties.entrySet()) { map = map.addEntry(StringValue.makeStringValue(entry.getKey()), entry.getValue()); } // Add the resourceURI of the resource as the "name" property map = map.addEntry(StringValue.makeStringValue("name"), StringValue.makeStringValue(resourceURI)); // Add a fetch() function, which can be used to fetch the resource Callable fetcher = (context1, arguments) -> content.getItem(context1); FunctionItemType fetcherType = new SpecificFunctionType(new SequenceType[0], SequenceType.SINGLE_ITEM); CallableFunction fetcherFunction = new CallableFunction(0, fetcher, fetcherType); map = map.addEntry(StringValue.makeStringValue("fetch"), fetcherFunction); return map; } }