|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.sun.management.oss.impl.pm.opstatus.xml.PmXmlSerializerImpl
| Constructor Summary | |
PmXmlSerializerImpl(java.lang.String type)
Get all the encoding styles supported by this Serializer. |
|
| Method Summary | |
java.lang.Object |
fromXml(org.w3c.dom.Element element)
Deserialize the XML DOM element subtree into the Java object. |
java.lang.String |
getDefaultEncodingStyle()
Returns the default encoding that is the encoding style used by the Serializer when it is created. |
java.lang.String |
getEncodingStyle()
The encoding style associated with this Serializer. |
java.lang.String[] |
getSupportedEncodingStyles()
Get all the encoding styles supported by this Serializer. |
java.lang.String |
getType()
Returns the type of object that this Serializer can marshall and unmarshall from and to XML, for example com.sun.management.oss.TroubleTicketValue |
void |
setEncodingStyle(java.lang.String encodingStyle)
Set the encoding style associated with this Serializer. |
java.lang.String |
toXml(java.lang.Object object,
java.lang.String elementName)
Serialize this Java object as an XML element. |
| Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public PmXmlSerializerImpl(java.lang.String type)
| Method Detail |
public java.lang.String[] getSupportedEncodingStyles()
getSupportedEncodingStyles in interface Serializerpublic java.lang.String getDefaultEncodingStyle()
setEncodingStyle()
getDefaultEncodingStyle in interface Serializer
public void setEncodingStyle(java.lang.String encodingStyle)
throws java.lang.IllegalArgumentException
For example "http://www.ossj.org/encoding/ossxml" for the OSSJ XML Encoding Style defined in the OSSJ Design Guidelines.
One of the items returned by getSupportedEncodingStyles()
should be provided as parameter.
setEncodingStyle in interface SerializerencodingStyle - The encodingStyle string.
com.sun.management.oss.IllegalArgumentException - if the provided
encoding style is not valid or is not recognized by the Serializer.
java.lang.IllegalArgumentException - if the provided
encoding style is not valid or is not recognized by the Serializer.public java.lang.String getEncodingStyle()
For example "http://www.ossj.org/encoding/ossxml" for the OSSJ XML Encoding Style defined in the OSSJ Design Guidelines.
A Serializer is always created with a default encoding style.
The default encoding style is provided by the value of the
OSS_DEFAULT_ENCODING_STYLE found in the declaration of the
specific serializer type EncodingStyles interface.
getEncodingStyle in interface Serializerpublic java.lang.String getType()
com.sun.management.oss.TroubleTicketValue
getType in interface Serializer
public java.lang.String toXml(java.lang.Object object,
java.lang.String elementName)
throws java.lang.IllegalArgumentException
For example assuming that this a Serializer for a <ManagedEntity>Key
then calling toXML( "myElementName") would result in the following:
< myElementName >
< co:applicationContext >
< co:factoryClass >String</co:factoryClass >
< co:url >http://www.xmlspy.com< /co:url >
< co:systemProperties >
< co:property >
< co:name >String< /co:name >
< co:value >String< /co:value >
< /co:property >
< /co:systemProperties >
< /co:applicationContext >
< co:applicationDN >String< /co:applicationDN >
< co:type >String< /co:type >
< primaryKey >String< /primaryKey >
< /myElementName >
toXml in interface XmlSerializerelementName - String the name of the element for this valueobject -
com.sun.management.oss.IllegalArgumentException - if the value is not of the proper type
java.lang.IllegalArgumentException - if the object is not of the proper type.
public java.lang.Object fromXml(org.w3c.dom.Element element)
throws java.lang.IllegalArgumentException
< ManagedEntity >Key
and that we have a DOM element representing the following
< key >
< co:applicationContext >
< co:factoryClass >String< /co:factoryClass >
< co:url >String< /co:url >
< co:systemProperties >
< co:property >
< co:name >String< /co:name >
< co:value >String< /co:value >
< /co:property >
< /co:systemProperties >
< /co:applicationContext >
< co:applicationDN >String< /co:applicationDN >
< co:type >String< /co:type >
< primaryKey >String< /primaryKey >
< /key >
then the returned object would be a < ManagedEntity >Key key populated
with the proper ApplicationContext, applicationDN, primaryKey
and type info
fromXml in interface XmlSerializerelement - org.w3c.dom.Element the subtree representing the serialized object
com.sun.management.oss.IllegalArgumentException - if an invalid dom element is passed
java.lang.IllegalArgumentException - if an invalid dom element is passed.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||