public class BasicURLTemplate extends Object implements URLTemplate
| Modifier and Type | Class and Description |
|---|---|
protected static class |
BasicURLTemplate.Parameter
Class representing a query parameter, containing the qualified name of the parameter
and information about whether the parameter is required or not
|
| Modifier and Type | Field and Description |
|---|---|
protected List<BasicURLTemplate.Parameter> |
parameters |
protected String |
template |
| Constructor and Description |
|---|
BasicURLTemplate(String template,
Map<String,String> nsPrefixes)
Creates a new BasicURLTemplate object
|
| Modifier and Type | Method and Description |
|---|---|
List<String> |
getOptionalParameters()
Returns a list containing the qualified names of all optional parameters contained in the template
|
List<String> |
getRequiredParameters()
Returns a list containing the qualified names of all required parameters contained in the template
|
String |
getTemplate()
Returns the query template
|
boolean |
hasParameter(String name)
Determines if the template contains a parameter with a given qualified name
|
boolean |
isParameterRequired(String name)
Determines if a parameter with a given qualified name is a required parameter
|
protected String template
protected List<BasicURLTemplate.Parameter> parameters
public BasicURLTemplate(String template, Map<String,String> nsPrefixes) throws Exception
template - The query template that will be usednsPrefixes - The mapping from namespace URIs to namespace prefixes for all namespaces contained in a description documentException - If a parameter namespace URI is not present in the description document or in case of other errorpublic List<String> getRequiredParameters()
getRequiredParameters in interface URLTemplateURLTemplate.getRequiredParameters()public List<String> getOptionalParameters()
getOptionalParameters in interface URLTemplateURLTemplate.getOptionalParameters()public boolean isParameterRequired(String name) throws NonExistentParameterException
isParameterRequired in interface URLTemplatename - The qualified name of the parameterNonExistentParameterException - If the parameter is not found among the parameters contained in the templateURLTemplate.isParameterRequired(String)public boolean hasParameter(String name)
hasParameter in interface URLTemplatename - The qualified name of the parameterURLTemplate.hasParameter(String)public String getTemplate()
getTemplate in interface URLTemplateURLTemplate.getTemplate()Copyright © 2014. All Rights Reserved.