private void verifyFactoriesExist() { for (int i = 0, len = FACTORY_NAMES.length; i < len; i++) { try { FactoryFinder.getFactory(FACTORY_NAMES[i]); } catch (Exception e) { throw new ConfigurationException( MessageFormat.format("Factory ''{0}'' was not configured properly.", FACTORY_NAMES[i]), e); } } }
private void verifyFactoriesExist() { if (validateFactories) { for (int i = 0, len = FACTORY_NAMES.length; i < len; i++) { try { FactoryFinder.getFactory(FACTORY_NAMES[i]); } catch (Exception e) { throw new ConfigurationException( MessageFormat.format("Factory ''{0}'' was not configured properly.", FACTORY_NAMES[i]), e); } } } }
public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) { try { InputSource source = resolveEntity(publicId, systemId); if (source != null) { return new Input(source.getByteStream()); } } catch (Exception e) { throw new ConfigurationException(e); } return null; }
public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) { try { InputSource source = resolveEntity(publicId, systemId); if (source != null) { return new Input(source.getByteStream()); } } catch (Exception e) { throw new ConfigurationException(e); } return null; }
@Override public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) { try { InputSource source = resolveEntity(publicId, systemId); if (source != null) { return new Input(source.getByteStream()); } } catch (Exception e) { throw new ConfigurationException(e); } return null; }
@Override public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) { try { InputSource source = resolveEntity(publicId, systemId); if (source != null) { return new Input(source.getByteStream()); } } catch (Exception e) { throw new ConfigurationException(e); } return null; }
private void verifyFactoriesExist(ServletContext servletContext) { if (validateFactories) { Deque<Exception> exceptions = new ConcurrentLinkedDeque<>(); ClassLoader contextClassLoader = Thread.currentThread().getContextClassLoader(); try { factoryNames.stream().forEach(e -> { Thread.currentThread().setContextClassLoader(contextClassLoader); InitFacesContext.getInstance(servletContext); try { FactoryFinder.getFactory(e); } catch (Exception exception) { exception.printStackTrace(); exceptions.add(new ConfigurationException(format("Factory ''{0}'' was not configured properly.", e), exception)); } finally { Thread.currentThread().setContextClassLoader(null); } }); } finally { Thread.currentThread().setContextClassLoader(contextClassLoader); } } }
@Override public LSInput resolveResource(String type, String namespaceURI, String publicId, String systemId, String baseURI) { try { InputSource source = resolveEntity(publicId, systemId); if (source != null) { return new Input(source.getByteStream()); } } catch (Exception e) { throw new ConfigurationException(e); } return null; }
private void processDefaultValidatorIds() { Application app = getApplication(); Map<String, String> defaultValidatorInfo = app.getDefaultValidatorInfo(); for (Map.Entry<String, String> info : defaultValidatorInfo.entrySet()) { String defaultValidatorId = info.getKey(); boolean found = false; for (Iterator<String> registered = app.getValidatorIds(); registered.hasNext();) { if (defaultValidatorId.equals(registered.next())) { found = true; break; } } if (!found) { throw new ConfigurationException(format("Default validator ''{0}'' does not reference a registered validator.", defaultValidatorId)); } } }
private void processDefaultValidatorIds() { Application app = getApplication(); Map<String,String> defaultValidatorInfo = app.getDefaultValidatorInfo(); for (Map.Entry<String,String> info : defaultValidatorInfo.entrySet()) { String defaultValidatorId = info.getKey(); boolean found = false; for (Iterator<String> registered = app.getValidatorIds(); registered.hasNext(); ) { if (defaultValidatorId.equals(registered.next())) { found = true; break; } } if (!found) { String msg = MessageFormat.format("Default validator ''{0}'' does not reference a registered validator.", defaultValidatorId); throw new ConfigurationException(msg); } } }
private void processDefaultValidatorIds() { Application app = getApplication(); Map<String, String> defaultValidatorInfo = app.getDefaultValidatorInfo(); for (Map.Entry<String, String> info : defaultValidatorInfo.entrySet()) { String defaultValidatorId = info.getKey(); boolean found = false; for (Iterator<String> registered = app.getValidatorIds(); registered.hasNext();) { if (defaultValidatorId.equals(registered.next())) { found = true; break; } } if (!found) { throw new ConfigurationException(format("Default validator ''{0}'' does not reference a registered validator.", defaultValidatorId)); } } }
private void processDefaultValidatorIds() { Application app = getApplication(); Map<String, String> defaultValidatorInfo = app.getDefaultValidatorInfo(); for (Map.Entry<String, String> info : defaultValidatorInfo.entrySet()) { String defaultValidatorId = info.getKey(); boolean found = false; for (Iterator<String> registered = app.getValidatorIds(); registered.hasNext();) { if (defaultValidatorId.equals(registered.next())) { found = true; break; } } if (!found) { throw new ConfigurationException(format("Default validator ''{0}'' does not reference a registered validator.", defaultValidatorId)); } } }
/** * Ensure the IDs in <code>source</code> aren't present in <code>searchTarget</code>. */ private void checkDuplicates(String[] source, String[] searchTarget) { for (String id : source) { if (search(searchTarget, id)) { String msg = MessageFormat.format("Document {0} is specified to come before and after {1}.", documentInfo.getDocument().getDocumentURI(), id); throw new ConfigurationException(msg); } } }
/** * Ensure the IDs in <code>source</code> aren't present in <code>searchTarget</code>. */ private void checkDuplicates(String[] source, String[] searchTarget) { for (String id : source) { if (search(searchTarget, id)) { String msg = MessageFormat.format("Document {0} is specified to come before and after {1}.", documentInfo.getDocument().getDocumentURI(), id); throw new ConfigurationException(msg); } } }
/** * Ensure the IDs in <code>source</code> aren't present in <code>searchTarget</code>. */ private void checkDuplicates(String[] source, String[] searchTarget) { for (String id : source) { if (search(searchTarget, id)) { String msg = MessageFormat.format("Document {0} is specified to come before and after {1}.", documentInfo.getDocument().getDocumentURI(), id); throw new ConfigurationException(msg); } } }
protected Class<?> findRootType(ServletContext sc, FacesContext facesContext, String source, Node sourceNode, Class<?>[] ctorArguments) { try { Class<?> sourceClass = loadClass(sc, facesContext, source, this, null); for (Class<?> ctorArg : ctorArguments) { if (lookupConstructor(sourceClass, ctorArg) != null) { return ctorArg; } } } catch (ClassNotFoundException cnfe) { throw new ConfigurationException(buildMessage(format("Unable to find class ''{0}''", source), sourceNode), cnfe); } return null; }
/** * Ensure the IDs in <code>source</code> aren't present in <code>searchTarget</code>. */ private void checkDuplicates(String[] source, String[] searchTarget) { for (String id : source) { if (search(searchTarget, id)) { String msg = MessageFormat.format("Document {0} is specified to come before and after {1}.", documentInfo.getDocument().getDocumentURI(), id); throw new ConfigurationException(msg); } } }
protected Class<?> findRootType(ServletContext sc, FacesContext facesContext, String source, Node sourceNode, Class<?>[] ctorArguments) { try { Class<?> sourceClass = loadClass(sc, facesContext, source, this, null); for (Class<?> ctorArg : ctorArguments) { if (lookupConstructor(sourceClass, ctorArg) != null) { return ctorArg; } } } catch (ClassNotFoundException cnfe) { throw new ConfigurationException(buildMessage(format("Unable to find class ''{0}''", source), sourceNode), cnfe); } return null; }
protected Class<?> findRootType(ServletContext sc, FacesContext facesContext, String source, Node sourceNode, Class<?>[] ctorArguments) { try { Class<?> sourceClass = loadClass(sc, facesContext, source, this, null); for (Class<?> ctorArg : ctorArguments) { if (lookupConstructor(sourceClass, ctorArg) != null) { return ctorArg; } } } catch (ClassNotFoundException cnfe) { throw new ConfigurationException(buildMessage(format("Unable to find class ''{0}''", source), sourceNode), cnfe); } return null; }
protected Class<?> findRootType(ServletContext sc, String source, Node sourceNode, Class<?>[] ctorArguments) { try { Class<?> sourceClass = loadClass(sc, source, this, null); for (Class<?> ctorArg : ctorArguments) { if (ReflectionUtils.lookupConstructor(sourceClass, ctorArg) != null) { return ctorArg; } } } catch (ClassNotFoundException cnfe) { throw new ConfigurationException( buildMessage(MessageFormat.format("Unable to find class ''{0}''", source), sourceNode), cnfe); } return null; }