com.pkrete.jsip2.variables
Class MediaTypeFactory

java.lang.Object
  extended by com.pkrete.jsip2.variables.MediaTypeFactory

public class MediaTypeFactory
extends Object

This class generates MediaType objects based on the media code. This class implements the Singleton design pattern, which means that only one instance is created at run time.

Author:
Petteri Kivimäki

Method Summary
static MediaTypeFactory getInstance()
          Returns a reference to the singleton object.
 MediaType getMediaType(String code)
          Returns the media type that matches the given code.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getInstance

public static MediaTypeFactory getInstance()
Returns a reference to the singleton object. The object is created when this method is called for the first time.

Returns:
reference to the singleton object

getMediaType

public MediaType getMediaType(String code)
                       throws InvalidSIP2ResponseValueException
Returns the media type that matches the given code.

Parameters:
code - media type code
Returns:
media type that matches the given code
Throws:
InvalidSIP2ResponseValueException


Copyright © 2012-2014. All Rights Reserved.