public class CharsMsgParser extends Object implements gov.nist.javax.sip.parser.MessageParser
| Modifier and Type | Field and Description |
|---|---|
protected static Charset |
charset |
protected static boolean |
computeContentLengthFromMessage |
protected static char[] |
SIP_VERSION_CHAR |
| Constructor and Description |
|---|
CharsMsgParser() |
| Modifier and Type | Method and Description |
|---|---|
static void |
main(String[] args)
Test code.
|
gov.nist.javax.sip.address.AddressImpl |
parseAddress(char[] address)
Parse an address (nameaddr or address spec) and return and address
structure.
|
gov.nist.core.Host |
parseHost(char[] host)
Parse a host name and return a parsed structure.
|
gov.nist.javax.sip.message.SIPMessage |
parseSIPMessage(byte[] msgBuffer,
boolean readBody,
boolean strict,
gov.nist.javax.sip.parser.ParseExceptionListener exhandler)
Parse a buffer containing a single SIP Message where the body is an array
of un-interpreted bytes.
|
gov.nist.javax.sip.header.RequestLine |
parseSIPRequestLine(char[] requestLine)
Parse the SIP Request Line
|
gov.nist.javax.sip.header.StatusLine |
parseSIPStatusLine(char[] statusLine)
Parse the SIP Response message status line
|
gov.nist.javax.sip.address.SipUri |
parseSIPUrl(char[] url)
Parse a SIP url from a string and return a URI structure for it.
|
gov.nist.javax.sip.address.TelephoneNumber |
parseTelephoneNumber(char[] telephone_number)
Parse a telephone number return a parsed structure.
|
gov.nist.javax.sip.address.GenericURI |
parseUrl(char[] url)
Parse a uri from a string and return a URI structure for it.
|
protected gov.nist.javax.sip.message.SIPMessage |
processFirstLine(char[] firstLine,
gov.nist.javax.sip.parser.ParseExceptionListener parseExceptionListener,
byte[] msgBuffer) |
protected void |
processHeader(char[] header,
gov.nist.javax.sip.message.SIPMessage message,
gov.nist.javax.sip.parser.ParseExceptionListener parseExceptionListener,
byte[] msgBuffer) |
static void |
setComputeContentLengthFromMessage(boolean computeContentLengthFromMessage) |
protected static char[] |
trimEndOfLine(char[] line) |
protected static boolean computeContentLengthFromMessage
protected static final Charset charset
protected static final char[] SIP_VERSION_CHAR
public gov.nist.javax.sip.message.SIPMessage parseSIPMessage(byte[] msgBuffer,
boolean readBody,
boolean strict,
gov.nist.javax.sip.parser.ParseExceptionListener exhandler)
throws ParseException
parseSIPMessage in interface gov.nist.javax.sip.parser.MessageParsermsgBuffer - a byte buffer containing the messages to be parsed. This can
consist of multiple SIP Messages concatenated together.ParseException - is thrown when an illegal message has been encountered
(and the rest of the buffer is discarded).ParseExceptionListenerprotected static char[] trimEndOfLine(char[] line)
protected gov.nist.javax.sip.message.SIPMessage processFirstLine(char[] firstLine,
gov.nist.javax.sip.parser.ParseExceptionListener parseExceptionListener,
byte[] msgBuffer)
throws ParseException
ParseExceptionprotected void processHeader(char[] header,
gov.nist.javax.sip.message.SIPMessage message,
gov.nist.javax.sip.parser.ParseExceptionListener parseExceptionListener,
byte[] msgBuffer)
throws ParseException
ParseExceptionpublic gov.nist.javax.sip.address.AddressImpl parseAddress(char[] address)
throws ParseException
address - is a String containing the address to be parsed.ParseException - when the address is badly formatted.public gov.nist.core.Host parseHost(char[] host)
throws ParseException
host - is a String containing the host name to be parsedParseException - a ParseException when the hostname is badly formatted.public gov.nist.javax.sip.address.TelephoneNumber parseTelephoneNumber(char[] telephone_number)
throws ParseException
telephone_number - is a String containing the telephone # to be parsedParseException - a ParseException when the address is badly formatted.public gov.nist.javax.sip.address.SipUri parseSIPUrl(char[] url)
throws ParseException
url - a String containing the URI structure to be parsed.ParseException - if there was an error parsing the message.public gov.nist.javax.sip.address.GenericURI parseUrl(char[] url)
throws ParseException
url - a String containing the URI structure to be parsed.ParseException - if there was an error parsing the message.public gov.nist.javax.sip.header.RequestLine parseSIPRequestLine(char[] requestLine)
throws ParseException
requestLine - a String containing the request line to be parsed.ParseException - if there was an error parsing the requestLine.public gov.nist.javax.sip.header.StatusLine parseSIPStatusLine(char[] statusLine)
throws ParseException
statusLine - a String containing the Status line to be parsed.ParseException - if there was an error parsingStatusLinepublic static void setComputeContentLengthFromMessage(boolean computeContentLengthFromMessage)
public static void main(String[] args) throws ParseException
ParseExceptionCopyright © 2016. All Rights Reserved.