/** * Returns a new DateTimeConverter * * @see DateTimeConverter * @see com.sun.facelets.tag.jsf.ConvertHandler#createConverter(com.sun.facelets.FaceletContext) */ protected Converter createConverter(FaceletContext ctx) throws FacesException, ELException, FaceletException { return ctx.getFacesContext().getApplication().createConverter(DateTimeConverter.CONVERTER_ID); }
private Object getValue( FaceletContext faceletContext, UIComponent parent, String expressionString, String attributeName) { Class type = Object.class; try { type = PropertyUtils.getReadMethod( new PropertyDescriptor(attributeName, parent.getClass())).getReturnType(); } catch (IntrospectionException e) { LOG.warn("Can't determine expected type", e); } ExpressionFactory expressionFactory = faceletContext.getExpressionFactory(); final ValueExpression valueExpression = expressionFactory .createValueExpression(faceletContext, expressionString, type); return valueExpression.getValue(faceletContext); }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException, ELException { VariableMapper orig = ctx.getVariableMapper(); if (this.params != null) { VariableMapper vm = new VariableMapperWrapper(orig); ctx.setVariableMapper(vm); for (int i = 0; i < this.params.length; i++) { this.params[i].apply(ctx, parent); } } ctx.pushClient(this); try { ctx.includeFacelet(parent, this.template.getValue(ctx)); } finally { ctx.setVariableMapper(orig); ctx.popClient(this); } }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException, ELException { ctx.extendClient(this); boolean found = false; try { found = ctx.includeDefinition(parent, this.name); } finally { ctx.popClient(this); } if (!found) { this.nextHandler.apply(ctx, parent); } }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException, ELException { String path = this.src.getValue(ctx); VariableMapper orig = ctx.getVariableMapper(); ctx.setVariableMapper(new VariableMapperWrapper(orig)); try { this.nextHandler.apply(ctx, null); ctx.includeFacelet(parent, path); } finally { ctx.setVariableMapper(orig); } } }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException, ELException { if (this.template != null) { VariableMapper orig = ctx.getVariableMapper(); if (this.params != null) { VariableMapper vm = new VariableMapperWrapper(orig); ctx.setVariableMapper(vm); for (int i = 0; i < this.params.length; i++) { this.params[i].apply(ctx, parent); } } ctx.extendClient(this); try { ctx.includeFacelet(parent, this.template.getValue(ctx)); } finally { ctx.popClient(this); ctx.setVariableMapper(orig); } } else { this.nextHandler.apply(ctx, parent); } }
if (isMethodOrValueExpression(expressionString)) { ValueExpression expression = faceletContext.getVariableMapper().resolveVariable(removeElParenthesis(expressionString)); if (expression == null) { result = true; if (isMethodOrValueExpression(expressionString)) { ValueExpression expression = faceletContext.getVariableMapper().resolveVariable(removeElParenthesis(expressionString)); if (expression == null) { result = false; if (isMethodOrValueExpression(expressionString)) { ValueExpression expression = faceletContext.getVariableMapper().resolveVariable(removeElParenthesis(expressionString)); if (expression == null) { ExpressionFactory expressionFactory = faceletContext.getExpressionFactory(); MethodExpression action = new TagMethodExpression(value, expressionFactory.createMethodExpression( faceletContext, expressionString, String.class, ComponentUtils.ACTION_ARGS)); if (isMethodOrValueExpression(expressionString)) { ValueExpression expression = faceletContext.getVariableMapper().resolveVariable(removeElParenthesis(expressionString)); if (expression == null) { if (LOG.isDebugEnabled()) { ExpressionFactory expressionFactory = faceletContext.getExpressionFactory(); MethodExpression actionListener = new TagMethodExpression(value, expressionFactory.createMethodExpression(
public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException, ELException { String nameStr = this.name.getValue(ctx); ValueExpression valueVE = this.value.getValueExpression(ctx, Object.class); ctx.getVariableMapper().setVariable(nameStr, valueVE); }
VariableMapper vars = ctx.getVariableMapper(); ValueExpression ve = null; ValueExpression vO = this.capture(v, vars); ctx.setAttribute(v, value); } else { ve = this.getVarExpr(srcVE, src, value, i); IterationStatus itrS = new IterationStatus(first, !itr.hasNext(),i, sO, eO, mO); if (t || srcVE == null) { ctx.setAttribute(vs, itrS); } else { ve = new IterationStatusExpression(itrS);
if (parent != null) { String id = ctx.generateUniqueId(this.id); for (int i = 0; i < size; i++) { ins = this.instructions[i]; applied[i] = ins.apply(ctx.getExpressionFactory(), ctx);
throw new TagException(tag, "Process does not contain file '" + file + "'"); VariableMapper orig = ctx.getVariableMapper(); final VariableMapperWrapper newVarMapper = new VariableMapperWrapper(orig); ctx.setVariableMapper(newVarMapper); try { final StringBuffer buffer = new StringBuffer(); buffer.append(file); nextHandler.apply(ctx, parent); ctx.includeFacelet(parent, new URL("par", "", 0, buffer.toString(), new FileDefinitionURLStreamHandler(fileDefinition, file))); } finally { ctx.setVariableMapper(orig);
public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException, ELException { String varStr = this.var.getValue(ctx); ValueExpression veObj = this.value.getValueExpression(ctx, Object.class); ctx.getVariableMapper().setVariable(varStr, veObj); } }
/** * Returns a new NumberConverter * * @see NumberConverter * @see com.sun.facelets.tag.jsf.ConverterHandler#createConverter(com.sun.facelets.FaceletContext) */ protected Converter createConverter(FaceletContext ctx) throws FacesException, ELException, FaceletException { return ctx.getFacesContext().getApplication().createConverter(NumberConverter.CONVERTER_ID); }
VariableMapper orig = ctx.getVariableMapper(); .getValueExpression(ctx, Object.class)); ctx.setVariableMapper(varMapper); ctx.pushClient(this); ctx.includeFacelet(parent, this.location); } catch (FileNotFoundException e) { throw new TagException(this.tag, e.getMessage()); ctx.popClient(this); ctx.setVariableMapper(orig);
public String getText(FaceletContext ctx) { Writer writer = new FastWriter(this.length); try { this.txt.apply(ctx.getExpressionFactory(), ctx).write(writer, ctx); } catch (IOException e) { throw new ELException(this.alias + ": "+ e.getMessage(), e.getCause()); } return writer.toString(); }
private ValueExpression getExpression(FaceletContext faceletContext) { String myValue = removeElParenthesis(value.getValue()); return faceletContext.getVariableMapper().resolveVariable(myValue); }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException, ELException { this.next.apply(ctx, parent); ctx.getFacesContext().getExternalContext().getRequestMap().put("facelets.Encoding", this.encoding); }
public String getText(FaceletContext ctx) { Writer writer = new FastWriter(this.length); try { this.txt.apply(ctx.getExpressionFactory(), ctx).write(writer, ctx); } catch (IOException e) { throw new ELException(this.alias + ": "+ e.getMessage(), e.getCause()); } return writer.toString(); } }
/** * Tries to walk up the parent to find the UIViewRoot, if not found, then go * to FaceletContext's FacesContext for the view root. * * @param ctx * FaceletContext * @param parent * UIComponent to search from * @return UIViewRoot instance for this evaluation */ public static final UIViewRoot getViewRoot(FaceletContext ctx, UIComponent parent) { UIComponent c = parent; do { if (c instanceof UIViewRoot) { return (UIViewRoot) c; } else { c = c.getParent(); } } while (c != null); return ctx.getFacesContext().getViewRoot(); }
public void applyMetadata(FaceletContext ctx, Object instance) { if (value == null) { String str = this.attribute.getValue(); value = new Object[] { ctx.getExpressionFactory().coerceToType(str, method.getParameterTypes()[0]) }; } try { method.invoke(instance, this.value); } catch (InvocationTargetException e) { throw new TagAttributeException(this.attribute, e.getCause()); } catch (Exception e) { throw new TagAttributeException(this.attribute, e); } }