NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

gov.nist.javax.sip.header
Class SIPObject

java.lang.Object
  extended by gov.nist.core.GenericObject
      extended by gov.nist.javax.sip.header.SIPObject
All Implemented Interfaces:
Serializable, Cloneable
Direct Known Subclasses:
CallIdentifier, Challenge, Credentials, MediaRange, Protocol, RequestLine, SIPHeader, StatusLine

public abstract class SIPObject
extends gov.nist.core.GenericObject

Root class for all singleton objects in this package: specializes the gov.nist.sip.header.GenericObject class for SIPHeader related objects.

Version:
1.2 $Revision: 1.10 $ $Date: 2009/07/17 18:57:38 $
Author:
M. Ranganathan
See Also:
Serialized Form

Method Summary
 void dbgPrint()
          Debug function
 String debugDump()
          An introspection based string formatting method.
 String debugDump(int indent)
          Formatter with a given starting indentation (for nested structs).
abstract  String encode()
          Encode the header into a String.
 StringBuffer encode(StringBuffer buffer)
          Encode the header into the given StringBuffer.
 boolean equals(Object other)
          An introspection based equality predicate for SIPObjects.
 boolean match(Object other)
          An introspection based predicate matching using a template object.
 String toString()
           
 
Methods inherited from class gov.nist.core.GenericObject
clone, getClassFromName, getMatcher, isMySubclass, makeClone, merge, setMatcher
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

dbgPrint

public void dbgPrint()
Debug function

Overrides:
dbgPrint in class gov.nist.core.GenericObject

encode

public abstract String encode()
Encode the header into a String.

Specified by:
encode in class gov.nist.core.GenericObject
Returns:
String

encode

public StringBuffer encode(StringBuffer buffer)
Encode the header into the given StringBuffer. Default implemation calls encode().

Overrides:
encode in class gov.nist.core.GenericObject

equals

public boolean equals(Object other)
An introspection based equality predicate for SIPObjects.

Overrides:
equals in class gov.nist.core.GenericObject
Parameters:
other - the other object to test against.
Returns:
true if the objects are euqal and false otherwise

match

public boolean match(Object other)
An introspection based predicate matching using a template object. Allows for partial match of two protocl Objects. You can set a generalized matcher (using regular expressions for example) by implementing the Match interface and registering it with the template.

Overrides:
match in class gov.nist.core.GenericObject
Parameters:
other - the match pattern to test against. The match object has to be of the same type (class). Primitive types and non-sip fields that are non null are matched for equality. Null in any field matches anything. Some book-keeping fields are ignored when making the comparison.

debugDump

public String debugDump()
An introspection based string formatting method. We need this because in this package (although it is an exact duplicate of the one in the superclass) because it needs to access the protected members of the other objects in this class.

Overrides:
debugDump in class gov.nist.core.GenericObject
Returns:
String

debugDump

public String debugDump(int indent)
Formatter with a given starting indentation (for nested structs).

Overrides:
debugDump in class gov.nist.core.GenericObject
Parameters:
indent - int to set
Returns:
String

toString

public String toString()
Overrides:
toString in class Object

NIST-SIP: The Reference Implementation for JAIN-SIP 1.2

A product of the NIST/ITL Advanced Networking Technologies Division.
See conditions of use.
Submit a bug report or feature request.