public static void reportError(String msg, Exception nested, boolean canRecover) throws SAXException { UnmarshallingContext context = UnmarshallingContext.getInstance(); context.handleEvent( new ValidationEventImpl( canRecover? ValidationEvent.ERROR : ValidationEvent.FATAL_ERROR, msg, context.getLocator().getLocation(), nested ), canRecover ); }
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; }
/** * Based on current {@link Logger} {@link Level} and errorCounter value determines if error should be reported. * * If the method called and return true it is expected that error will be reported. And that's why * errorCounter is automatically decremented during the check. * * NOT THREAD SAFE!!! In case of heave concurrency access several additional errors could be reported. It's not expected to be the * problem. Otherwise add synchronization here. * * @return true in case if {@link Level#FINEST} is set OR we haven't exceed errors reporting limit. */ public boolean shouldErrorBeReported() throws SAXException { if (logger.isLoggable(Level.FINEST)) return true; if (errorsCounter >= 0) { --errorsCounter; if (errorsCounter == 0) // it's possible to miss this because of concurrency. If required add synchronization here handleEvent(new ValidationEventImpl(ValidationEvent.WARNING, Messages.ERRORS_LIMIT_EXCEEDED.format(), getLocator().getLocation(), null), true); } return errorsCounter >= 0; } }
if(callable==null) { context.errorUnresolvedIDREF(bean,idref,context.getLocator()); return; } else { final LocatorEx loc = new LocatorEx.Snapshot(context.getLocator()); context.addPatcher(new Patcher() { public void run() throws SAXException {
/** * Based on current {@link Logger} {@link Level} and errorCounter value determines if error should be reported. * * If the method called and return true it is expected that error will be reported. And that's why * errorCounter is automatically decremented during the check. * * NOT THREAD SAFE!!! In case of heave concurrency access several additional errors could be reported. It's not expected to be the * problem. Otherwise add synchronization here. * * @return true in case if {@link Level#FINEST} is set OR we haven't exceed errors reporting limit. */ public boolean shouldErrorBeReported() throws SAXException { if (logger.isLoggable(Level.FINEST)) return true; if (errorsCounter >= 0) { --errorsCounter; if (errorsCounter == 0) // it's possible to miss this because of concurrency. If required add synchronization here handleEvent(new ValidationEventImpl(ValidationEvent.WARNING, Messages.ERRORS_LIMIT_EXCEEDED.format(), getLocator().getLocation(), null), true); } return errorsCounter >= 0; } }
public static void reportError(String msg, Exception nested, boolean canRecover) throws SAXException { UnmarshallingContext context = UnmarshallingContext.getInstance(); context.handleEvent( new ValidationEventImpl( canRecover? ValidationEvent.ERROR : ValidationEvent.FATAL_ERROR, msg, context.getLocator().getLocation(), nested ), canRecover ); }
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; }
if(callable==null) { context.errorUnresolvedIDREF(bean,idref,context.getLocator()); return; } else { final LocatorEx loc = new LocatorEx.Snapshot(context.getLocator()); context.addPatcher(new Patcher() { public void run() throws SAXException {
public static void reportError(String msg, Exception nested, boolean canRecover) throws SAXException { UnmarshallingContext context = UnmarshallingContext.getInstance(); context.handleEvent( new ValidationEventImpl( canRecover? ValidationEvent.ERROR : ValidationEvent.FATAL_ERROR, msg, context.getLocator().getLocation(), nested ), canRecover ); }
public static void reportError(String msg, Exception nested, boolean canRecover) throws SAXException { UnmarshallingContext context = UnmarshallingContext.getInstance(); context.handleEvent( new ValidationEventImpl( canRecover? ValidationEvent.ERROR : ValidationEvent.FATAL_ERROR, msg, context.getLocator().getLocation(), nested ), canRecover ); }
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; }
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; }
/** * Based on current {@link Logger} {@link Level} and errorCounter value determines if error should be reported. * * If the method called and return true it is expected that error will be reported. And that's why * errorCounter is automatically decremented during the check. * * NOT THREAD SAFE!!! In case of heave concurrency access several additional errors could be reported. It's not expected to be the * problem. Otherwise add synchronization here. * * @return true in case if {@link Level#FINEST} is set OR we haven't exceed errors reporting limit. */ public boolean shouldErrorBeReported() throws SAXException { if (logger.isLoggable(Level.FINEST)) return true; if (errorsCounter >= 0) { --errorsCounter; if (errorsCounter == 0) // it's possible to miss this because of concurrency. If required add synchronization here handleEvent(new ValidationEventImpl(ValidationEvent.WARNING, Messages.ERRORS_LIMIT_EXCEEDED.format(), getLocator().getLocation(), null), true); } return errorsCounter >= 0; } }
/** * Based on current {@link Logger} {@link Level} and errorCounter value determines if error should be reported. * * If the method called and return true it is expected that error will be reported. And that's why * errorCounter is automatically decremented during the check. * * NOT THREAD SAFE!!! In case of heave concurrency access several additional errors could be reported. It's not expected to be the * problem. Otherwise add synchronization here. * * @return true in case if {@link Level#FINEST} is set OR we haven't exceed errors reporting limit. */ public boolean shouldErrorBeReported() throws SAXException { if (logger.isLoggable(Level.FINEST)) return true; if (errorsCounter >= 0) { --errorsCounter; if (errorsCounter == 0) // it's possible to miss this because of concurrency. If required add synchronization here handleEvent(new ValidationEventImpl(ValidationEvent.WARNING, Messages.ERRORS_LIMIT_EXCEEDED.format(), getLocator().getLocation(), null), true); } return errorsCounter >= 0; } }
if(callable==null) { context.errorUnresolvedIDREF(bean,idref,context.getLocator()); return; } else { final LocatorEx loc = new LocatorEx.Snapshot(context.getLocator()); context.addPatcher(new Patcher() { public void run() throws SAXException {
if(callable==null) { context.errorUnresolvedIDREF(bean,idref,context.getLocator()); return; } else { final LocatorEx loc = new LocatorEx.Snapshot(context.getLocator()); context.addPatcher(new Patcher() { public void run() throws SAXException {