|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.fudgemsg.taxon.URLTaxonomyResolver
org.fudgemsg.taxon.RESTfulTaxonomyResolver
public class RESTfulTaxonomyResolver
A taxonomy resolver implementation that obtains taxonomies over the network.
This creates URLs by substituting the taxonomy ID into a given string.
Constructor Summary | |
---|---|
RESTfulTaxonomyResolver()
Creates a new taxonomy resolver. |
|
RESTfulTaxonomyResolver(String specPrefix)
Creates a new taxonomy resolver. |
|
RESTfulTaxonomyResolver(String specPrefix,
String specSuffix)
Creates a new taxonomy resolver. |
|
RESTfulTaxonomyResolver(URL context,
String specPrefix,
String specSuffix)
Creates a new taxonomy resolver, using a string relative to an existing URL. |
Method Summary | |
---|---|
protected URL |
createTaxonomyURL(short taxonomyId)
Returns the URL that the taxonomy corresponding to the ID should be loaded from. |
URL |
getContext()
Returns the context URL. |
String |
getSpecPrefix()
Returns the string prefix to precede the taxonomy ID. |
String |
getSpecSuffix()
Returns the string suffix to follow the taxonomy ID. |
void |
setContext(String context)
Sets or clears the context URL. |
void |
setContext(URL contextURL)
Sets or clears the context URL. |
void |
setSpecPrefix(String specPrefix)
Sets or clears the string prefix to precede the taxonomy ID. |
void |
setSpecSuffix(String specSuffix)
Sets or clears the string suffix to follow the taxonomy ID. |
Methods inherited from class org.fudgemsg.taxon.URLTaxonomyResolver |
---|
reset, resolveTaxonomy |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public RESTfulTaxonomyResolver()
public RESTfulTaxonomyResolver(String specPrefix)
specPrefix
+ taxonomyId
.
specPrefix
- String fragment to precede the taxonomy IDpublic RESTfulTaxonomyResolver(String specPrefix, String specSuffix)
specPrefix
+ taxonomyId
+ specSuffix
.
For example, creating the resolver as RESTfulTaxonomyResolver("http://fudgemsg.org/taxonomies/", ".xml")
would resolve taxonomy ID 42 to the document at http://fudgemsg.org/taxonomies/42.xml
.
specPrefix
- String fragment to precede the taxonomy ID, or null
specSuffix
- String fragment to follow the taxonomy ID, or null
public RESTfulTaxonomyResolver(URL context, String specPrefix, String specSuffix)
URL.URL(URL,String)
for more details.
context
- the URL context if the substitution string is relative, or null
specPrefix
- the fragment to precede the taxonomy ID, null if nonespecSuffix
- the fragment to follow the taxonomy ID, null if noneMethod Detail |
---|
public URL getContext()
public void setContext(URL contextURL)
contextURL
- the new URL, may be nullpublic void setContext(String context)
context
- the new URL, may be nullpublic String getSpecPrefix()
public void setSpecPrefix(String specPrefix)
specPrefix
- the new prefix, null for nonepublic String getSpecSuffix()
public void setSpecSuffix(String specSuffix)
specSuffix
- the new suffix, null for noneprotected URL createTaxonomyURL(short taxonomyId) throws MalformedURLException
URLTaxonomyResolver
createTaxonomyURL
in class URLTaxonomyResolver
taxonomyId
- the taxonomy ID to locate
MalformedURLException
- if there is a problem creating the URL, this will be wrapped into a runtime exception
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |