org.quasiliteral.syntax
Class URIKit

java.lang.Object
  |
  +--org.quasiliteral.syntax.URIKit

public class URIKit
extends Object

Safe: This class provides some conveniences for manipulating E URI-tokens.

A URI-token is an E token with a type-code of either URI or URIStart.

 
     <uri> ::= '<' <identifier>
  ':' <uric>* '>'
     <uriStart> ::= '<' <identifier> ':'
 

Author:
Mark S. Miller

Field Summary
private static boolean[] URICs
           
 
Constructor Summary
URIKit()
          Enabled:
 
Method Summary
static Twine getBody(Twine uriText)
          Enabled: All text after the first colon
static Twine getProtcol(Twine uriText)
          Enabled: All text up to but not including the first colon.
static boolean isURIC(char c)
          Enabled: According to BNF of opaque URIs (see Appendix A) these are characters that can occur within a URI body:
static boolean isURICs(String str)
          Enabled:
static Twine normalize(Twine uriText)
          Enabled: Normalizes an input URI string to the "actual" URI string.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

URICs

private static final boolean[] URICs
Constructor Detail

URIKit

public URIKit()
Enabled:

Method Detail

normalize

public static Twine normalize(Twine uriText)
Enabled: Normalizes an input URI string to the "actual" URI string.

A backslash ('\\') normalizes to a slash ('/'), and a vertical bar ('|') normalizes to a colon (':'), leaving only URIC characters (according to BNF of opaque URIs (see Appendix A)) and the fragment identifier (sharp-sign ('#')).

XXX An open question is whether normalize/1 should also normalize '%<hex><hex>' to the encoded character. Currently this is not done.


getProtcol

public static Twine getProtcol(Twine uriText)
Enabled: All text up to but not including the first colon.


getBody

public static Twine getBody(Twine uriText)
Enabled: All text after the first colon


isURIC

public static boolean isURIC(char c)
Enabled: According to BNF of opaque URIs (see Appendix A) these are characters that can occur within a URI body:
    a-z, A-Z, 0-9, any of ;/?:@&=+$,-_.!~*'()%
In addition, by special dispensation, we allow '\\', which we normalize to '/', and '|', which we normalize to ':', and '#' which is the fragment indicator.

FileGetter also does these normalizations dynamically.


isURICs

public static boolean isURICs(String str)
Enabled:

Parameters:
str -
Returns:


comments?