Lines Matching defs:is

5  * This code is free software; you can redistribute it and/or modify it
11 * This code is distributed in the hope that it will be useful, but WITHOUT
14 * version 2 for more details (a copy is included in the LICENSE file that
56 * also supports scope_ids. The syntax and usage of scope_ids is described
76 * <p> An <i>absolute</i> URI specifies a scheme; a URI that is not absolute is
80 * <p> An <i>opaque</i> URI is an absolute URI whose scheme-specific part does
90 * <p> A <i>hierarchical</i> URI is either an absolute URI whose
92 * is, a URI that does not specify a scheme. Some examples of hierarchical
102 * <p> A hierarchical URI is subject to further parsing according to the syntax
113 * <p> The authority component of a hierarchical URI is, if specified, either
123 * authority component that does not parse in this way is considered to be
126 * <p> The path component of a hierarchical URI is itself said to be absolute
127 * if it begins with a slash character (<tt>'/'</tt>); otherwise it is
128 * relative. The path of a hierarchical URI that is either absolute or
129 * specifies an authority is always absolute.
146 * In a given instance any particular component is either <i>undefined</i> or
150 * empty string as its value; this is not equivalent to that component being
153 * <p> Whether a particular component is or is not defined in an instance
159 * authority component is present and is server-based then the host component
168 * <p> <i>Normalization</i> is the process of removing unnecessary <tt>"."</tt>
170 * Each <tt>"."</tt> segment is simply removed. A <tt>".."</tt> segment is
171 * removed only if it is preceded by a non-<tt>".."</tt> segment.
174 * <p> <i>Resolution</i> is the process of resolving one URI against another,
175 * <i>base</i> URI. The resulting URI is constructed from components of both
178 * the path of the original is resolved against the path of the base and then
185 * against the base URI <tt>http://java.sun.com/j2se/1.3/</tt> is the result
205 * relative paths in the case of hierarchical URIs, is supported. Resolving
207 * original URI, since it is absolute. Resolving the relative URI (2) above
215 * <p> <i>Relativization</i>, finally, is the inverse of resolution: For any
223 * This operation is often useful when constructing a document containing URIs
266 * <td>Escaped octets, that is, triplets consisting of the percent
276 * method)&nbsp;&nbsp;<i>(<b>Deviation from RFC 2396</b>, which is
292 * <li><p> To <i>encode</i> non-US-ASCII characters when a URI is required to
307 * <li><p><a name="encode"></a> A character is <i>encoded</i> by replacing it
310 * for example, is encoded as <tt>"%E2%82%AC"</tt>. <i>(<b>Deviation from
314 * <li><p><a name="quote"></a> An illegal character is <i>quoted</i> simply by
315 * encoding it. The space character, for example, is quoted by replacing it
321 * A sequence of escaped octets is <i>decoded</i> by
346 * (<tt>'%'</tt>) is always quoted by these constructors. Any <i>other</i>
379 * For any URI <i>u</i>, it is always the case that
408 * if <i>u</i> is hierarchical, and
418 * if <i>u</i> is hierarchical and has either no authority or a server-based
424 * A URI is a uniform resource <i>identifier</i> while a URL is a uniform
425 * resource <i>locator</i>. Hence every URL is a URI, abstractly speaking, but
426 * not every URI is a URL. This is because there is another subcategory of
431 * <p> The conceptual distinction between URIs and URLs is reflected in the
436 * A URI string is parsed according to the generic syntax without regard to the
437 * scheme, if any, that it specifies. No lookup of the host, if any, is
438 * performed, and no scheme-dependent stream handler is constructed. Equality,
440 * content of the instance. In other words, a URI instance is little more than
446 * to access the resource that it describes. A URL must be absolute, that is,
447 * it must always specify a scheme. A URL string is parsed according to its
448 * scheme. A stream handler is always established for a URL, and in fact it is
449 * impossible to create a URL instance for a scheme for which no handler is
451 * Internet address of the host, if any; comparison is not defined. In other
452 * words, a URL is a structured string that supports the syntactic operation of
535 * <li><p> An empty authority component is permitted as long as it is
540 * authority component is empty then the user-information, host, and port
545 * primary consequence of this deviation is that a standalone fragment
554 * decimal digits. Each element is further constrained to have a value
562 * consequence of this deviation is that the authority component of a
577 * RFC&nbsp;2396 permits <i>escaped</i> octets, that is, in the
579 * the authority component if the authority is registry-based. This
588 * If <tt>str</tt> is <tt>null</tt>
601 * <p> If a scheme is given then the path, if also given, must either be
614 * <li><p> Initially, the result string is empty. </p></li>
616 * <li><p> If a scheme is given then it is appended to the result,
620 * string <tt>"//"</tt> is appended. </p></li>
622 * <li><p> If user information is given then it is appended, followed by
625 * categories is <a href="#quote">quoted</a>. </p></li>
627 * <li><p> If a host is given then it is appended. If the host is a
628 * literal IPv6 address but is not enclosed in square brackets
632 * <li><p> If a port number is given then a colon character
633 * (<tt>':'</tt>) is appended, followed by the port number in decimal.
636 * <li><p> If a path is given then it is appended. Any character not in
639 * commercial-at character (<tt>'@'</tt>), is quoted. </p></li>
641 * <li><p> If a query is given then a question-mark character
642 * (<tt>'?'</tt>) is appended, followed by the query. Any character that
643 * is not a <a href="#legal-chars">legal URI character</a> is quoted.
646 * <li><p> Finally, if a fragment is given then a hash character
647 * (<tt>'#'</tt>) is appended, followed by the fragment. Any character
648 * that is not a legal URI character is quoted. </p></li>
652 * <p> The resulting URI string is then parsed as if by invoking the {@link
666 * If both a scheme and a path are given but the path is relative,
668 * RFC&nbsp;2396, or if the authority component of the string is
686 * <p> If a scheme is given then the path, if also given, must either be
698 * <li><p> Initially, the result string is empty. </p></li>
700 * <li><p> If a scheme is given then it is appended to the result,
703 * <li><p> If an authority is given then the string <tt>"//"</tt> is
709 * (<tt>'@'</tt>), is <a href="#quote">quoted</a>. </p></li>
711 * <li><p> If a path is given then it is appended. Any character not in
714 * commercial-at character (<tt>'@'</tt>), is quoted. </p></li>
716 * <li><p> If a query is given then a question-mark character
717 * (<tt>'?'</tt>) is appended, followed by the query. Any character that
718 * is not a <a href="#legal-chars">legal URI character</a> is quoted.
721 * <li><p> Finally, if a fragment is given then a hash character
722 * (<tt>'#'</tt>) is appended, followed by the fragment. Any character
723 * that is not a legal URI character is quoted. </p></li>
727 * <p> The resulting URI string is then parsed as if by invoking the {@link
739 * If both a scheme and a path are given but the path is relative,
741 * RFC&nbsp;2396, or if the authority component of the string is
794 * <li><p> Initially, the result string is empty. </p></li>
796 * <li><p> If a scheme is given then it is appended to the result,
799 * <li><p> If a scheme-specific part is given then it is appended. Any
800 * character that is not a <a href="#legal-chars">legal URI character</a>
801 * is <a href="#quote">quoted</a>. </p></li>
803 * <li><p> Finally, if a fragment is given then a hash character
804 * (<tt>'#'</tt>) is appended to the string, followed by the fragment.
805 * Any character that is not a legal URI character is quoted. </p></li>
809 * <p> The resulting URI string is then parsed in order to create the new
835 * constructor is caught and wrapped in a new {@link
836 * IllegalArgumentException} object, which is then thrown.
838 * <p> This method is provided for use in situations where it is known that
839 * the given string is a legal URI, for example for URI constants declared
843 * URI is being constructed from user input or from some other source that
850 * If <tt>str</tt> is <tt>null</tt>
880 * <p> This method is provided because the generic URI syntax specified in
885 * component in the URI string <tt>"//foo:bar"</tt>, for example, is not a
886 * legal server-based authority but it is legal as a registry-based
903 * that is thrown. </p>
909 * If the authority component of this URI is defined
929 * <p> If this URI is opaque, or if its path is already in normal form,
930 * then this URI is returned. Otherwise a new URI is constructed that is
931 * identical to this URI except that its path is computed by normalizing
934 * section&nbsp;5.2, step&nbsp;6, sub-steps&nbsp;c through&nbsp;f; that is:
941 * <li><p> If a <tt>".."</tt> segment is preceded by a non-<tt>".."</tt>
942 * segment then both of these segments are removed. This step is
943 * repeated until it is no longer applicable. </p></li>
945 * <li><p> If the path is relative, and if its first segment contains a
946 * colon character (<tt>':'</tt>), then a <tt>"."</tt> segment is
961 * but whose path is in normal form
970 * <p> If the given URI is already absolute, or if this URI is opaque, then
971 * the given URI is returned.
973 * <p><a name="resolve-frag"></a> If the given URI's fragment component is
974 * defined, its path component is empty, and its scheme, authority, and
976 * with all other components equal to those of this URI is returned. This
983 * section&nbsp;5.2; that is: </p>
987 * <li><p> A new URI is constructed with this URI's scheme and the given
993 * <li><p> Otherwise the new URI's authority component is copied from
994 * this URI, and its path is computed as follows: </p>
998 * <li><p> If the given URI's path is absolute then the new URI's path
999 * is taken from the given URI. </p></li>
1001 * <li><p> Otherwise the given URI's path is relative, and so the new
1002 * URI's path is computed by resolving the path of the given URI
1003 * against the path of this URI. This is done by concatenating all but
1012 * <p> The result of this method is absolute if, and only if, either this
1013 * URI is absolute or the given URI is absolute. </p>
1019 * If <tt>uri</tt> is <tt>null</tt>
1037 * If <tt>str</tt> is <tt>null</tt>
1049 * <p> The relativization of the given URI against this URI is computed as
1056 * if the path of this URI is not a prefix of the path of the given URI,
1057 * then the given URI is returned. </p></li>
1059 * <li><p> Otherwise a new relative hierarchical URI is constructed with
1070 * If <tt>uri</tt> is <tt>null</tt>
1081 * first checking that this URI is absolute. </p>
1086 * If this URL is not absolute
1095 throw new IllegalArgumentException("URI is not absolute");
1112 * or <tt>null</tt> if the scheme is undefined
1119 * Tells whether or not this URI is absolute.
1121 * <p> A URI is absolute if, and only if, it has a scheme component. </p>
1123 * @return <tt>true</tt> if, and only if, this URI is absolute
1130 * Tells whether or not this URI is opaque.
1132 * <p> A URI is opaque if, and only if, it is absolute and its
1137 * @return <tt>true</tt> if, and only if, this URI is opaque
1145 * part is never undefined, though it may be empty.
1161 * <p> The string returned by this method is equal to that returned by the
1181 * categories. If the authority is server-based then it is further
1186 * or <tt>null</tt> if the authority is undefined
1195 * <p> The string returned by this method is equal to that returned by the
1200 * or <tt>null</tt> if the authority is undefined
1216 * or <tt>null</tt> if the user information is undefined
1225 * <p> The string returned by this method is equal to that returned by the
1230 * or <tt>null</tt> if the user information is undefined
1256 * where no <i>digit</i> sequence is longer than three characters and no
1262 * syntax of IPv6 addresses is specified in <a
1272 * or <tt>null</tt> if the host is undefined
1281 * <p> The port component of a URI, if defined, is a non-negative
1285 * or <tt>-1</tt> if the port is undefined
1300 * or <tt>null</tt> if the path is undefined
1309 * <p> The string returned by this method is equal to that returned by the
1314 * or <tt>null</tt> if the path is undefined
1329 * or <tt>null</tt> if the query is undefined
1338 * <p> The string returned by this method is equal to that returned by the
1343 * or <tt>null</tt> if the query is undefined
1358 * or <tt>null</tt> if the fragment is undefined
1367 * <p> The string returned by this method is equal to that returned by the
1372 * or <tt>null</tt> if the fragment is undefined
1386 * <p> If the given object is not a URI then this method immediately
1415 * @param ob The object to which this object is to be compared
1417 * @return <tt>true</tt> if, and only if, the given object is a URI that
1418 * is identical to this URI
1456 * Returns a hash-code value for this URI. The hash code is based upon all
1488 * component is undefined but the other is defined then the first is
1496 * <p> The ordering of URIs is defined as follows: </p>
1503 * <li><p> A hierarchical URI is considered to be less than an opaque URI
1544 * The object to which this URI is to be compared
1546 * @return A negative integer, zero, or a positive integer as this URI is
1550 * If the given object is not a URI
1582 // compare them in the usual, case-sensitive way. If one is
1583 // registry-based and one is server-based then the strings are
1600 * string computed from the originally-given components, as appropriate, is
1602 * or relativization, and so a string is constructed from this URI's
1638 * <p> The only serializable field of a URI instance is its <tt>string</tt>
1639 * field. That field is given a value, if it does not have one already,
1641 * method of the given object-output stream is invoked. </p>
1644 * is to be written
1656 * <p> The {@link java.io.ObjectInputStream#defaultReadObject()} method is
1657 * invoked to read the value of the <tt>string</tt> field. The result is
1660 * @param is The object-input stream from which this object
1661 * is being read
1663 private void readObject(ObjectInputStream is)
1667 is.defaultReadObject();
1796 // If a scheme is given then the path, if given, must be absolute
2011 // 5.2 (6g): If the result is absolute but the path begins with "../",
2012 // then we simply leave the path as-is
2019 // check if child if opaque first so that NPE is thrown
2020 // if child is null.
2044 // 5.2 (3): Child is absolute
2062 // 5.2 (5): Child path is absolute
2081 // If the given URI's path is normal then return the URI;
2105 // identical, and the base path is a prefix of the child's path, then
2110 // check if child if opaque first so that NPE is thrown
2111 // if child is null.
2141 // place. The array is first split into segments, replacing each slash
2142 // with '\0' and creating a segment-index array, each element of which is
2148 // This code is based upon src/solaris/native/java/io/canonicalize_md.c
2153 // segment, or a ".." segment. Return -1 if no further normalization is
2259 // segs[i] == -1 implies segment i is to be ignored
2341 // If there is a preceding non-".." segment, remove both that
2343 // ".." segment as-is.
2362 // DEVIATION: If the normalized path is relative, and if the first
2368 // The path is absolute
2379 // The path is empty, or else the original first segment survived,
2380 // in which case we already know that no leading "." is needed
2389 // At this point we know that the first segment is unused,
2440 // together they represent a 128-bit mask, where bit i is set iff the
2441 // character with value i is permitted.
2443 // This approach is more efficient than sequentially searching arrays of
2494 // Tell whether the given character is permitted by the given mask pair
2553 // The zero'th bit is used to indicate that escape pairs and non-US-ASCII
2554 // characters are allowed; this is handled by the scanEscape method below.
2689 // assuming that s is otherwise legal
2742 // sequence of escaped octets is not valid UTF-8 then the erroneous octets
2744 // Exception: any "%" found between "[]" is left alone. It is an IPv6 literal
2763 // This is not horribly efficient, but it will do for now
2889 // their first two arguments. The start is inclusive while the end is
2896 // a typical idiom is
2911 // Scan a specific char: If the char at the given start position is
2922 // in the err string (in which case -1 is returned), or the first char
2923 // in the stop string (in which case the index of the preceding char is
2925 // of the input string is returned). May return the start position if
3060 // fragment component. This is so that URIs such as "file:///foo/bar"
3062 // grammar does not permit it. If the authority is empty then the
3067 // The primary consequence of this deviation is that "#f" parses as a
3101 // Ambiguity: An authority that is a registry name rather than a server
3103 // the authority component is always followed by '/' or the end of the
3118 // contains a literal IPv6 address, therefore % is allowed
3132 // Might be (probably is) a server-based authority, so attempt
3255 // If the strict argument is true then we require that the given
3256 // interval contain nothing besides an IPv4 address; if it is false
3321 // IPv4 address is followed by something - check that
3322 // it's a ":" as this is the only valid character to
3388 // earlier in the document. Here is the original grammar: