public class UriProfile extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
static int[] |
asciiHexTab
Hex char to integer conversion table.
|
static int |
B_ALPHAS
Bit to categorize a char as an alpha.
|
static int |
B_DIGITS
Bit to categorize a char as a digit.
|
static int |
B_FRAGMENT
Bit to categorize a char as FRAGMENT in RFC3986.
|
static int |
B_GEN_DELIMS
Bit to categorize a char as GEN-DELIMS in RFC3986.
|
static int |
B_PATH
Bit to categorize a char as PATH in RFC3986.
|
static int |
B_PCHAR
Bit to categorize a char as PCHAR in RFC3986.
|
static int |
B_QUERY
Bit to categorize a char as QUERY in RFC3986.
|
static int |
B_REGNAME
Bit to categorize a char as REGNAME in RFC3986.
|
static int |
B_RESERVED
Bit to categorize a char as RESERVED in RFC3986.
|
static int |
B_SCHEME_FIRST
Bit to categorize a char as first in scheme.
|
static int |
B_SCHEME_FOLLOW
Bit to categorize a char as following in scheme.
|
static int |
B_SEGMENT
Bit to categorize a char as SEGMENT in RFC3986.
|
static int |
B_SEGMENT_NZ
Bit to categorize a char as SEGMENT-NZ in RFC3986.
|
static int |
B_SEGMENT_NZ_NC
Bit to categorize a char as SEGMENT-NZ-NC in RFC3986.
|
static int |
B_SUB_DELIMS
Bit to categorize a char as SUB-DELIMS in RFC3986.
|
static int |
B_UNRESERVED
Bit to categorize a char as UNRESERVED in RFC3986.
|
static int |
B_USERINFO
Bit to categorize a char as USERINFO in RFC3986.
|
boolean |
bAllow16bitPercentEncoding
Does profile allow 16-bit percent encoding.
|
boolean |
bAllowInvalidPercentEncoding
Does profile allow invalid percent encoding.
|
boolean |
bAllowRelativeUris
Does profile allow relative URIs.
|
protected int[] |
charTypeMap
Array of integers used to categorize all 8bit chars.
|
protected static int[] |
defaultCharTypeMap
Default array of integers used to categorize all 8bit chars.
|
static char[] |
hexTab
Integer to hex char conversion table.
|
static UriProfile |
RFC3986
RFC3986 compliant URI profile.
|
static UriProfile |
RFC3986_ABS_16BIT
Modified RFC3986 URI profile which disallows relative URIs
and allows 16-bit percent encoding.
|
static UriProfile |
RFC3986_ABS_16BIT_LAX
Relaxed RFC3986 URI profile which disallows relative URIs,
allows 16-bit percent encoding, allow invalid percent encoding
and allows most 8-bit characters.
|
| Constructor and Description |
|---|
UriProfile()
Construct an
UriProfile initialized with RFC3986
rules. |
UriProfile(UriProfile uriProfile)
Construct an
UriProfile initialized from another profile. |
| Modifier and Type | Method and Description |
|---|---|
static void |
charTypeAddAndOr(int[] charTypeMap,
java.lang.String chars,
int bw_and,
int bw_or)
Helper method to populate an integer array with character categories.
|
void |
charTypeAddAndOr(java.lang.String chars,
int bw_and,
int bw_or)
Helper method to populate the profiles integer array with character
categories.
|
int |
indexOf(int bw_and,
java.lang.String str,
int pos)
Given a collection of characters find the index of the first occurrence
of any of the characters in the supplied string starting from a certain
position.
|
java.lang.String |
validate_decode(int bw_and,
java.lang.String componentName,
java.lang.String str)
Validates an URI component according to the supplied character category
bitfield.
|
void |
validate_first_follow(java.lang.String str,
int bw_and_first,
int bw_and_follow)
Validate an URI component using two character categories.
|
public static final int B_ALPHAS
public static final int B_DIGITS
public static final int B_SCHEME_FIRST
public static final int B_SCHEME_FOLLOW
public static final int B_UNRESERVED
public static final int B_GEN_DELIMS
public static final int B_SUB_DELIMS
public static final int B_RESERVED
public static final int B_PCHAR
public static final int B_USERINFO
public static final int B_REGNAME
public static final int B_SEGMENT
public static final int B_SEGMENT_NZ
public static final int B_SEGMENT_NZ_NC
public static final int B_PATH
public static final int B_QUERY
public static final int B_FRAGMENT
protected final int[] charTypeMap
public boolean bAllowRelativeUris
public boolean bAllow16bitPercentEncoding
public boolean bAllowInvalidPercentEncoding
public static int[] asciiHexTab
public static char[] hexTab
protected static int[] defaultCharTypeMap
public static final UriProfile RFC3986
public static final UriProfile RFC3986_ABS_16BIT
public static final UriProfile RFC3986_ABS_16BIT_LAX
public UriProfile()
UriProfile initialized with RFC3986
rules.public UriProfile(UriProfile uriProfile)
UriProfile initialized from another profile.uriProfile - URI profile to base a new profile onpublic void charTypeAddAndOr(java.lang.String chars, int bw_and, int bw_or)
chars - characters to categorize or nullbw_and - character categories to include in new categorybw_or - new category/categoriespublic int indexOf(int bw_and, java.lang.String str, int pos) throws java.net.URISyntaxException
bw_and - bits identifying one or more character categoriesstr - string to search throughpos - position to start searching fromjava.net.URISyntaxException - if a character with a value larger that 255
is encounteredpublic void validate_first_follow(java.lang.String str, int bw_and_first, int bw_and_follow) throws java.net.URISyntaxException
str - URI component stringbw_and_first - bits identifying first character categoriesbw_and_follow - bits identifying following character categoriesjava.net.URISyntaxException - if an error occurs parsing componentpublic java.lang.String validate_decode(int bw_and, java.lang.String componentName, java.lang.String str) throws java.net.URISyntaxException
bw_and - bits identifying one or more character categoriescomponentName - URI component namestr - URI component stringjava.net.URISyntaxException - if an error occurs parsing/validating componentpublic static void charTypeAddAndOr(int[] charTypeMap, java.lang.String chars, int bw_and, int bw_or)
charTypeMap - integer array with character categorieschars - characters to categorize or nullbw_and - character categories to include in new categorybw_or - new category/categoriesCopyright © 2011–2023. All rights reserved.