Package org.evolvis.tartools.rfc822
Class UXAddress
- java.lang.Object
-
- org.evolvis.tartools.rfc822.Path
-
- org.evolvis.tartools.rfc822.UXAddress
-
@Deprecated public class UXAddress extends Path
Deprecated.not yet implementedRepresents an RFC822 (and successors) eMail address header content, likePath, except the parser accepts more varying input, especially input by humans, and MIME-encodes nōn-ASCII characters.- Author:
- mirabilos (t.glaser@tarent.de)
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class org.evolvis.tartools.rfc822.Path
Path.Address, Path.AddressList, Path.AddrSpec, Path.AddrSpecSIDE, Path.ParserResult, Path.UnfoldedSubstring
-
-
Constructor Summary
Constructors Modifier Constructor Description protectedUXAddress(String input)Deprecated.Private constructor, use the factory methodof(String)instead
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description protected intaccept()Advances the current position to the next characterprotected intbra(int deltapos)Jumps to a specified input character position, relative jumpprotected intcur()Returns the wide character at the current positionprotected intjmp(int pos)Jumps to a specified input character position, absolute jumpprotected static <T extends org.evolvis.tartools.rfc822.Parser>
Tof(Class<T> cls, String input)Constructs a parser.static UXAddressof(String addresses)Deprecated.Creates and initialises a new parser for eMail addresses.protected intpeek()Returns the wide character after the one at the current positionprotected intpos()Returns the current input character position, for saving and restoring (withjmp(int)) and for error messagesprotected Strings()Returns the input string, for use with substring comparisons (this is safe because Java™ strings are immutable)protected intskip(BiFunction<Integer,Integer,Boolean> matcher)Advances the current position as long as the matcher returns true and end of input is not yet reachedprotected intskip(Function<Integer,Boolean> matcher)Advances the current position as long as the matcher returns true and end of input is not yet reached; cf.-
Methods inherited from class org.evolvis.tartools.rfc822.Path
asAddressList, asAddrSpec, asMailboxList, forSender, is, isAtext, isCtext, isDtext, isQtext, pAddress, pAddressList, pAddrSpec, pAngleAddr, pAtom, pCcontent, pCFWS, pComment, pDisplayName, pDomain, pDomainLiteral, pDotAtom, pFWS, pGroup, pLocalPart, pMailbox, pMailboxList, pNameAddr, pPhrase, pQcontent, pQuotedPair, pQuotedString, pWord, unfold, unfold
-
-
-
-
Constructor Detail
-
UXAddress
protected UXAddress(String input)
Deprecated.Private constructor, use the factory methodof(String)instead- Parameters:
input- string to analyse
-
-
Method Detail
-
of
public static UXAddress of(String addresses)
Deprecated.Creates and initialises a new parser for eMail addresses.- Parameters:
addresses- to parse- Returns:
- null if addresses was null or very large, the new instance otherwise
-
of
protected static <T extends org.evolvis.tartools.rfc822.Parser> T of(Class<T> cls, String input)
Constructs a parser. Intended to be used by subclasses from static factory methods *only*; seePath.of(String)for an example.- Type Parameters:
T- subclass of Parser to construct- Parameters:
cls- subclass of Parser to constructinput- user-providedStringto parse- Returns:
- null if input was null or too large, the new instance otherwise
-
jmp
protected final int jmp(int pos)
Jumps to a specified input character position, absolute jump- Parameters:
pos- to jump to- Returns:
- the codepoint at that position
- Throws:
IndexOutOfBoundsException- if pos is not in or just past the input
-
bra
protected final int bra(int deltapos)
Jumps to a specified input character position, relative jump- Parameters:
deltapos- to add to the current positioin- Returns:
- the codepoint at that position
- Throws:
IndexOutOfBoundsException- if pos is not in or just past the input
-
pos
protected final int pos()
Returns the current input character position, for saving and restoring (withjmp(int)) and for error messages- Returns:
- position
-
s
protected final String s()
Returns the input string, for use with substring comparisons (this is safe because Java™ strings are immutable)- Returns:
- String input
-
cur
protected final int cur()
Returns the wide character at the current position- Returns:
- UCS-4 codepoint, or -1 if end of input is reached
-
peek
protected final int peek()
Returns the wide character after the one at the current position- Returns:
- UCS-4 codepoint, or -1 if end of input is reached
-
accept
protected final int accept()
Advances the current position to the next character- Returns:
- codepoint of the next character, or -1 if end of input is reached
- Throws:
IndexOutOfBoundsException- if end of input was already reached
-
skip
protected final int skip(BiFunction<Integer,Integer,Boolean> matcher)
Advances the current position as long as the matcher returns true and end of input is not yet reached
-
skip
protected final int skip(Function<Integer,Boolean> matcher)
Advances the current position as long as the matcher returns true and end of input is not yet reached; cf.skip(BiFunction)- Parameters:
matcher- gets called with justcur()as argument- Returns:
- codepoint of the first character where the matcher returned false, or -1
-
-