public SAXOutput(ContentHandler out) { this.out = out; out.setDocumentLocator(new LocatorImpl()); }
public BeanT createInstance(UnmarshallingContext context) throws IllegalAccessException, InvocationTargetException, InstantiationException, SAXException { BeanT bean = null; if (factoryMethod == null){ bean = ClassFactory.create0(jaxbType); }else { Object o = ClassFactory.create(factoryMethod); if( jaxbType.isInstance(o) ){ bean = (BeanT)o; } else { throw new InstantiationException("The factory method didn't return a correct object"); } } if(xmlLocatorField!=null) // need to copy because Locator is mutable try { xmlLocatorField.set(bean,new LocatorImpl(context.getLocator())); } catch (AccessorException e) { context.handleError(e); } return bean; }
LocatorImpl locator = new LocatorImpl();
SaxEvent(String namespaceURI, String localName, String qName, Locator locator) { this.namespaceURI = namespaceURI; this.localName = localName; this.qName = qName; // locator impl is used to take a snapshot! this.locator = new LocatorImpl(locator); }
public SAXOutput(ContentHandler out) { this.out = out; out.setDocumentLocator(new LocatorImpl()); }
@Override public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { super.startElement(uri, localName, qName, atts); // Keep snapshot of start location, // for later when end of element is found. locatorStack.push(new LocatorImpl(locator)); }
@Override public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { super.startElement(uri, localName, qName, atts); // Keep snapshot of start location, // for later when end of element is found. locatorStack.push(new LocatorImpl(locator)); }
@Override public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { super.startElement(uri, localName, qName, atts); // Keep snapshot of start location, // for later when end of element is found. locatorStack.push(new LocatorImpl(locator)); }
public BeanT createInstance(UnmarshallingContext context) throws IllegalAccessException, InvocationTargetException, InstantiationException, SAXException { BeanT bean = null; if (factoryMethod == null){ bean = ClassFactory.create0(jaxbType); }else { Object o = ClassFactory.create(factoryMethod); if( jaxbType.isInstance(o) ){ bean = (BeanT)o; } else { throw new InstantiationException("The factory method didn't return a correct object"); } } if(xmlLocatorField!=null) // need to copy because Locator is mutable try { xmlLocatorField.set(bean,new LocatorImpl(context.getLocator())); } catch (AccessorException e) { context.handleError(e); } return bean; }
LocatorImpl locator = new LocatorImpl();
SaxEvent(String namespaceURI, String localName, String qName, Locator locator) { this.namespaceURI = namespaceURI; this.localName = localName; this.qName = qName; // locator impl is used to take a snapshot! this.locator = new LocatorImpl(locator); }
void noteDefined(Locator locator) { defined = true; if (whereDefined == null && locator != null) whereDefined = new LocatorImpl(locator); }
KeyValue( Object[] values, Locator loc ) { this.values = values; if(loc==null) this.locator = null; else this.locator = new LocatorImpl(loc); }
/** memorize a reference to an object. */ public void memorizeLink( Object target ) { ArrayList list; if( impl.containsKey(target) ) list = (ArrayList)impl.get(target); else { // new target. list = new ArrayList(); impl.put(target,list); } list.add(new LocatorImpl(locator)); }
protected Expression resolveAttPoolRef( String namespace, String label ) { if( namespace!=null ) return new ExternalAttributeExp(pool,namespace,label,new LocatorImpl(locator)); else return super.resolveAttPoolRef(namespace,label); }
@Override public void startElement(String uri, String localName, String qName, Attributes atts) throws SAXException { super.startElement(uri, localName, qName, atts); // Keep snapshot of start location, // for later when end of element is found. locatorStack.push(new LocatorImpl(locator)); }
private ExternalElementExp getExtElementExp( String namespace, String label ) { StringPair name = new StringPair(namespace,label); ExternalElementExp exp = (ExternalElementExp)externalElementExps.get(name); if( exp!=null ) return exp; exp = new ExternalElementExp( pool, namespace, label, new LocatorImpl(locator) ); externalElementExps.put( name, exp ); return exp; }
protected Expression resolveAttPoolRef( String namespace, String label ) { if( namespace!=null ) return new ExternalAttributeExp(pool,namespace,label,new LocatorImpl(locator)); else return super.resolveAttPoolRef(namespace,label); }
private Expression resolveRef( String namespace, String label, String tagName ) { if( namespace==null ) { reportError( ERR_MISSING_ATTRIBUTE, tagName, "namespace" ); return Expression.nullSet; } return new ExternalElementExp( pool, namespace, label, new LocatorImpl(locator) ); }
public final @NotNull Locator getLocation() { LocatorImpl loc = new LocatorImpl(); loc.setSystemId(systemId); loc.setLineNumber(lineNumber); return loc; } }