|
Project JXTA | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--net.jxta.util.ClassFactory | +--net.jxta.document.AdvertisementFactory
This class is a class factory for Advertisements. The class enables to hide the implementation used to represent and create advertisements.
Advertisements are core objects that are used to advertise a Peer, a PeerGroup, a Service, or a PipeService. The Advertisement class provides a platform independent representation of core objects that can be exchanged between different implementations (Java, C).
The AdvertisementFactory extends the ClassFactory to register the various types of adverstisements into a static hastable. The factory is called with the Advertisement type requested to create the corresponding advertisement type.
Advertisement
,
Document
,
MimeMediaType
,
PeerGroup
,
PeerAdvertisement
,
PeerGroupAdvertisement
,
PipeAdvertisement
Constructor Summary | |
AdvertisementFactory()
|
Method Summary | |
protected java.util.Hashtable |
getAssocTable()
Used by ClassFactory methods to get the mapping of Mime Types to constructors. |
protected java.lang.Class |
getBaseClassForFactory()
Used by ClassFactory methods to ensure that all of the instance classes which register with this factory have the correct base class |
protected java.lang.Class |
getClassForKey()
Used by ClassFactory methods to ensure that all keys used with the mapping are of the correct type. |
protected java.lang.Class[][] |
getRequiredConstructors()
Used by ClassFactory methods to determine the required set of constructors needed by the instance classes generated by this factory. |
protected java.lang.Object[][] |
getRequiredStaticMethods()
Used by ClassFactory methods to determine the required set of static methods needed by classes registering with this factory. |
static Advertisement |
newAdvertisement(MimeMediaType mimetype,
java.io.InputStream stream)
Constructs an instance of Advertisement matching the type
specified by the advertisementType parameter. |
static Advertisement |
newAdvertisement(java.lang.String advertisementType)
Constructs an instance of Advertisement matching the type
specified by the advertisementType parameter. |
static Advertisement |
newAdvertisement(TextElement root)
Constructs an instance of Advertisement matching the type
specified by the advertisementType parameter. |
static boolean |
registerAdvertisementInstance(java.lang.String rootType,
java.lang.Class instanceClass)
Register an array of constructor for an ID type to enable IDs of that type to be constructed. |
protected boolean |
registerAssoc(java.lang.String className)
Register a class with the factory from its class name. |
Methods inherited from class net.jxta.util.ClassFactory |
callStaticMethod,
newInstance,
registerAssoc,
registerFromResources,
registerFromString |
Methods inherited from class java.lang.Object |
clone,
equals,
finalize,
getClass,
hashCode,
notify,
notifyAll,
toString,
wait,
wait,
wait |
Constructor Detail |
public AdvertisementFactory()
Method Detail |
protected java.util.Hashtable getAssocTable()
protected java.lang.Class getBaseClassForFactory()
protected java.lang.Class getClassForKey()
protected java.lang.Class[][] getRequiredConstructors()
protected java.lang.Object[][] getRequiredStaticMethods()
protected boolean registerAssoc(java.lang.String className)
className
- The class name which will be regiestered.public static boolean registerAdvertisementInstance(java.lang.String rootType, java.lang.Class instanceClass) throws java.lang.NoSuchMethodException, java.lang.SecurityException
rootType
- the identifying value for this advertisement instance typeinstanceClass
- the constructors to use in constructing objects
of this rootTypeIns type.public static Advertisement newAdvertisement(java.lang.String advertisementType) throws java.lang.reflect.InvocationTargetException
Advertisement
matching the type
specified by the advertisementType
parameter.advertisementType
- Specifies the mime media type to be associated with the
StructuredDocument
to be created.Advertisement
or null if it
could not be created.public static Advertisement newAdvertisement(MimeMediaType mimetype, java.io.InputStream stream) throws java.lang.reflect.InvocationTargetException
Advertisement
matching the type
specified by the advertisementType
parameter.mimetype
- Specifies the mime media type to be associated with the
StructuredDocument
to be created.stream
- imput stream used to read data to construct the advertisementAdvertisement
or null if it
could not be created.public static Advertisement newAdvertisement(TextElement root) throws java.lang.reflect.InvocationTargetException
Advertisement
matching the type
specified by the advertisementType
parameter.root
- Specifies a portion of a StructuredDocument which will be
converted into an Advertisement.Advertisement
or null if it
could not be created.
|
Project JXTA | ||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |