Jitsi: the OpenSource Java VoIP and Instant Messaging client.

net.java.sip.communicator.impl.protocol.sip.xcap.model.presrules
Class PresRulesParser

java.lang.Object
  extended by net.java.sip.communicator.impl.protocol.sip.xcap.model.presrules.PresRulesParser

public final class PresRulesParser
extends Object

Utility class that helps to converts pres-rules xml to the object model and object model to the pres-rules xml.

Author:
Grigorii Balutsel

Constructor Summary
PresRulesParser()
           
 
Method Summary
static ActionsType actionsFromElement(Element element)
          Creates actions object from the element.
static Element elementFromActions(Document document, ActionsType actions)
          Creates actions element from the object.
static Element elementFromDevicePermission(Document document, ProvideDevicePermissionType devicePermission)
          Creates devicePermission element from the object.
static Element elementFromPersonPermission(Document document, ProvidePersonPermissionType personPermission)
          Creates personPermission element from the object.
static Element elementFromServicePermission(Document document, ProvideServicePermissionType serviceService)
          Creates serviceService element from the object.
static Element elementFromTransfomations(Document document, TransformationsType transformations)
          Creates transformations element from the object.
static TransformationsType transformationsFromElement(Element element)
          Creates transfomations object from the element.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

PresRulesParser

public PresRulesParser()
Method Detail

actionsFromElement

public static ActionsType actionsFromElement(Element element)
                                      throws Exception
Creates actions object from the element.

Parameters:
element - the element to analyze.
Returns:
the actions object.
Throws:
Exception - if there is some error during parsing.

elementFromActions

public static Element elementFromActions(Document document,
                                         ActionsType actions)
                                  throws Exception
Creates actions element from the object.

Parameters:
document - the xml document.
actions - the actions to analyze.
Returns:
the rule element.
Throws:
Exception - if there is some error during creating.

transformationsFromElement

public static TransformationsType transformationsFromElement(Element element)
                                                      throws Exception
Creates transfomations object from the element.

Parameters:
element - the element to analyze.
Returns:
the transfomations object.
Throws:
Exception - if there is some error during parsing.

elementFromTransfomations

public static Element elementFromTransfomations(Document document,
                                                TransformationsType transformations)
                                         throws Exception
Creates transformations element from the object.

Parameters:
document - the xml document.
transformations - the transformations to analyze.
Returns:
the rule element.
Throws:
Exception - if there is some error during creating.

elementFromServicePermission

public static Element elementFromServicePermission(Document document,
                                                   ProvideServicePermissionType serviceService)
                                            throws Exception
Creates serviceService element from the object.

Parameters:
document - the xml document.
serviceService - the serviceService to analyze.
Returns:
the rule element.
Throws:
Exception - if there is some error during creating.

elementFromDevicePermission

public static Element elementFromDevicePermission(Document document,
                                                  ProvideDevicePermissionType devicePermission)
                                           throws Exception
Creates devicePermission element from the object.

Parameters:
document - the xml document.
devicePermission - the devicePermission to analyze.
Returns:
the rule element.
Throws:
Exception - if there is some error during creating.

elementFromPersonPermission

public static Element elementFromPersonPermission(Document document,
                                                  ProvidePersonPermissionType personPermission)
                                           throws Exception
Creates personPermission element from the object.

Parameters:
document - the xml document.
personPermission - the personPermission to analyze.
Returns:
the rule element.
Throws:
Exception - if there is some error during creating.

Jitsi: the OpenSource Java VoIP and Instant Messaging client.

Jitsi, the OpenSource Java VoIP and Instant Messaging client.
Distributable under LGPL license.