|
JXTA | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.jxta.document.Advertisement
net.jxta.document.ExtendableAdvertisement
public abstract class ExtendableAdvertisement
Extendable advertisements provide features for allowing inheritance of advertisement types. The core and standard JXTA advertisements all allow extension by extending this class.
Advertisement
,
AdvertisementFactory
,
Document
,
MimeMediaType
Constructor Summary | |
---|---|
protected |
ExtendableAdvertisement()
Default constructor. |
protected |
ExtendableAdvertisement(boolean formatted)
|
Method Summary | |
---|---|
abstract String |
getBaseAdvType()
Returns the base type of this advertisement hierarchy. |
Document |
getDocument(MimeMediaType encodeAs)
Write this advertisement into a document of the requested type. |
protected boolean |
handleAttribute(Attribute attrib)
Process an individual attribute from the document root node. |
protected boolean |
handleElement(Element elem)
Process an individual element from the document during parse. |
Methods inherited from class net.jxta.document.Advertisement |
---|
clone, getAdvertisementType, getAdvType, getID, getIndexFields, toString |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
protected ExtendableAdvertisement()
protected ExtendableAdvertisement(boolean formatted)
formatted
- If true
then the advertisement will be pretty
print formatted when it is output as XML.Method Detail |
---|
public abstract String getBaseAdvType()
final
.
protected boolean handleElement(Element elem)
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;
}
elem
- The element to be processed.
true
if the element was recognized, otherwise false.protected boolean handleAttribute(Attribute attrib)
protected boolean handleAttribute( Attribute elem ) {
if (super.handleAttribute()) {
// it's been handled.
return true;
}
... handle attributes here ...
// we don't know how to handle the attribute
return false;
}
attrib
- The attribute to be processed.
true
if the attribute was recognized, otherwise false.public Document getDocument(MimeMediaType encodeAs)
"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.
- Specified by:
getDocument
in class Advertisement
- Parameters:
encodeAs
- MimeMediaType format representation requested.
- Returns:
- The
Advertisement
represented as a Document
of
the requested MIME Media Type.
|
JXSE | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |