public UserConverterHandlerFactory(String converterId, Class type) { this.converterId = converterId; this.type = type; try { this.constructor = this.type.getConstructor(CONS_SIG); } catch (Exception e) { throw new FaceletException( "Must have a Constructor that takes in a ConverterConfig", e); } }
public UserValidatorHandlerFactory(String validatorId, Class type) { this.validatorId = validatorId; this.type = type; try { this.constructor = this.type.getConstructor(CONS_SIG); } catch (Exception e) { throw new FaceletException( "Must have a Constructor that takes in a ConverterConfig", e); } }
/** * @param handlerType */ public UserComponentHandlerFactory(String componentType, String renderType, Class type) { this.componentType = componentType; this.renderType = renderType; this.type = type; try { this.constructor = this.type.getConstructor(CONS_SIG); } catch (Exception e) { throw new FaceletException( "Must have a Constructor that takes in a ComponentConfig", e); } }
public TagHandler createHandler(TagConfig cfg) throws FacesException, ELException { try { ComponentConfig ccfg = new ComponentConfigWrapper(cfg, this.componentType, this.renderType); return (TagHandler) this.constructor .newInstance(new Object[] { ccfg }); } catch (InvocationTargetException e) { throw new FaceletException(e.getCause().getMessage(), e.getCause().getCause()); } catch (Exception e) { throw new FaceletException("Error Instantiating ComponentHandler: "+this.type.getName(), e); } } }
public TagHandler createHandler(TagConfig cfg) throws FacesException, ELException { try { ValidatorConfig ccfg = new ValidatorConfigWrapper(cfg, this.validatorId); return (TagHandler) this.constructor .newInstance(new Object[] { ccfg }); } catch (InvocationTargetException e) { throw new FaceletException(e.getCause().getMessage(), e.getCause().getCause()); } catch (Exception e) { throw new FaceletException("Error Instantiating ValidatorHandler: "+this.type.getName(), e); } } }
public TagHandler createHandler(TagConfig cfg) throws FacesException, ELException { try { ConverterConfig ccfg = new ConverterConfigWrapper(cfg, this.converterId); return (TagHandler) this.constructor .newInstance(new Object[] { ccfg }); } catch (InvocationTargetException e) { throw new FaceletException(e.getCause().getMessage(), e.getCause().getCause()); } catch (Exception e) { throw new FaceletException("Error Instantiating ConverterHandler: "+this.type.getName(), e); } } }
private final Object featureInstance(String name) { String type = (String) this.features.get(name); if (type != null) { try { return ReflectionUtil.forName(type).newInstance(); } catch (Throwable t) { throw new FaceletException("Could not instantiate feature[" + name + "]: " + type); } } return null; }
/** * Template method for determining if the Facelet needs to be refreshed. * * @param facelet * Facelet that could have expired * @return true if it needs to be refreshed */ protected boolean needsToBeRefreshed(DefaultFacelet facelet) { if (this.refreshPeriod != -1) { long ttl = facelet.getCreateTime() + this.refreshPeriod; if (System.currentTimeMillis() > ttl) { try { long atl = facelet.getSource().openConnection() .getLastModified(); return atl == 0 || atl > ttl; } catch (Exception e) { throw new FaceletException( "Error Checking Last Modified for " + facelet.getAlias(), e); } } } return false; }
public FaceletHandler doCompile(URL src, String alias) throws IOException, FaceletException, ELException, FacesException { CompilationManager mngr = null; InputStream is = null; String encoding = "UTF-8"; try { is = new BufferedInputStream(src.openStream(), 1024); mngr = new CompilationManager(alias, this); encoding = writeXmlDecl(is, mngr); CompilationHandler handler = new CompilationHandler(mngr, alias); SAXParser parser = this.createSAXParser(handler); parser.parse(is, handler); } catch (SAXException e) { throw new FaceletException("Error Parsing " + alias + ": " + e.getMessage(), e.getCause()); } catch (ParserConfigurationException e) { throw new FaceletException("Error Configuring Parser " + alias + ": " + e.getMessage(), e.getCause()); } finally { if (is != null) { is.close(); } } return new EncodingHandler(mngr.createFaceletHandler(), encoding); }
throw new FaceletException("Property 'type' must not be null."); throw new FaceletException( "Property 'type' must be either a string (containing a class name) " + "or a TabChangeListener instance."); throw new FaceletException( "Component " + parent.getId() + " is not of type HtmlPanelTabbedPane");