/** * Delegates to getObject with Object.class as a param * * @see #getObject(FaceletContext, Class) * @param ctx * FaceletContext to use * @return Object representation of this attribute's value */ public Object getObject(FaceletContext ctx) { return this.getObject(ctx, Object.class); }
/** * If literal, then return our value, otherwise delegate to getObject, * passing String.class. * * @see #getObject(FaceletContext, Class) * @param ctx * FaceletContext to use * @return String value of this attribute */ public String getValue(FaceletContext ctx) { if (this.literal) { return this.value; } else { return (String) this.getObject(ctx, String.class); } }
/** * If literal, call * {@link Integer#parseInt(java.lang.String) Integer.parseInt(String)}, * otherwise call * {@link #getObject(FaceletContext, Class) getObject(FaceletContext, Class)}. * * @see Integer#parseInt(java.lang.String) * @see #getObject(FaceletContext, Class) * @param ctx * FaceletContext to use * @return int value */ public int getInt(FaceletContext ctx) { if (this.literal) { return Integer.parseInt(this.value); } else { return ((Number) this.getObject(ctx, Number.class)).intValue(); } }
/** * If literal, return * {@link Boolean#getBoolean(java.lang.String) Boolean.getBoolean(java.lang.String)} * passing our value, otherwise call * {@link #getObject(FaceletContext, Class) getObject(FaceletContext, Class)}. * * @see Boolean#getBoolean(java.lang.String) * @see #getObject(FaceletContext, Class) * @param ctx * FaceletContext to use * @return boolean value */ public boolean getBoolean(FaceletContext ctx) { if (this.literal) { return Boolean.valueOf(this.value).booleanValue(); } else { return ((Boolean) this.getObject(ctx, Boolean.class)) .booleanValue(); } }
public void applyMetadata(FaceletContext ctx, Object instance) { try { this.method.invoke(instance, new Object[] { this.attribute .getObject(ctx, this.type) }); } catch (InvocationTargetException e) { throw new TagAttributeException(this.attribute, e.getCause()); } catch (Exception e) { throw new TagAttributeException(this.attribute, e); } } }
Object obj = attr.getObject(ctx); if (obj instanceof Locale) { return (Locale) obj;
/** * @see com.sun.facelets.FaceletHandler#apply(com.sun.facelets.FaceletContext, * javax.faces.component.UIComponent) */ public void apply(FaceletContext ctx, UIComponent parent) throws IOException, FacesException, FaceletException, ELException { logger.debug("Apply called. Component: " + parent); ActionSource actionSource = (ActionSource) parent; if (sourceHasProperty(actionSource)) return; UpdateActionListener al = new UpdateActionListener(); if (converterAttr != null) al.setConverter((Converter) converterAttr.getObject(ctx)); Application app = ctx.getFacesContext().getApplication(); ValueBinding vb = app.createValueBinding(valueAttr.getValue()); al.setValueBinding(vb); vb = app.createValueBinding(propertyAttr.getValue()); al.setPropertyBinding(vb); actionSource.addActionListener(al); }
public void setAttributes(FaceletContext ctx, Object obj) { super.setAttributes(ctx, obj); EnumConverter c = (EnumConverter) obj; if (this.targetClass != null) { if (this.targetClass.isLiteral()) { try { c.setTargetClass(org.apache.myfaces.commons.util.ClassUtils.classForName(this.targetClass.getValue())); } catch (ClassNotFoundException e) { throw new TagAttributeException(this.targetClass,"Cannot find class assigned: "+this.targetClass.getValue(),e); } } else { c.setTargetClass((Class) this.targetClass.getObject(ctx, Class.class)); } } }
public void setAttributes(FaceletContext ctx, Object obj) { super.setAttributes(ctx, obj); EnumConverter c = (EnumConverter) obj; if (this.targetClass != null) { if (this.targetClass.isLiteral()) { try { c.setTargetClass(org.apache.myfaces.commons.util.ClassUtils.classForName(this.targetClass.getValue())); } catch (ClassNotFoundException e) { throw new TagAttributeException(this.targetClass,"Cannot find class assigned: "+this.targetClass.getValue(),e); } } else { c.setTargetClass((Class) this.targetClass.getObject(ctx, Class.class)); } } }
public void setAttributes(FaceletContext ctx, Object obj) { super.setAttributes(ctx, obj); AbstractTypedNumberConverter c = (AbstractTypedNumberConverter) obj; if (this.destType != null) { if (this.destType.isLiteral()) { try { c.setDestType(org.apache.myfaces.commons.util.ClassUtils.classForName(this.destType.getValue())); } catch (ClassNotFoundException e) { throw new TagAttributeException(this.destType,"Cannot find class assigned: "+this.destType.getValue(),e); } } else { c.setDestType((Class) this.destType.getObject(ctx, Class.class)); } } }
Object t = this.timeZone.getObject(ctx); if(t != null) { if (t instanceof TimeZone) {
listenerRef = typeAttr.getObject(faceletContext);