public static JAXBException invalidElementWrapper(String propertyName) { Object[] args = { propertyName }; JAXBException exception = new JAXBException(ExceptionMessageGenerator.buildMessage(JAXBException.class, INVALID_XML_ELEMENT_WRAPPER, args)); exception.setErrorCode(INVALID_XML_ELEMENT_WRAPPER); return exception; }
throw org.eclipse.persistence.exceptions.JAXBException.multipleAnyAttributeMapping(cls.getName()); throw org.eclipse.persistence.exceptions.JAXBException.anyAttributeOnNonMap(property.getPropertyName()); throw JAXBException.invalidList(property.getPropertyName()); if (helper.isAnnotationPresent(elem, XmlLocation.class) || helper.isAnnotationPresent(elem, CompilerHelper.XML_LOCATION_ANNOTATION_CLASS) || helper.isAnnotationPresent(elem, CompilerHelper.INTERNAL_XML_LOCATION_ANNOTATION_CLASS)) { if (!helper.getJavaClass(Constants.LOCATOR_CLASS).isAssignableFrom(property.getType())) { throw JAXBException.invalidXmlLocation(property.getPropertyName(), property.getType().getName());
throw JAXBException.adapterClassNotLoaded(getXmlAdapterClassName(), e); throw JAXBException.invalidAdapterClass(getXmlAdapterClassName()); throw JAXBException.adapterClassCouldNotBeInstantiated(getXmlAdapterClassName(), ex);
descriptorCustomizer.customize((XMLDescriptor)tInfo.getDescriptor()); } catch (IllegalAccessException iae) { throw JAXBException.couldNotCreateCustomizerInstance(iae, customizerClassName); } catch (InstantiationException ie) { throw JAXBException.couldNotCreateCustomizerInstance(ie, customizerClassName); } catch (ClassCastException cce) { throw JAXBException.invalidCustomizerClass(cce, customizerClassName); } catch (ClassNotFoundException cnfe) { throw JAXBException.couldNotCreateCustomizerInstance(cnfe, customizerClassName);
public JavaClass getClass(String className) { try { if (className.contains("[")) { Class clazz = Class.forName(className); if (clazz != null) { return getClass(clazz); } } Class clazz = this.classLoader.loadClass(className); return getClass(clazz); } catch(ClassNotFoundException e) { throw JAXBException.classNotFoundException(className); } }
/** * Unsupported Operation. DynamicJAXBConexts can not be created from concrete classes. Use the standard * JAXBContext to create a context from existing Classes. * * @see org.eclipse.persistence.jaxb.JAXBContext */ public static DynamicJAXBContext createContext(Class<?>[] classes, Map<String, Object> properties) throws JAXBException { throw new JAXBException(org.eclipse.persistence.exceptions.JAXBException.cannotCreateDynamicContextFromClasses()); }
public void initialize(DatabaseMapping mapping, Session session) { try { ConversionManager cMgr = session.getDatasourcePlatform().getConversionManager(); Class<? extends DomHandler> domHandlerClass = PrivilegedAccessHelper.getClassForName(domHandlerClassName, true, cMgr.getLoader()); Constructor cons = PrivilegedAccessHelper.getDeclaredConstructorFor(domHandlerClass, new Class[]{}, true); this.domHandler = (DomHandler)PrivilegedAccessHelper.invokeConstructor(cons, new Object[]{}); Method createUnmarshallerMethod = PrivilegedAccessHelper.getDeclaredMethod(domHandlerClass, "createUnmarshaller", new Class[]{ValidationEventHandler.class}); resultType = PrivilegedAccessHelper.getMethodReturnType(createUnmarshallerMethod); Method getElementMethod = PrivilegedAccessHelper.getDeclaredMethod(domHandlerClass, "getElement", new Class[]{resultType}); elementClass = PrivilegedAccessHelper.getMethodReturnType(getElementMethod); xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform(); } catch(Exception ex) { throw JAXBException.couldNotInitializeDomHandlerConverter(ex, domHandlerClassName, mapping.getAttributeName()); } }
/** * The method will load the eclipselink metadata model and return the * corresponding JAXBContext */ public static JAXBContext getXmlBindingsModelContext() { if (xmlBindingsModelContext == null) { try { xmlBindingsModelContext = (JAXBContext) JAXBContextFactory.createContext(METADATA_MODEL_PACKAGE,CompilerHelper.class.getClassLoader()); } catch (JAXBException e) { throw org.eclipse.persistence.exceptions.JAXBException.couldNotCreateContextForXmlModel(e); } if (xmlBindingsModelContext == null) { throw org.eclipse.persistence.exceptions.JAXBException.couldNotCreateContextForXmlModel(); } } return xmlBindingsModelContext; }
oldProperty.setType(pType); } else { throw org.eclipse.persistence.exceptions.JAXBException.anyAttributeOnNonMap(oldProperty.getPropertyName());
throw org.eclipse.persistence.exceptions.JAXBException.multipleAnyAttributeMapping(cls.getName()); throw org.eclipse.persistence.exceptions.JAXBException.anyAttributeOnNonMap(property.getPropertyName()); throw JAXBException.invalidList(property.getPropertyName()); if (helper.isAnnotationPresent(elem, XmlLocation.class) || helper.isAnnotationPresent(elem, CompilerHelper.XML_LOCATION_ANNOTATION_CLASS) || helper.isAnnotationPresent(elem, CompilerHelper.INTERNAL_XML_LOCATION_ANNOTATION_CLASS)) { if (!helper.getJavaClass(Constants.LOCATOR_CLASS).isAssignableFrom(property.getType())) { throw JAXBException.invalidXmlLocation(property.getPropertyName(), property.getType().getName());
throw JAXBException.adapterClassNotLoaded(getXmlAdapterClassName(), e); throw JAXBException.invalidAdapterClass(getXmlAdapterClassName()); throw JAXBException.adapterClassCouldNotBeInstantiated(getXmlAdapterClassName(), ex);
descriptorCustomizer.customize((XMLDescriptor)tInfo.getDescriptor()); } catch (IllegalAccessException iae) { throw JAXBException.couldNotCreateCustomizerInstance(iae, customizerClassName); } catch (InstantiationException ie) { throw JAXBException.couldNotCreateCustomizerInstance(ie, customizerClassName); } catch (ClassCastException cce) { throw JAXBException.invalidCustomizerClass(cce, customizerClassName); } catch (ClassNotFoundException cnfe) { throw JAXBException.couldNotCreateCustomizerInstance(cnfe, customizerClassName);
public JavaClass getClass(String className) { try { if (className.contains("[")) { Class clazz = Class.forName(className); if (clazz != null) { return getClass(clazz); } } Class clazz = this.classLoader.loadClass(className); return getClass(clazz); } catch(ClassNotFoundException e) { throw JAXBException.classNotFoundException(className); } }
/** * Unsupported Operation. DynamicJAXBConexts can not be created from concrete classes. Use the standard * JAXBContext to create a context from existing Classes. * * @see org.eclipse.persistence.jaxb.JAXBContext */ public static DynamicJAXBContext createContext(Class<?>[] classes, Map<String, Object> properties) throws JAXBException { throw new JAXBException(org.eclipse.persistence.exceptions.JAXBException.cannotCreateDynamicContextFromClasses()); }
public void initialize(DatabaseMapping mapping, Session session) { try { ConversionManager cMgr = session.getDatasourcePlatform().getConversionManager(); Class<? extends DomHandler> domHandlerClass = PrivilegedAccessHelper.getClassForName(domHandlerClassName, true, cMgr.getLoader()); Constructor cons = PrivilegedAccessHelper.getDeclaredConstructorFor(domHandlerClass, new Class[]{}, true); this.domHandler = (DomHandler)PrivilegedAccessHelper.invokeConstructor(cons, new Object[]{}); Method createUnmarshallerMethod = PrivilegedAccessHelper.getDeclaredMethod(domHandlerClass, "createUnmarshaller", new Class[]{ValidationEventHandler.class}); resultType = PrivilegedAccessHelper.getMethodReturnType(createUnmarshallerMethod); Method getElementMethod = PrivilegedAccessHelper.getDeclaredMethod(domHandlerClass, "getElement", new Class[]{resultType}); elementClass = PrivilegedAccessHelper.getMethodReturnType(getElementMethod); xmlPlatform = XMLPlatformFactory.getInstance().getXMLPlatform(); } catch(Exception ex) { throw JAXBException.couldNotInitializeDomHandlerConverter(ex, domHandlerClassName, mapping.getAttributeName()); } }
/** * The method will load the eclipselink metadata model and return the * corresponding JAXBContext */ public static JAXBContext getXmlBindingsModelContext() { if (xmlBindingsModelContext == null) { try { xmlBindingsModelContext = (JAXBContext) JAXBContextFactory.createContext(METADATA_MODEL_PACKAGE,CompilerHelper.class.getClassLoader()); } catch (JAXBException e) { throw org.eclipse.persistence.exceptions.JAXBException.couldNotCreateContextForXmlModel(e); } if (xmlBindingsModelContext == null) { throw org.eclipse.persistence.exceptions.JAXBException.couldNotCreateContextForXmlModel(); } } return xmlBindingsModelContext; }
oldProperty.setType(pType); } else { throw org.eclipse.persistence.exceptions.JAXBException.anyAttributeOnNonMap(oldProperty.getPropertyName());
public static JAXBException invalidList(String propertyName) { Object[] args = { propertyName }; JAXBException exception = new JAXBException(ExceptionMessageGenerator.buildMessage(JAXBException.class, INVALID_LIST, args)); exception.setErrorCode(INVALID_LIST); return exception; }
declaredClass = AccessController.doPrivileged(new PrivilegedClassForName(componentType.getRawName(), false, helper.getClassLoader())); } catch (PrivilegedActionException exception) { throw JAXBException.classNotFoundException(componentType.getRawName()); throw JAXBException.classNotFoundException(componentType.getRawName()); declaredClass = AccessController.doPrivileged(new PrivilegedClassForName(itemType.getRawName(), false, helper.getClassLoader())); } catch (PrivilegedActionException exception) { throw JAXBException.classNotFoundException(itemType.getRawName()); throw JAXBException.classNotFoundException(itemType.getRawName());
public static JAXBException missingPropertyInPropOrder(String fieldName, String className) { Object[] args = { fieldName, className }; JAXBException exception = new JAXBException(ExceptionMessageGenerator.buildMessage(JAXBException.class, MISSING_PROPERTY_IN_PROP_ORDER, args)); exception.setErrorCode(MISSING_PROPERTY_IN_PROP_ORDER); return exception; }