Java Doc for XMLSerializer.java in  » Portal » stringbeans-3.5 » com » nabhinc » portal » config » impl » runtime » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Portal » stringbeans 3.5 » com.nabhinc.portal.config.impl.runtime 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


com.nabhinc.portal.config.impl.runtime.XMLSerializer

All known Subclasses:   com.nabhinc.portal.config.impl.runtime.SAXMarshaller,  com.nabhinc.portal.config.impl.runtime.MSVValidator,
XMLSerializer
public interface XMLSerializer (Code)
Receives XML serialization event

This object coordinates the overall marshalling efforts across different content-tree objects and different target formats.

The following CFG gives the proper sequence of method invocation.

 MARSHALLING  :=  ELEMENT
 ELEMENT      :=  "startElement" NSDECL* "endNamespaceDecls"
 ATTRIBUTE* "endAttributes" BODY "endElement"
 NSDECL       :=  "declareNamespace"
 ATTRIBUTE    :=  "startAttribute" ATTVALUES "endAttribute"
 ATTVALUES    :=  "text"*
 BODY         :=  ( "text" | ELEMENT )*
 

A marshalling of one element consists of two stages. The first stage is for marshalling attributes and collecting namespace declarations. The second stage is for marshalling characters/child elements of that element.

Observe that multiple invocation of "text" is allowed.

Also observe that the namespace declarations are allowed only between "startElement" and "endAttributes".
author:
   Kohsuke Kawaguchi





Method Summary
 voidchildAsAttributes(JAXBObject o, String fieldName)
     This method is called when an JAXBObject object is found while the marshaller is in the "attribute" mode (i.e.
 voidchildAsBody(JAXBObject o, String fieldName)
     This method is called when an JAXBObject object is found while the marshaller is in the "element" mode (i.e.
 voidchildAsURIs(JAXBObject o, String fieldName)
     This method is called when an JAXBObject object is found while the marshaller is in the "URI" mode.
Parameters:
  fieldName - property name of the parent objeect from which 'o' comes.Used as a part of the error message in case anything goes wrongwith 'o'.
 voidendAttribute()
    
 voidendAttributes()
     Switches to the mode to marshal child texts/elements.
 voidendElement()
     Ends marshalling of an element.
 voidendNamespaceDecls()
     Switches to the mode to marshal attribute values.
 NamespaceContext2getNamespaceContext()
     Obtains a namespace context object, which is used to declare/obtain namespace bindings.
 StringonID(IdentifiableObject owner, String value)
     Notifies the serializer that an ID value has just marshalled.
 StringonIDREF(IdentifiableObject obj)
     Notifies the serializer that an IDREF value has just marshalled.
 voidreportError(ValidationEvent e)
     Errors detected by the XMLSerializable should be either thrown as SAXException or reported through this method.
 voidstartAttribute(String uri, String local)
     Starts marshalling of an attribute.
 voidstartElement(String uri, String local)
     Starts marshalling of an element.
 voidtext(String text, String fieldName)
     Marshalls text.

This method can be called (i) after the startAttribute method and (ii) before the endAttribute method, to marshal attribute values. If the method is called more than once, those texts are considered as separated by whitespaces.




Method Detail
childAsAttributes
void childAsAttributes(JAXBObject o, String fieldName) throws SAXException(Code)
This method is called when an JAXBObject object is found while the marshaller is in the "attribute" mode (i.e. marshalling attributes of an element)
Parameters:
  fieldName - property name of the parent objeect from which 'o' comes.Used as a part of the error message in case anything goes wrongwith 'o'.



childAsBody
void childAsBody(JAXBObject o, String fieldName) throws SAXException(Code)
This method is called when an JAXBObject object is found while the marshaller is in the "element" mode (i.e. marshalling a content model of an element)
Parameters:
  fieldName - property name of the parent objeect from which 'o' comes.Used as a part of the error message in case anything goes wrongwith 'o'.



childAsURIs
void childAsURIs(JAXBObject o, String fieldName) throws SAXException(Code)
This method is called when an JAXBObject object is found while the marshaller is in the "URI" mode.
Parameters:
  fieldName - property name of the parent objeect from which 'o' comes.Used as a part of the error message in case anything goes wrongwith 'o'.



endAttribute
void endAttribute() throws SAXException(Code)



endAttributes
void endAttributes() throws SAXException(Code)
Switches to the mode to marshal child texts/elements. This method has to be called after the 2nd pass is completed.



endElement
void endElement() throws SAXException(Code)
Ends marshalling of an element. Pops the internal stack.



endNamespaceDecls
void endNamespaceDecls() throws SAXException(Code)
Switches to the mode to marshal attribute values. This method has to be called after the 1st pass is completed.



getNamespaceContext
NamespaceContext2 getNamespaceContext()(Code)
Obtains a namespace context object, which is used to declare/obtain namespace bindings.



onID
String onID(IdentifiableObject owner, String value) throws SAXException(Code)
Notifies the serializer that an ID value has just marshalled. The serializer may or may not check the consistency of ID/IDREFs and may throw a SAXException.
Parameters:
  owner - JAXB content object that posesses the ID.
Parameters:
  value - The value of the ID.Return the value parameter without any modification,so that the invocation of this method can be done transparentlyby a transducer.



onIDREF
String onIDREF(IdentifiableObject obj) throws SAXException(Code)
Notifies the serializer that an IDREF value has just marshalled. The serializer may or may not check the consistency of ID/IDREFs and may throw a SAXException. Return the value parameter without any modification.so that the invocation of this method can be done transparentlyby a transducer.



reportError
void reportError(ValidationEvent e) throws AbortSerializationException(Code)
Errors detected by the XMLSerializable should be either thrown as SAXException or reported through this method. The callee should report an error to the client application and



startAttribute
void startAttribute(String uri, String local) throws SAXException(Code)
Starts marshalling of an attribute. The marshalling of an attribute will be done by
  1. call the startAttribute method
  2. call the text method (several times if necessary)
  3. call the endAttribute method
No two attributes can be marshalled at the same time. Note that the whole attribute marshalling must be happened after the startElement method and before the endAttributes method.



startElement
void startElement(String uri, String local) throws SAXException(Code)
Starts marshalling of an element. Calling this method will push the internal state into the internal stack.



text
void text(String text, String fieldName) throws SAXException(Code)
Marshalls text.

This method can be called (i) after the startAttribute method and (ii) before the endAttribute method, to marshal attribute values. If the method is called more than once, those texts are considered as separated by whitespaces. For example,

 c.startAttribute();
 c.text("abc");
 c.text("def");
 c.endAttribute("","foo");
 
will generate foo="abc def".

Similarly, this method can be called after the endAttributes method to marshal texts inside elements. The same rule about multiple invokations apply to this case, too. For example,

 c.startElement("","foo");
 c.endNamespaceDecls();
 c.endAttributes();
 c.text("abc");
 c.text("def");
 c.startElement("","bar");
 c.endAttributes();
 c.endElement();
 c.text("ghi");
 c.endElement();
 
will generate <foo>abc def<bar/>ghi</foo>.



www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.