JXTA

net.jxta.impl.protocol
Class ModuleSpecAdv

java.lang.Object
  extended by net.jxta.document.Advertisement
      extended by net.jxta.document.ExtendableAdvertisement
          extended by net.jxta.protocol.ModuleSpecAdvertisement
              extended by net.jxta.impl.protocol.ModuleSpecAdv
All Implemented Interfaces:
Cloneable

public class ModuleSpecAdv
extends ModuleSpecAdvertisement

Provides XML serialization support for ModuleSpecAdvertisement matching the schema defined by the JXTA Core Specification.

  <xs:complexType name="MSA">
    <xs:sequence>
      <xs:element name="MSID" type="jxta:JXTAID" />
      <xs:element name="Name" type="xs:string" minOccurs="0" />
      <xs:element name="Desc" type="xs:anyType" minOccurs="0" />
      <xs:element name="Crtr" type="xs:string" minOccurs="0" />
      <xs:element name="SURI" type="xs:anyURI" minOccurs="0" />
      <xs:element name="Vers" type="xs:string" />
      <xs:element name="Parm" type="xs:anyType" minOccurs="0" />
      <xs:element ref="jxta:PipeAdvertisement" minOccurs="0" />
      <xs:element name="Proxy" type="xs:anyURI" minOccurs="0" />
      <xs:element name="Auth" type="jxta:JXTAID" minOccurs="0" />
    </xs:sequence>
  </xs:complexType>
 

See Also:
Advertisement, ModuleSpecAdvertisement,
Nested Class Summary
static class ModuleSpecAdv.Instantiator
           
 
Method Summary
 String getAdvType()
          Returns the identifying type of this Advertisement.
 Document getDocument(MimeMediaType encodeAs)
          Write this advertisement into a document of the requested type.
 String[] getIndexFields()
          Returns the element names on which this advertisement should be indexed.
protected  boolean handleElement(Element raw)
          Process an individual element from the document during parse.
 
Methods inherited from class net.jxta.protocol.ModuleSpecAdvertisement
clone, getAdvertisementType, getAuthSpecID, getBaseAdvType, getCreator, getDesc, getDescription, getID, getModuleSpecID, getName, getParam, getParamPriv, getPipeAdvertisement, getProxySpecID, getSpecURI, getVersion, setAuthSpecID, setCreator, setDesc, setDescription, setModuleSpecID, setName, setParam, setPipeAdvertisement, setProxySpecID, setSpecURI, setVersion
 
Methods inherited from class net.jxta.document.ExtendableAdvertisement
handleAttribute
 
Methods inherited from class net.jxta.document.Advertisement
toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getAdvType

public String getAdvType()
Returns the identifying type of this Advertisement. Unlike Advertisement.getAdvertisementType() this method will return the correct runtime type of an Advertisement object.

This implementation is provided for existing advertisements which do not provide their own implementation. In most cases you should provide your own implementation for efficiency reasons.

Overrides:
getAdvType in class Advertisement
Returns:
The identifying type of this Advertisement.

handleElement

protected boolean handleElement(Element raw)
Process an individual element from the document during parse. Normally, implementations will allow the base advertisements a chance to handle the element before attempting to handle the element themselves. ie.


  protected boolean handleElement(Element elem) {

      if (super.handleElement()) {
           // it's been handled.
           return true;
           }
      ... handle elements here ...

      // we don't know how to handle the element
      return false;
      }
  

Overrides:
handleElement in class ExtendableAdvertisement
Parameters:
raw - The element to be processed.
Returns:
true if the element was recognized, otherwise false.

getDocument

public Document getDocument(MimeMediaType encodeAs)
Write this advertisement into a document of the requested type. Two standard document forms are defined. "text/plain" encodes the document in a "pretty-print" format for human viewing and "text/xml" which provides an XML format.

We don't have any content to add, just build the document instance and return it to implementations that actually do something with it.

Overrides:
getDocument in class ExtendableAdvertisement
Parameters:
encodeAs - MimeMediaType format representation requested.
Returns:
The Advertisement represented as a Document of the requested MIME Media Type.

getIndexFields

public String[] getIndexFields()
Returns the element names on which this advertisement should be indexed.

Specified by:
getIndexFields in class Advertisement
Returns:
The element names on which this advertisement should be indexed.

JXSE