public class OptionsParameter
extends java.lang.Object
Constructor and Description |
---|
OptionsParameter() |
Modifier and Type | Method and Description |
---|---|
void |
addAllowedOption(java.lang.String name,
SequenceType type)
Register a permitted option keyword, and the associated type of value, without defining
a default value
|
void |
addAllowedOption(java.lang.String name,
SequenceType type,
Sequence defaultValue)
Register a permitted option keyword, and the associated type of value, with a default value
|
void |
addRequiredOption(java.lang.String name,
SequenceType type)
Register a required option keyword, and the associated type of value, where omitting
the value is an error
|
java.util.Map<java.lang.String,Sequence> |
getDefaultOptions()
Get a Java map containing the default values of registered options
|
java.lang.String |
getErrorCodeForAbsentValue() |
boolean |
isAllowCastFromString() |
java.util.Map<java.lang.String,Sequence> |
processSuppliedOptions(MapItem supplied,
XPathContext context)
Process an XPath map containing the supplied values.
|
void |
setAllowCastFromString(boolean allowCastFromString) |
void |
setAllowedValues(java.lang.String name,
java.lang.String errorCode,
java.lang.String... values)
Enumerate the permitted values for an option keyword
|
void |
setErrorCodeForAbsentValue(java.lang.String errorCodeForAbsentValue) |
public void addAllowedOption(java.lang.String name, SequenceType type)
name
- the option keywordtype
- the required typepublic void addRequiredOption(java.lang.String name, SequenceType type)
name
- the option keywordtype
- the required typepublic void addAllowedOption(java.lang.String name, SequenceType type, Sequence defaultValue)
name
- the option keywordtype
- the required typedefaultValue
- the default value if the option is not specified; or null
if no default is definedpublic void setAllowedValues(java.lang.String name, java.lang.String errorCode, java.lang.String... values)
name
- the option keyworderrorCode
- the error to be reported if the supplied value is not one of those permittedvalues
- the permitted valuespublic java.util.Map<java.lang.String,Sequence> processSuppliedOptions(MapItem supplied, XPathContext context) throws XPathException
supplied
- the supplied options as an XPath map objectcontext
- the dynamic evaluation contextXPathException
- if any supplied options are invalidpublic java.util.Map<java.lang.String,Sequence> getDefaultOptions()
public java.lang.String getErrorCodeForAbsentValue()
public void setErrorCodeForAbsentValue(java.lang.String errorCodeForAbsentValue)
public boolean isAllowCastFromString()
public void setAllowCastFromString(boolean allowCastFromString)
Copyright (c) 2004-2018 Saxonica Limited. All rights reserved.