public abstract class AbsIRIImpl extends IRI implements ViolationCodes, IRIComponents
ViolationCodes.Initialize
ILLFORMED_PORT, NO_PORT
ACE_PREFIX, BAD_BIDI_SUBCOMPONENT, BAD_DOT_IN_IDN, BAD_IDN, BAD_IDN_UNASSIGNED_CHARS, BIDI_FORMATTING_CHARACTER, COMPATIBILITY_CHARACTER, CONTROL_CHARACTER, DEFAULT_PORT_SHOULD_BE_OMITTED, DEPRECATED_UNICODE_CHARACTER, DISCOURAGED_IRI_CHARACTER, DISCOURAGED_XML_CHARACTER, DNS_LABEL_DASH_START_OR_END, DNS_LABEL_LENGTH_LIMIT, DNS_LENGTH_LIMIT, DOUBLE_DASH_IN_REG_NAME, DOUBLE_WHITESPACE, EMPTY_SCHEME, HAS_PASSWORD, ILLEGAL_CHARACTER, ILLEGAL_PERCENT_ENCODING, IP_V4_OCTET_RANGE, IP_V6_OR_FUTURE_ADDRESS_SYNTAX, IPv6ADDRESS_SHOULD_BE_LOWERCASE, LONE_SURROGATE, LOWERCASE_PREFERRED, MAYBE_NOT_NFC, MAYBE_NOT_NFKC, NON_INITIAL_DOT_SEGMENT, NON_URI_CHARACTER, NON_XML_CHARACTER, NOT_DNS_NAME, NOT_NFC, NOT_NFKC, NOT_UTF8_ESCAPE, NOT_UTF8_ESCAPE_IN_HOST, NOT_XML_SCHEMA_WHITESPACE, PERCENT, PERCENT_20, PERCENT_ENCODING_SHOULD_BE_UPPERCASE, PORT_SHOULD_NOT_BE_EMPTY, PORT_SHOULD_NOT_BE_WELL_KNOWN, PORT_SHOULD_NOT_START_IN_ZERO, PRIVATE_USE_CHARACTER, PROHIBITED_COMPONENT_PRESENT, QUERY_IN_LEGACY_SCHEME, REQUIRED_COMPONENT_MISSING, SCHEME_INCLUDES_DASH, SCHEME_MUST_START_WITH_LETTER, SCHEME_PATTERN_MATCH_FAILED, SCHEME_PREFERS_LOWERCASE, SCHEME_REQUIRES_LOWERCASE, SUPERFLUOUS_ASCII_PERCENT_ENCODING, SUPERFLUOUS_NON_ASCII_PERCENT_ENCODING, UNASSIGNED_UNICODE_CHARACTER, UNDEFINED_UNICODE_CHARACTER, UNICODE_CONTROL_CHARACTER, UNICODE_WHITESPACE, UNREGISTERED_IANA_SCHEME, UNREGISTERED_NONIETF_SCHEME_TREE, UNWISE_CHARACTER, USE_PUNYCODE_NOT_PERCENTS, WHITESPACE
AUTHORITY, FRAGMENT, HOST, PATH, PATHQUERY, PORT, QUERY, SCHEME, USER
ABSOLUTE, CHILD, GRANDPARENT, NETWORK, PARENT, SAMEDOCUMENT
Constructor and Description |
---|
AbsIRIImpl() |
Modifier and Type | Method and Description |
---|---|
Iterator<Violation> |
allViolations() |
IRI |
create(IRI i)
Make a new IRI object (possibly
including IRI resolution),
and check it for violations
of the standards being enforced by the factory.
|
IRI |
create(String s)
Make a new IRI object (possibly
including IRI resolution),
and check it for violations
of the standards being enforced by the factory.
|
boolean |
equals(Object o) |
String |
getASCIIHost()
The host part of the authority, encoded
as an International Domain Name.
|
String |
getAuthority()
The authority component, found between
the first "//" and the next "/".
|
String |
getFragment()
The fragment, found after a "#" at the end
of the main URI (note a fragment may itself
contain a "#").
|
String |
getHost()
The host part of the authority.
|
String |
getPath()
The path component of the IRI; always
present, possibly the empty string.
|
int |
getPort()
The port number from the authority component.
|
String |
getQuery()
The query component of the IRI.
|
String |
getRawAuthority()
The authority component, found between
the first "//" and the next "/".
|
String |
getRawFragment()
The fragment, found after a "#" at the end
of the main URI (note a fragment may itself
contain a "#").
|
String |
getRawHost()
The host part of the authority.
|
String |
getRawPath()
The path component of the IRI; always
present, possibly the empty string.
|
String |
getRawQuery()
The query component of the IRI.
|
String |
getRawUserinfo()
The user information part of the authority
component of the IRI.
|
String |
getScheme()
The scheme component of the IRI.
|
String |
getUserinfo()
The user information part of the authority
component of the IRI.
|
int |
hashCode() |
boolean |
hasViolation(boolean includeWarnings)
Are there any violations of the factory's
specification settings.
|
boolean |
isAbsolute()
Does this IRI specify a scheme.
|
boolean |
isRelative()
Is this IRI a relative reference without
a scheme specified.
|
boolean |
isRootless()
Is this an 'opaque' IRI.
|
int |
ladderEquals(IRI iri)
To be defined: use the comparison ladder.
|
boolean |
ladderEquals(IRI iri,
int other)
To be defined: use the comparison ladder.
|
IRI |
normalize(boolean useDns)
To be defined -
return result does not violate any minting conditions.
|
IRI |
relativize(IRI abs)
Returns an IRI that when resolved against
this IRI would return
abs . |
IRI |
relativize(IRI abs,
int flags)
Returns an IRI that when resolved against
this IRI would return
abs . |
IRI |
relativize(String abs)
Returns an IRI that when resolved against
this IRI would return
abs . |
IRI |
relativize(String abs,
int flags)
Returns an IRI that when resolved against
this IRI would return
abs . |
String |
toASCIIString()
Converts the IRI into ASCII.
|
String |
toDisplayString()
The IRI string with any recommended bi-directional control
characters (if necessary) to ensure correct display.
|
URL |
toURL()
Converts the IRI to an ASCII string, and then to a URL.
|
Iterator<Violation> |
violations(boolean includeWarnings)
The error and warning conditions
associated with this IRI violating the
standards associated with its factory.
|
construct, construct
construct, construct
public boolean isAbsolute()
IRI
isAbsolute
in class IRI
public boolean isRelative()
IRI
isRelative
in class IRI
public boolean hasViolation(boolean includeWarnings)
IRI
violations(includeWarnings).hasNext()
,
but faster.hasViolation
in class IRI
includeWarnings
- If true then warnings are reported as well as errors.public Iterator<Violation> violations(boolean includeWarnings)
IRI
violations
in class IRI
includeWarnings
- If true then warnings are returned as well as errors.Violation
s found which violate the
factory's standards.public URL toURL() throws MalformedURLException
IRI
toURL
in class IRI
MalformedURLException
- If IDNA conversion failed, or from java.net.URLpublic String toASCIIString() throws MalformedURLException
IRI
toASCIIString
in class IRI
MalformedURLException
- An Internationalized Domain Name algorithm failed, there is no equivalent ascii string.public IRI relativize(String abs, int flags)
IRI
abs
.
If possible, a relative IRI is formed,
using any of the methods specified in flags,
which is a bitwise or of values from
IRIRelativize
.
If abs
contains a dot
segment (either "/./" or "/../") then
the contract cannot be satisfied and an incorrect
answer is returned. This incorrect return value has an
ViolationCodes.NON_INITIAL_DOT_SEGMENT
violation associated with it.
relativize
in class IRI
abs
- An absolute IRI to make relative.flags
- Which type of relative IRIs to permit.public IRI relativize(String abs)
IRI
abs
.
If possible, a relative IRI is formed,
using default methods.
If abs
contains a dot
segment (either "/./" or "/../") then
the contract cannot be satisfied and an incorrect
answer is returned. This incorrect return value has an
ViolationCodes.NON_INITIAL_DOT_SEGMENT
violation associated with it.
relativize
in class IRI
abs
- An absolute IRI to make relative.public IRI relativize(IRI abs)
IRI
abs
.
If possible, a relative IRI is formed,
using default methods.
If abs
contains a dot
segment (either "/./" or "/../") then
the contract cannot be satisfied and an incorrect
answer is returned. This incorrect return value has an
ViolationCodes.NON_INITIAL_DOT_SEGMENT
violation associated with it.
relativize
in class IRI
abs
- An absolute IRI to make relative.public IRI relativize(IRI abs, int flags)
IRI
abs
.
If possible, a relative IRI is formed,
using any of the methods specified in flags,
which is a bitwise or of values from
IRIRelativize
.
If abs
contains a dot
segment (either "/./" or "/../") then
the contract cannot be satisfied and an incorrect
answer is returned. This incorrect return value has an
ViolationCodes.NON_INITIAL_DOT_SEGMENT
violation associated with it.
relativize
in class IRI
abs
- An absolute IRI to make relative.flags
- Which type of relative IRIs to permit.public String getRawUserinfo()
IRI
ViolationCodes.HAS_PASSWORD
.
No decoding is done; this method is cheap.getRawUserinfo
in class IRI
public int getPort()
IRI
getPort
in class IRI
IRI.NO_PORT
or IRI.ILLFORMED_PORT
.public String getRawQuery()
IRI
getRawQuery
in class IRI
public String getRawFragment()
IRI
getRawFragment
in class IRI
public String getRawHost()
IRI
getRawHost
in class IRI
public String getScheme()
IRI
public String getRawPath()
IRI
getRawPath
in class IRI
public boolean isRootless()
IRI
isRootless
in class IRI
public String getRawAuthority()
IRI
getRawAuthority
in class IRI
public IRI create(IRI i)
IRIFactoryI
IRI.hasViolation(boolean)
and IRI.violations(boolean)
.create
in interface IRIFactoryI
create
in class AbsIRIFactoryImpl
i
- The IRI to use.public IRI create(String s)
IRIFactoryI
IRI.hasViolation(boolean)
and IRI.violations(boolean)
.create
in interface IRIFactoryI
create
in class AbsIRIFactoryImpl
s
- The IRI to use.public String getAuthority()
IRI
IRI.getRawAuthority()
.getAuthority
in class IRI
public String getFragment()
IRI
IRI.getRawFragment()
.getFragment
in class IRI
public String getHost()
IRI
IRI.getRawHost()
.public String getPath()
IRI
IRI.getRawPath()
.public String getQuery()
IRI
IRI.getRawQuery()
.public String getUserinfo()
IRI
ViolationCodes.HAS_PASSWORD
.
Any legal percent escape sequences are decoded.
This method may be more expensive than IRI.getRawUserinfo()
.getUserinfo
in class IRI
public IRI normalize(boolean useDns)
IRI
public String toDisplayString()
IRI
toDisplayString
in class IRI
public String getASCIIHost() throws MalformedURLException
IRI
IRI.getRawHost()
.getASCIIHost
in class IRI
MalformedURLException
- An Internationalized Domain Name algorithm failed, there is no equivalent ascii string.public boolean ladderEquals(IRI iri, int other)
IRI
ladderEquals
in class IRI
other
- Specifies where on the ladder to make the comparison.public int ladderEquals(IRI iri)
IRI
ladderEquals
in class IRI
IRI.ladderEquals(IRI, int)
true, or -1 if none.Copyright ? 2005, 2006, 2007, 2008, 2009 Hewlett-Packard Development Company, LP