public class DescriptionDocument extends Object
Document object is checked for validity as an OpenSearch description
document. If the document is found valid, various operations such as the retrieval of QueryBuilder objects
,which can be used in order to submit queries, and the querying of a number of description document related properties
are exposed to the client.| Constructor and Description |
|---|
DescriptionDocument(Document descriptionDocument,
URLElementFactory urlFactory,
QueryElementFactory queryFactory)
Creates a new
DescriptionDocument instance |
| Modifier and Type | Method and Description |
|---|---|
boolean |
canRequest()
Determines whether the client may request search results from the OpenSearch provider corresponding to this description document
|
boolean |
canSendToClients()
Determines whether the client may send the search results obtained from the OpenSearch provider corresponding to this description document to other search clients
|
boolean |
canSendToEndUsers()
Determines whether the client may display the search results obtained from the OpenSearch provider corresponding to this description document to end users
|
String |
getAttribution()
Returns the String contained in the Attribution element of the description document
|
String |
getContact()
Returns the String contained in the Contact element of the description document
|
String |
getDefaultInputEncoding()
Returns the default input encoding of the OpenSearch specification
|
String |
getDefaultOutputEncoding()
Returns the default output encoding of the OpenSearch specification
|
String |
getDescription()
Returns the String contained in the Description element of the description document
|
String |
getDeveloper()
Returns the String contained in the Developer element of the description document
|
List<QueryBuilder> |
getExampleQueryBuilders(String MIMEType)
Retrieves a list of all
QueryBuilder objects that can be used to send example queries as described in the Query elements of this description document. |
URI |
getImageURI()
Retrieves the URI of the image that appears in the first Image element of this description document
|
URI |
getImageURI(String MIMEType)
Retrieves the URI of the image with a specific MIME type appearing first in an Image element of this description document
|
String |
getLongName()
Returns the String contained in the LongName element of the description document
|
String |
getNSPrefix(String NSUrl)
Retrieves the namespace prefix associated with a namespace URI in the description document
|
Map<String,String> |
getNSPrefixToURIMappings() |
String |
getNSUrl(String NSPrefix)
Retrieves the namespace URI associated with a namespace prefix in the description document
|
List<QueryBuilder> |
getQueryBuilders(String rel,
String MIMEType)
Retrieves a list of
QueryBuilder objects that can be used to construct queries for resources related to a specific role and which return results of
a given MIME type |
String |
getShortName()
Returns the String contained in the ShortName element of the description document
|
List<String> |
getSupportedInputEncodings()
Retrieves a list of all input encodings supported by e OpenSearch provider corresponding to this description document
|
List<String> |
getSupportedLanguages()
Retrieves a list of all languages supported by the OpenSearch provider corresponding to this description document
|
List<String> |
getSupportedMimeTypes(String rel)
Retrieves a list of MIME types supported for constructing queries for a specific role
Standard OpenSearch Url rel values are: "results", "suggestion", "self" and "collection"
|
List<String> |
getSupportedOutputEncodings()
Retrieves a list of all output encodings supported by e OpenSearch provider corresponding to this description document
|
SyndicationRight |
getSyndicationRight()
Returns the
SyndicationRight value contained in the SyndicationRight element of the description document |
List<String> |
getTags()
Retrieves a list of all the tags contained in the description document which identify and categorize the search content
|
Map<String,List<String>> |
getUniqueTemplates()
Returns all parameter-wise unique templates contained in this description document
|
Map<String,String> |
getURIToPrefixMappings() |
Boolean |
hasAdultContent()
Determines whether the search results obtained from the OpenSearch provider corresponding to this description document may contain material intended only for adults
|
boolean |
hasLangRestriction()
Determines whether the description document limits the search to a set of supported languages
|
boolean |
isInputEncodingSupported(String encoding)
Determines whether a specific input encoding is supported by the OpenSearch provider corresponding to this description document
|
boolean |
isLanguageSupported(String lang)
Determines whether a specific language is supported by the OpenSearch provider corresponding to this description document
|
boolean |
isOutputEncodingSupported(String encoding)
Determines whether a specific output encoding is supported by the OpenSearch provider corresponding to this description document
|
public DescriptionDocument(Document descriptionDocument, URLElementFactory urlFactory, QueryElementFactory queryFactory) throws Exception
DescriptionDocument instancedescriptionDocument - A Document corresponding to the XML document that is to be processed as a description documenturlFactory - The factory that will be used to construct URLElements in order to process URL elements contained in the description documentqueryFactory - The factory that will be used to construct QueryElements in order to process Query elements contained in the description documentException - In case of an error, description document validity related or otherwise.public String getNSPrefix(String NSUrl)
NSUrl - The namespace URIpublic String getNSUrl(String NSPrefix)
NSPrefix - The prefix of the namespacepublic String getShortName()
public String getLongName()
public String getDescription()
public String getContact()
public String getDeveloper()
public String getAttribution()
public SyndicationRight getSyndicationRight()
SyndicationRight value contained in the SyndicationRight element of the description documentSyndicationRight of the description document or null if such an element is absentpublic boolean canRequest()
public boolean canSendToEndUsers()
public boolean canSendToClients()
public Boolean hasAdultContent()
public List<String> getTags()
public boolean hasLangRestriction()
public boolean isLanguageSupported(String lang)
lang - The language to check support forpublic List<String> getSupportedLanguages()
public boolean isInputEncodingSupported(String encoding)
encoding - The input encoding to check support forpublic String getDefaultInputEncoding()
public List<String> getSupportedInputEncodings()
public boolean isOutputEncodingSupported(String encoding)
encoding - The output encoding to check support forpublic String getDefaultOutputEncoding()
public List<String> getSupportedOutputEncodings()
public URI getImageURI()
public URI getImageURI(String MIMEType)
MIMEType - The MIME type of the image to be retrievedpublic List<String> getSupportedMimeTypes(String rel) throws Exception
rel - The role of the resource to be queriedException - If an error has occurredpublic Map<String,List<String>> getUniqueTemplates() throws Exception
Exception - If the URL elements of the description document are not initialized, or in case of other errorspublic List<QueryBuilder> getQueryBuilders(String rel, String MIMEType) throws Exception
QueryBuilder objects that can be used to construct queries for resources related to a specific role and which return results of
a given MIME typerel - The role of the resource to be queried, e.g. "results"MIMEType - The MIME type of the results that the provider should returnQueryBuilders that satisfy the criteria passed as arguments. If none are found, an empty list is returned.Exception - If the URL elements contained in the desription document are not initialized or in case of other errorspublic List<QueryBuilder> getExampleQueryBuilders(String MIMEType) throws Exception
QueryBuilder objects that can be used to send example queries as described in the Query elements of this description document.
The result type of the queries constructed by these QueryBuilders will match the MIME type given as argument.MIMEType - The MIME type which the results obtained from queries issued using the QueryBuilders returned should haveQueryBuilder objects that can be used to issue the requested example queriesException - If the URL elements contained in the desription document are not initialized or in case of other errorsCopyright © 2014. All Rights Reserved.