@Override public String getEventName() { if (event == null) { return null; } if (event.isLiteral()) { return event.getValue(); } else { FaceletContext faceletContext = getFaceletContext(FacesContext.getCurrentInstance()); ValueExpression expression = event.getValueExpression(faceletContext, String.class); return (String) expression.getValue(faceletContext); } }
@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { FacesContext facesContext = FacesContext.getCurrentInstance(); Class<?> type = getClassFromAttribute(typeTagAttribute, ctx); Map<String, Object> enumValues = getEnumValues(facesContext, type, allSuffixTagAttribute == null ? null : allSuffixTagAttribute.getValue(ctx)); // Create alias/var expression String var; if (varTagAttribute == null) { var = type.getSimpleName(); // fall back to class name } else { var = varTagAttribute.getValue(ctx); } ctx.setAttribute(var, enumValues); }
@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException { FacesContext facesContext = FacesContext.getCurrentInstance(); Class<?> type = getClassFromAttribute(typeTagAttribute, ctx); Map<String, Object> constants = getConstants(facesContext, type); // Create alias/var expression String var; if (varTagAttribute == null) { var = type.getSimpleName(); // fall back to class name } else { var = varTagAttribute.getValue(ctx); } ctx.setAttribute(var, constants); }
public void apply(FaceletContext ctx, UIComponent parent) throws IOException { String nameStr = this.name.getValue(ctx); ValueExpression valueVE = this.value.getValueExpression(ctx, Object.class); ctx.getVariableMapper().setVariable(nameStr, valueVE); }
/** * Gets the {@link Class} from the {@link TagAttribute}. * * @param attribute The {@link TagAttribute}. * @param ctx The {@link FaceletContext}. * @return The {@link Class}. */ protected Class<?> getClassFromAttribute(TagAttribute attribute, FaceletContext ctx) { String type = attribute.getValue(ctx); try { return LangUtils.loadClassForName(type); } catch (ClassNotFoundException e) { throw new FacesException("Class " + type + " not found.", e); } }
/** * Gets the {@link Class} from the {@link TagAttribute}. * * @param attribute The {@link TagAttribute}. * @param ctx The {@link FaceletContext}. * @return The {@link Class}. */ protected Class<?> getClassFromAttribute(TagAttribute attribute, FaceletContext ctx) { String type = attribute.getValue(ctx); try { return LangUtils.loadClassForName(type); } catch (ClassNotFoundException e) { throw new FacesException("Class " + type + " not found.", e); } }
public String getEventName () { if (event == null) { return null; } return event.getValue(); }
private String getVarName(FaceletContext ctx) { if (this.var != null) { return this.var.getValue(ctx); } return null; }
@Override public String getConverterId(FaceletContext ctx) { if (converterId == null) { return null; } return converterId.getValue(ctx); } }
private final String getVarStatusName(FaceletContext ctx) { if (this.varStatus != null) { return this.varStatus.getValue(ctx); } return null; }
public String getConverterId(FaceletContext ctx) { if (converterId == null) { TagAttribute idAttr = getAttribute("converterId"); if (idAttr == null) { return null; } else { return idAttr.getValue(ctx); } } return converterId; }
public String getConverterId(FaceletContext ctx) { if (converterId == null) { TagAttribute idAttr = getAttribute("converterId"); if (idAttr == null) { return null; } else { return idAttr.getValue(ctx); } } return converterId; }
public String getFor() { TagAttribute forAttribute = _delegate.getTagAttribute("for"); if (forAttribute == null) { return null; } else { return forAttribute.getValue(); } }
/** * @param ctx the <code>FacesContext</code> for the current request * @return the current value of the "target" attribute of the component * associated with this delegate */ @Override protected String getLocationTarget(FaceletContext ctx) { TagAttribute attr = getAttribute("target"); return ((attr != null) ? attr.getValue(ctx) : null); }
public String getConverterId(FaceletContext ctx) { if (converterId == null) { TagAttribute idAttr = getAttribute("converterId"); if (idAttr == null) { return null; } else { return idAttr.getValue(ctx); } } return converterId; }
public String getEventName() { if (null != getEvent()) { return getEvent().getValue(); } return null; }
public String getEventName() { if (null != getEvent()) { return getEvent().getValue(); } return null; }
private static String print(Tag tag, TagAttribute attr) { return tag.getLocation() + " <" + tag.getQName() + " " + attr.getQName() + "=\"" + attr.getValue() + "\">"; } }
@Override public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, ELException { boolean b = this.test.getBoolean(ctx); if (this.var != null) { ctx.setAttribute(var.getValue(ctx), b); } if (b) { this.nextHandler.apply(ctx, parent); } }
private String getEventName(ClientBehaviorHolder holder){ String eventName; if (null != owner.getEvent()){ eventName = owner.getEvent().getValue(); } else { eventName = holder.getDefaultEventName(); } if (null == eventName){ throw new TagException(owner.getTag(), "The event name is not defined"); } return eventName; }