private SAXConnector getUnmarshallerHandler( boolean intern, JaxBeanInfo expectedType ) { XmlVisitor h = createUnmarshallerHandler(null, false, expectedType); if (intern) { h = new InterningXmlVisitor(h); } return new SAXConnector(h,null); }
visitor = new InterningXmlVisitor(visitor);
private Object unmarshal0(XMLEventReader reader,JaxBeanInfo expectedType) throws JAXBException { if (reader == null) { throw new IllegalArgumentException( Messages.format(Messages.NULL_READER)); } try { XMLEvent event = reader.peek(); if (!event.isStartElement() && !event.isStartDocument()) { // TODO: convert event into event name throw new IllegalStateException( Messages.format( Messages.ILLEGAL_READER_STATE,event.getEventType())); } // Quick hack until SJSXP fixes 6270116 boolean isZephyr = reader.getClass().getName().equals("com.sun.xml.stream.XMLReaderImpl"); XmlVisitor h = createUnmarshallerHandler(null,false,expectedType); if(!isZephyr) { h = new InterningXmlVisitor(h); } new StAXEventConnector(reader,h).bridge(); return h.getContext().getResult(); } catch (XMLStreamException e) { throw handleStreamException(e); } }
public final Object unmarshal0( Node node, JaxBeanInfo expectedType ) throws JAXBException { try { final DOMScanner scanner = new DOMScanner(); InterningXmlVisitor handler = new InterningXmlVisitor(createUnmarshallerHandler(null,false,expectedType)); scanner.setContentHandler(new SAXConnector(handler,scanner)); if(node.getNodeType() == Node.ELEMENT_NODE) { scanner.scan((Element)node); } else if(node.getNodeType() == Node.DOCUMENT_NODE) { scanner.scan((Document)node); } else { throw new IllegalArgumentException("Unexpected node type: "+node); } Object retVal = handler.getContext().getResult(); handler.getContext().clearResult(); return retVal; } catch( SAXException e ) { throw createUnmarshalException(e); } }
private Object associativeUnmarshal(XmlNode xmlNode, boolean inplace, Class expectedType) throws JAXBException { if (xmlNode == null) throw new IllegalArgumentException(); JaxBeanInfo bi = null; if(expectedType!=null) bi = context.getBeanInfo(expectedType, true); InterningXmlVisitor handler = new InterningXmlVisitor( getUnmarshaller().createUnmarshallerHandler(scanner,inplace,bi)); scanner.setContentHandler(new SAXConnector(handler,scanner.getLocator())); try { scanner.scan(xmlNode); } catch( SAXException e ) { throw unmarshaller.createUnmarshalException(e); } return handler.getContext().getResult(); }
private SAXConnector getUnmarshallerHandler( boolean intern, JaxBeanInfo expectedType ) { XmlVisitor h = createUnmarshallerHandler(null, false, expectedType); if (intern) { h = new InterningXmlVisitor(h); } return new SAXConnector(h,null); }
visitor = new InterningXmlVisitor(visitor);
private Object unmarshal0(XMLEventReader reader,JaxBeanInfo expectedType) throws JAXBException { if (reader == null) { throw new IllegalArgumentException( Messages.format(Messages.NULL_READER)); } try { XMLEvent event = reader.peek(); if (!event.isStartElement() && !event.isStartDocument()) { // TODO: convert event into event name throw new IllegalStateException( Messages.format( Messages.ILLEGAL_READER_STATE,event.getEventType())); } // Quick hack until SJSXP fixes 6270116 boolean isZephyr = reader.getClass().getName().equals("com.sun.xml.stream.XMLReaderImpl"); XmlVisitor h = createUnmarshallerHandler(null,false,expectedType); if(!isZephyr) { h = new InterningXmlVisitor(h); } new StAXEventConnector(reader,h).bridge(); return h.getContext().getResult(); } catch (XMLStreamException e) { throw handleStreamException(e); } }
public final Object unmarshal0( Node node, JaxBeanInfo expectedType ) throws JAXBException { try { final DOMScanner scanner = new DOMScanner(); InterningXmlVisitor handler = new InterningXmlVisitor(createUnmarshallerHandler(null,false,expectedType)); scanner.setContentHandler(new SAXConnector(handler,scanner)); if(node.getNodeType() == Node.ELEMENT_NODE) { scanner.scan((Element)node); } else if(node.getNodeType() == Node.DOCUMENT_NODE) { scanner.scan((Document)node); } else { throw new IllegalArgumentException("Unexpected node type: "+node); } Object retVal = handler.getContext().getResult(); handler.getContext().clearResult(); return retVal; } catch( SAXException e ) { throw createUnmarshalException(e); } }
private Object associativeUnmarshal(XmlNode xmlNode, boolean inplace, Class expectedType) throws JAXBException { if (xmlNode == null) throw new IllegalArgumentException(); JaxBeanInfo bi = null; if(expectedType!=null) bi = context.getBeanInfo(expectedType, true); InterningXmlVisitor handler = new InterningXmlVisitor( getUnmarshaller().createUnmarshallerHandler(scanner,inplace,bi)); scanner.setContentHandler(new SAXConnector(handler,scanner.getLocator())); try { scanner.scan(xmlNode); } catch( SAXException e ) { throw unmarshaller.createUnmarshalException(e); } return handler.getContext().getResult(); }
private SAXConnector getUnmarshallerHandler( boolean intern, JaxBeanInfo expectedType ) { XmlVisitor h = createUnmarshallerHandler(null, false, expectedType); if (intern) { h = new InterningXmlVisitor(h); } return new SAXConnector(h,null); }
private SAXConnector getUnmarshallerHandler( boolean intern, JaxBeanInfo expectedType ) { XmlVisitor h = createUnmarshallerHandler(null, false, expectedType); if (intern) { h = new InterningXmlVisitor(h); } return new SAXConnector(h,null); }
visitor = new InterningXmlVisitor(visitor);
visitor = new InterningXmlVisitor(visitor);
private Object unmarshal0(XMLEventReader reader,JaxBeanInfo expectedType) throws JAXBException { if (reader == null) { throw new IllegalArgumentException( Messages.format(Messages.NULL_READER)); } try { XMLEvent event = reader.peek(); if (!event.isStartElement() && !event.isStartDocument()) { // TODO: convert event into event name throw new IllegalStateException( Messages.format( Messages.ILLEGAL_READER_STATE,event.getEventType())); } // Quick hack until SJSXP fixes 6270116 boolean isZephyr = reader.getClass().getName().equals("com.sun.xml.stream.XMLReaderImpl"); XmlVisitor h = createUnmarshallerHandler(null,false,expectedType); if(!isZephyr) { h = new InterningXmlVisitor(h); } new StAXEventConnector(reader,h).bridge(); return h.getContext().getResult(); } catch (XMLStreamException e) { throw handleStreamException(e); } }
private Object unmarshal0(XMLEventReader reader,JaxBeanInfo expectedType) throws JAXBException { if (reader == null) { throw new IllegalArgumentException( Messages.format(Messages.NULL_READER)); } try { XMLEvent event = reader.peek(); if (!event.isStartElement() && !event.isStartDocument()) { // TODO: convert event into event name throw new IllegalStateException( Messages.format( Messages.ILLEGAL_READER_STATE,event.getEventType())); } // Quick hack until SJSXP fixes 6270116 boolean isZephyr = reader.getClass().getName().equals("com.sun.xml.stream.XMLReaderImpl"); XmlVisitor h = createUnmarshallerHandler(null,false,expectedType); if(!isZephyr) { h = new InterningXmlVisitor(h); } new StAXEventConnector(reader,h).bridge(); return h.getContext().getResult(); } catch (XMLStreamException e) { throw handleStreamException(e); } }
public final Object unmarshal0( Node node, JaxBeanInfo expectedType ) throws JAXBException { try { final DOMScanner scanner = new DOMScanner(); InterningXmlVisitor handler = new InterningXmlVisitor(createUnmarshallerHandler(null,false,expectedType)); scanner.setContentHandler(new SAXConnector(handler,scanner)); if(node.getNodeType() == Node.ELEMENT_NODE) { scanner.scan((Element)node); } else if(node.getNodeType() == Node.DOCUMENT_NODE) { scanner.scan((Document)node); } else { throw new IllegalArgumentException("Unexpected node type: "+node); } Object retVal = handler.getContext().getResult(); handler.getContext().clearResult(); return retVal; } catch( SAXException e ) { throw createUnmarshalException(e); } }
public final Object unmarshal0( Node node, JaxBeanInfo expectedType ) throws JAXBException { try { final DOMScanner scanner = new DOMScanner(); InterningXmlVisitor handler = new InterningXmlVisitor(createUnmarshallerHandler(null,false,expectedType)); scanner.setContentHandler(new SAXConnector(handler,scanner)); if(node.getNodeType() == Node.ELEMENT_NODE) { scanner.scan((Element)node); } else if(node.getNodeType() == Node.DOCUMENT_NODE) { scanner.scan((Document)node); } else { throw new IllegalArgumentException("Unexpected node type: "+node); } Object retVal = handler.getContext().getResult(); handler.getContext().clearResult(); return retVal; } catch( SAXException e ) { throw createUnmarshalException(e); } }
private Object associativeUnmarshal(XmlNode xmlNode, boolean inplace, Class expectedType) throws JAXBException { if (xmlNode == null) throw new IllegalArgumentException(); JaxBeanInfo bi = null; if(expectedType!=null) bi = context.getBeanInfo(expectedType, true); InterningXmlVisitor handler = new InterningXmlVisitor( getUnmarshaller().createUnmarshallerHandler(scanner,inplace,bi)); scanner.setContentHandler(new SAXConnector(handler,scanner.getLocator())); try { scanner.scan(xmlNode); } catch( SAXException e ) { throw unmarshaller.createUnmarshalException(e); } return handler.getContext().getResult(); }
private Object associativeUnmarshal(XmlNode xmlNode, boolean inplace, Class expectedType) throws JAXBException { if (xmlNode == null) throw new IllegalArgumentException(); JaxBeanInfo bi = null; if(expectedType!=null) bi = context.getBeanInfo(expectedType, true); InterningXmlVisitor handler = new InterningXmlVisitor( getUnmarshaller().createUnmarshallerHandler(scanner,inplace,bi)); scanner.setContentHandler(new SAXConnector(handler,scanner.getLocator())); try { scanner.scan(xmlNode); } catch( SAXException e ) { throw unmarshaller.createUnmarshalException(e); } return handler.getContext().getResult(); }