AnyURI that prefers RFC 3987 IRI.
 This has consistently formatted percent encodings.
Furthermore, this assumes UTF-8 encoding for the query parameters.
 If the query parameters include any arbitrary encoded data, use
 AnyURI or URI instead.
When a strict ASCII-only representation of a RFC 3986 URI
 is required, use URI.  When a Unicode representation of a RFC 3987 IRI
 is preferred, use IRI.  Otherwise, to support both, use AnyURI, which should also perform
 the best since it performs fewer conversions.
- Author:
- AO Industries, Inc.
- 
Field SummaryFieldsModifier and TypeFieldDescriptionstatic final CharsetThe default encoding isStandardCharsets.UTF_8
- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionaddEncodedParameter(String encodedName, String encodedValue) Adds an already-encoded parameter.addParameter(String name, String value) Encodes and adds a parameter.addParameters(URIParameters params) Adds all of the parameters.addQueryString(String query) Adds a query string.appendFragment(Encoder encoder, Appendable out) Appends the fragment (not including the '#').appendFragment(Appendable out) Appends the fragment (not including the '#').appendHierPart(Encoder encoder, Appendable out) Appends the part of the URI after the scheme and up to the first '?'appendHierPart(Appendable out) Appends the part of the URI after the scheme and up to the first '?'appendQueryString(Encoder encoder, Appendable out) Appends the query string (not including the '?').Appends the query string (not including the '?').appendScheme(Encoder encoder, Appendable out) Appends the scheme (not including the ':').appendScheme(Appendable out) Appends the scheme (not including the ':').booleanIs this URI percent-encoding normalized?setEncodedFragment(String encodedFragment) Replaces the fragment.setFragment(String fragment) Replaces the fragment in the default encodingENCODING.setHierPart(String hierPart) Replaces the hier-part.setQueryString(String query) Replaces the query string.Gets the full URI in RFC 3986 URI US-ASCII format.toIRI()Gets this URI encoded in RFC 3987 IRI Unicode format.toString()Gets the full IRI in RFC 3987 IRI Unicode format.toURI()Gets this URI encoded in RFC 3986 URI US-ASCII format.Methods inherited from class com.aoapps.net.AnyURIappendFragment, appendFragment, appendHierPart, appendHierPart, appendQueryString, appendQueryString, appendScheme, appendScheme, equals, getFragment, getFragmentIndex, getHierPart, getPathEnd, getQueryIndex, getQueryString, getScheme, getSchemeLength, hasFragment, hashCode, hasQuery, hasScheme, isScheme, pathEndsWith, pathEndsWithIgnoreCase, writeFragment, writeFragment, writeHierPart, writeHierPart, writeQueryString, writeQueryString, writeScheme, writeScheme
- 
Field Details- 
ENCODINGThe default encoding isStandardCharsets.UTF_8
 
- 
- 
Constructor Details- 
IRI
 
- 
- 
Method Details- 
toStringGets the full IRI in RFC 3987 IRI Unicode format.This will be percent-encoding normalized and contain consistently formatted percent encodings. 
- 
toASCIIStringGets the full URI in RFC 3986 URI US-ASCII format.This will be percent-encoding normalized and contain consistently formatted percent encodings. - Overrides:
- toASCIIStringin class- AnyURI
 
- 
appendSchemeDescription copied from class:AnyURIAppends the scheme (not including the ':').- Overrides:
- appendSchemein class- AnyURI
- Returns:
- this
- Throws:
- IOException
 
- 
appendSchemeDescription copied from class:AnyURIAppends the scheme (not including the ':').- Overrides:
- appendSchemein class- AnyURI
- Returns:
- this
- Throws:
- IOException
 
- 
appendHierPartDescription copied from class:AnyURIAppends the part of the URI after the scheme and up to the first '?' or '#' (exclusive), or the full URI when neither found.- Overrides:
- appendHierPartin class- AnyURI
- Returns:
- this
- Throws:
- IOException
 
- 
appendHierPartDescription copied from class:AnyURIAppends the part of the URI after the scheme and up to the first '?' or '#' (exclusive), or the full URI when neither found.- Overrides:
- appendHierPartin class- AnyURI
- Returns:
- this
- Throws:
- IOException
 
- 
appendQueryStringDescription copied from class:AnyURIAppends the query string (not including the '?').- Overrides:
- appendQueryStringin class- AnyURI
- Returns:
- this
- Throws:
- IOException
 
- 
appendQueryStringDescription copied from class:AnyURIAppends the query string (not including the '?').- Overrides:
- appendQueryStringin class- AnyURI
- Returns:
- this
- Throws:
- IOException
 
- 
appendFragmentDescription copied from class:AnyURIAppends the fragment (not including the '#').- Overrides:
- appendFragmentin class- AnyURI
- Returns:
- this
- Throws:
- IOException
 
- 
appendFragmentDescription copied from class:AnyURIAppends the fragment (not including the '#').- Overrides:
- appendFragmentin class- AnyURI
- Returns:
- this
- Throws:
- IOException
 
- 
isEncodingNormalizedpublic boolean isEncodingNormalized()Is this URI percent-encoding normalized? Normalized percent encoding means it will have only the required percent encodings, and the encodings are capitalized hexadecimal.Note: This only refers to the percent encodings. This is not related to full URI normalization. - Overrides:
- isEncodingNormalizedin class- AnyURI
- Returns:
- true-- IRIare always encoding normalized.
 
- 
toURIGets this URI encoded in RFC 3986 URI US-ASCII format.This will be percent-encoding normalized and contain consistently formatted percent encodings. 
- 
toIRIGets this URI encoded in RFC 3987 IRI Unicode format.
- 
setHierPartDescription copied from class:AnyURIReplaces the hier-part.- Overrides:
- setHierPartin class- AnyURI
- Parameters:
- hierPart- The hier-part may not contain the query marker '?' or fragment marker '#'
- Returns:
- The new AnyURIorthiswhen unmodified.
 
- 
setQueryStringDescription copied from class:AnyURIReplaces the query string.- Overrides:
- setQueryStringin class- AnyURI
- Parameters:
- query- The query (not including the first '?') - it is added without additional encoding. The query is removed when the query is- null. The query may not contain the fragment marker '#'
- Returns:
- The new AnyURIorthiswhen unmodified.
 
- 
addQueryStringDescription copied from class:AnyURIAdds a query string.- Overrides:
- addQueryStringin class- AnyURI
- Parameters:
- query- The query (not including the first '?' / '&') - it is added without additional encoding. Nothing is added when the query is- null. The query may not contain the fragment marker '#'
- Returns:
- The new AnyURIorthiswhen unmodified.
 
- 
addEncodedParameterDescription copied from class:AnyURIAdds an already-encoded parameter.- Overrides:
- addEncodedParameterin class- AnyURI
- Parameters:
- encodedName- The parameter name - it is added without additional encoding. Nothing is added when the name is- null. The name may not contain the fragment marker '#'
- encodedValue- The parameter value - it is added without additional encoding. When- null, the parameter is added without any '='. Must be- nullwhen- nameis- null. The value may not contain the fragment marker '#'
- Returns:
- The new AnyURIorthiswhen unmodified.
 
- 
addParameterDescription copied from class:AnyURIEncodes and adds a parameter.- Overrides:
- addParameterin class- AnyURI
- Parameters:
- name- The parameter name. Nothing is added when the name is- null.
- value- The parameter value. When- null, the parameter is added without any '='. Must be- nullwhen- nameis- null.
- Returns:
- The new AnyURIorthiswhen unmodified.
- See Also:
 
- 
addParametersDescription copied from class:AnyURIAdds all of the parameters.- Overrides:
- addParametersin class- AnyURI
- Parameters:
- params- The parameters to add. Nothing is added when- nullor empty.
- Returns:
- The new AnyURIorthiswhen unmodified.
- See Also:
 
- 
setEncodedFragmentDescription copied from class:AnyURIReplaces the fragment.- Overrides:
- setEncodedFragmentin class- AnyURI
- Parameters:
- encodedFragment- The fragment (not including the '#') - it is added without additional encoding. Removes fragment when- null.
- Returns:
- The new AnyURIorthiswhen unmodified.
 
- 
setFragmentDescription copied from class:AnyURIReplaces the fragment in the default encodingENCODING.TODO: Implement specification of fragment-escape. - Overrides:
- setFragmentin class- AnyURI
- Parameters:
- fragment- The fragment (not including the '#') or- nullfor no fragment.
- Returns:
- The new AnyURIorthiswhen unmodified.
 
 
- 

