Riferimenti per la classe org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl

Diagramma delle classi per org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl

Inheritance graph
[legenda]
Diagramma di collaborazione per org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl:

Collaboration graph
[legenda]
Lista di tutti i membri.

Descrizione Dettagliata

Autore:
detro
JAXBMarshallerWrapperImpl wrappa il Marshaller e l'Unmarshaller per l'XML selezionato. Questa tecnica semplifica molto l'utilizzo della libreria JAXB, incapsulando tutte le operazioni necessarie per l'istanziazione di Marshaller e Unmarshaller.

Definizione alla linea 37 del file JAXBMarshallerWrapperImpl.java.

Membri pubblici

 JAXBMarshallerWrapperImpl (String packageName) throws JAXBMarshallerWrapperInitException
 Creates a new instance of JAXBMarshallerWrapperImpl.
String marshall (Object marshallable) throws JAXBMarshallerWrapperMarshallException
 Marshall di un XML Bindato con JAXB.
Object unmarshall (URL url) throws JAXBMarshallerWrapperUnmarshallException
 Unmarshall di un URL che si riferisce ad un XML in un XML JAXB Object.
Object unmarshall (File file) throws JAXBMarshallerWrapperUnmarshallException
 Unmarshall di un File XML in un XML JAXB Object.
Object unmarshall (InputStream inputStream) throws JAXBMarshallerWrapperUnmarshallException
 Unmarshall di un InputStream XML in un XML JAXB Object.
Object unmarshall (Source source) throws JAXBMarshallerWrapperUnmarshallException
Object unmarshall (String xmlString) throws JAXBMarshallerWrapperUnmarshallException
 Unmarshall di una Stringa in un XML JAXB Object.
void setFormattedMarshalling (boolean value) throws JAXBMarshallerWrapperMarshallException
 Attiva/Disattiva il Marshalling "formattato", cioe' con Indentazione dell'XML.
boolean isFormattedMarshalling ()
 Verifica se e' attivo il Marshalling formattato.

Attributi privati

final JAXBContext context
 JAXBContext.
final Marshaller marshaller
 Marshaller.
final Unmarshaller unmarshaller
 Marshaller.
boolean formattedMarshalling
 Formatted Mashalling Setting.

Attributi privati statici

static String exceptionPrefix = "[JAXBMarshallerWrapperImpl Exception]: "
 Prefisso Messaggio da inserire nelle Eccezioni lanciate.


Documentazione dei costruttori e dei distruttori

org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.JAXBMarshallerWrapperImpl String  packageName  )  throws JAXBMarshallerWrapperInitException
 

Creates a new instance of JAXBMarshallerWrapperImpl.

Parametri:
packageName Stringa del nome del package che contiene il file jaxb.properties relativo al particolare XSD
Eccezioni:
JAXBMarshallerWrapperUnmarshallException Se ci sono problemi durante l'istanziazione dei Marshaller

Definizione alla linea 58 del file JAXBMarshallerWrapperImpl.java.

Riferimenti org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.context, org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.exceptionPrefix, org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.marshaller, e org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.unmarshaller.

00059                                                   {
00060         
00061         try {
00062             // JAXBContext
00063             context = JAXBContext.newInstance(packageName);
00064             // Marshaller
00065             marshaller = context.createMarshaller();
00066             // Marshaller
00067             unmarshaller = context.createUnmarshaller();
00068         } catch (JAXBException e) {
00069             throw new JAXBMarshallerWrapperInitException(exceptionPrefix + e);
00070         } 
00071     }


Documentazione delle funzioni membro

boolean org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.isFormattedMarshalling  ) 
 

Verifica se e' attivo il Marshalling formattato.

Restituisce:
"true" se attivo, "false" altrimenti

Implementa org.jaebi.server.service.xml.JAXBMarshallerWrapper.

Definizione alla linea 169 del file JAXBMarshallerWrapperImpl.java.

Riferimenti org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.formattedMarshalling.

00169                                             {
00170         return formattedMarshalling;
00171     }

String org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.marshall Object  marshallable  )  throws JAXBMarshallerWrapperMarshallException
 

Marshall di un XML Bindato con JAXB.

Mashallare significa, in sostanza, "trasformare in Stringa", serializzando quindi l'Oggetto XML in una "forma" piu' comune e trasportabile.

Parametri:
marshallable Object XML marshallabile
Restituisce:
Stringa XML
Eccezioni:
JAXBMarshallerWrapperUnmarshallException 

Implementa org.jaebi.server.service.xml.JAXBMarshallerWrapper.

Definizione alla linea 73 del file JAXBMarshallerWrapperImpl.java.

Riferimenti org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.exceptionPrefix, e org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.marshaller.

00074                                                       {
00075         
00076         StringWriter writer = new StringWriter();
00077         
00078         try {
00079             marshaller.marshal(marshallable, writer);
00080         } catch (JAXBException e) {
00081             throw new JAXBMarshallerWrapperMarshallException(exceptionPrefix + e);
00082         }
00083         
00084         return writer.toString();
00085     }

void org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.setFormattedMarshalling boolean  value  )  throws JAXBMarshallerWrapperMarshallException
 

Attiva/Disattiva il Marshalling "formattato", cioe' con Indentazione dell'XML.

Parametri:
value "true" per attivare, "false" per disattivare
Eccezioni:
JAXBMarshallerWrapperUnmarshallException 

Implementa org.jaebi.server.service.xml.JAXBMarshallerWrapper.

Definizione alla linea 150 del file JAXBMarshallerWrapperImpl.java.

Riferimenti org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.exceptionPrefix, org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.formattedMarshalling, e org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.marshaller.

00151                                                       {
00152         
00153         formattedMarshalling = value;
00154         try {
00155             if ( formattedMarshalling ) {
00156                 /* XML Formatting Property Setting */
00157                 marshaller.setProperty(
00158                         Marshaller.JAXB_FORMATTED_OUTPUT, new Boolean("true"));
00159             } else {
00160                 /* XML Formatting Property Setting */
00161                 marshaller.setProperty(
00162                         Marshaller.JAXB_FORMATTED_OUTPUT, new Boolean("false"));
00163             }
00164         } catch ( JAXBException e ) {
00165             throw new JAXBMarshallerWrapperMarshallException(exceptionPrefix + e);
00166         }
00167     }

Object org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.unmarshall String  xmlString  )  throws JAXBMarshallerWrapperUnmarshallException
 

Unmarshall di una Stringa in un XML JAXB Object.

Converte in una struttura di oggetti JAXB una Stringa contenente XML.

Parametri:
xmlString Stringa contenente XML
Restituisce:
Object JAXB
Eccezioni:
JAXBMarshallerWrapperUnmarshallException 

Implementa org.jaebi.server.service.xml.JAXBMarshallerWrapper.

Definizione alla linea 139 del file JAXBMarshallerWrapperImpl.java.

Riferimenti org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.unmarshall().

00140                                                         {
00141         
00142         /* Creazione StringBuffer che useremo nell'unmarshalling.
00143          * L'interfaccia della classe Unmashaller non prevede un metodo
00144          * che prenda in input, direttamente, un oggetto String */
00145         StringBuffer xmlStr = new StringBuffer( xmlString );
00146         
00147         return unmarshall( new StreamSource( new StringReader( xmlStr.toString() ) ) );
00148     }

Questo è il grafo delle chiamate per questa funzione:

Object org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.unmarshall Source  source  )  throws JAXBMarshallerWrapperUnmarshallException
 

Implementa org.jaebi.server.service.xml.JAXBMarshallerWrapper.

Definizione alla linea 125 del file JAXBMarshallerWrapperImpl.java.

Riferimenti org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.exceptionPrefix, e org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.unmarshaller.

00126                                                         {
00127         
00128         Object xmlElement = null; 
00129         
00130         try {
00131             xmlElement = unmarshaller.unmarshal(source);
00132         } catch (JAXBException e) {
00133             throw new JAXBMarshallerWrapperUnmarshallException(exceptionPrefix + e);
00134         }
00135         
00136         return xmlElement;
00137     }

Object org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.unmarshall InputStream  inputStream  )  throws JAXBMarshallerWrapperUnmarshallException
 

Unmarshall di un InputStream XML in un XML JAXB Object.

Converte in una struttura di oggetti JAXB un InputStream contenente XML.

Parametri:
inputStream InputStream contenente XML
Restituisce:
Object JAXB
Eccezioni:
JAXBMarshallerWrapperUnmarshallException 

Implementa org.jaebi.server.service.xml.JAXBMarshallerWrapper.

Definizione alla linea 111 del file JAXBMarshallerWrapperImpl.java.

Riferimenti org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.exceptionPrefix, e org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.unmarshaller.

00112                                                         {
00113         
00114         Object xmlElement = null; 
00115         
00116         try {
00117             xmlElement = unmarshaller.unmarshal(inputStream);
00118         } catch (JAXBException e) {
00119             throw new JAXBMarshallerWrapperUnmarshallException(exceptionPrefix + e);
00120         }
00121         
00122         return xmlElement;
00123     }

Object org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.unmarshall File  file  )  throws JAXBMarshallerWrapperUnmarshallException
 

Unmarshall di un File XML in un XML JAXB Object.

Converte in una struttura di oggetti JAXB un File contenente XML.

Parametri:
file File contenente XML
Restituisce:
Object JAXB
Eccezioni:
JAXBMarshallerWrapperUnmarshallException 

Implementa org.jaebi.server.service.xml.JAXBMarshallerWrapper.

Definizione alla linea 99 del file JAXBMarshallerWrapperImpl.java.

Riferimenti org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.exceptionPrefix, e org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.unmarshaller.

00099                                                                                         {
00100         Object xmlElement = null; 
00101         
00102         try {
00103             xmlElement = unmarshaller.unmarshal(file);
00104         } catch (JAXBException e) {
00105             throw new JAXBMarshallerWrapperUnmarshallException(exceptionPrefix + e);
00106         }
00107         
00108         return xmlElement;
00109     }

Object org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.unmarshall URL  url  )  throws JAXBMarshallerWrapperUnmarshallException
 

Unmarshall di un URL che si riferisce ad un XML in un XML JAXB Object.

Converte in una struttura di oggetti JAXB un URL contenente XML.

Parametri:
url URL contenente XML
Restituisce:
Object JAXB
Eccezioni:
JAXBMarshallerWrapperUnmarshallException 

Implementa org.jaebi.server.service.xml.JAXBMarshallerWrapper.

Definizione alla linea 87 del file JAXBMarshallerWrapperImpl.java.

Riferimenti org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.exceptionPrefix, e org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.unmarshaller.

Referenziato da org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.unmarshall().

00087                                                                                       {
00088         Object xmlElement = null; 
00089         
00090         try {
00091             xmlElement = unmarshaller.unmarshal(url);
00092         } catch (JAXBException e) {
00093             throw new JAXBMarshallerWrapperUnmarshallException(exceptionPrefix + e);
00094         }
00095         
00096         return xmlElement;
00097     }


Documentazione dei dati membri

final JAXBContext org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.context [private]
 

JAXBContext.

Definizione alla linea 39 del file JAXBMarshallerWrapperImpl.java.

Referenziato da org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.JAXBMarshallerWrapperImpl().

String org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.exceptionPrefix = "[JAXBMarshallerWrapperImpl Exception]: " [static, private]
 

Prefisso Messaggio da inserire nelle Eccezioni lanciate.

Definizione alla linea 47 del file JAXBMarshallerWrapperImpl.java.

Referenziato da org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.JAXBMarshallerWrapperImpl(), org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.marshall(), org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.setFormattedMarshalling(), e org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.unmarshall().

boolean org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.formattedMarshalling [private]
 

Formatted Mashalling Setting.

Definizione alla linea 45 del file JAXBMarshallerWrapperImpl.java.

Referenziato da org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.isFormattedMarshalling(), e org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.setFormattedMarshalling().

final Marshaller org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.marshaller [private]
 

Marshaller.

Definizione alla linea 41 del file JAXBMarshallerWrapperImpl.java.

Referenziato da org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.JAXBMarshallerWrapperImpl(), org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.marshall(), e org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.setFormattedMarshalling().

final Unmarshaller org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.unmarshaller [private]
 

Marshaller.

Definizione alla linea 43 del file JAXBMarshallerWrapperImpl.java.

Referenziato da org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.JAXBMarshallerWrapperImpl(), e org.jaebi.server.service.xml.JAXBMarshallerWrapperImpl.unmarshall().


La documentazione per questa classe è stata generata a partire dal seguente file:
Generato il Mon Jun 27 22:50:53 2005 per JAEBI - JAva Enterprice BackEnd Interfacement da  doxygen 1.4.3