p2ps.imp.discovery
Class AdvertisementUtils

java.lang.Object
  extended byp2ps.imp.discovery.AdvertisementUtils

public class AdvertisementUtils
extends java.lang.Object

A utility class for handling advertisement XML

Version:
$Revision: 295 $
Author:
Ian Wang

Constructor Summary
AdvertisementUtils()
           
 
Method Summary
static java.lang.String getAdvertID(Element advert)
           
static Element getXMLAdvert(Element envelope)
           
static boolean isAdvertisement(Element advert)
           
static boolean isQuery(Element advert)
           
static boolean isXMLEnvelope(Element elem)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AdvertisementUtils

public AdvertisementUtils()
Method Detail

isXMLEnvelope

public static boolean isXMLEnvelope(Element elem)
Returns:
true if the specified envelope contains an valid advertisement

getXMLAdvert

public static Element getXMLAdvert(Element envelope)
Returns:
the root element of the advert from within the XML envelope (or null if no advert contained)

getAdvertID

public static java.lang.String getAdvertID(Element advert)
Returns:
the advert id from the advert XML root.

isAdvertisement

public static boolean isAdvertisement(Element advert)
Returns:
true if the specified XML element is a advertisement/query (queries a specialized advertisements)

isQuery

public static boolean isQuery(Element advert)
Returns:
true if the specified XML advert is a query