protected void setBehaviorAttribute(FaceletContext ctx, E behavior, TagAttribute attr, Class<?> type) { if (attr != null) { String attributeName = attr.getLocalName(); if (attr.isLiteral()) { behavior.setLiteral(attributeName, attr.getObject(ctx, type)); } else { behavior.setValueExpression(attributeName, attr.getValueExpression(ctx, type)); } } }
/** * Returns the Object value of the given tag attribute * @param context The involved Facelet context. * @param tagAttribute The tag attribute to retrieve the value from. * @return The Object value of the given tag attribute, or null if the tag attribute is null. */ public static Object getObject(FaceletContext context, TagAttribute tagAttribute) { return tagAttribute != null ? tagAttribute.getObject(context) : null; }
/** * Returns the Object value of the given tag attribute * @param context The involved Facelet context. * @param tagAttribute The tag attribute to retrieve the value from. * @return The Object value of the given tag attribute, or null if the tag attribute is null. */ public static Object getObject(FaceletContext context, TagAttribute tagAttribute) { return tagAttribute != null ? tagAttribute.getObject(context) : null; }
public void applyMetadata(FaceletContext ctx, Object instance) { UIComponent c = (UIComponent) instance; Object value = attribute.getObject(ctx,type); // don't set the attributes value in the components attributemap // if it is null, as this will throw a NullPointerException. if(value!=null) { c.getAttributes().put(name, value); } }
public void applyMetadata(FaceletContext ctx, Object instance) { ((UIComponent) instance).getAttributes().put(_name, _attr.getObject(ctx, _type)); } }
@Override public void applyMetadata(FaceletContext ctx, Object instance) { UIComponent c = (UIComponent) instance; Object value = attribute.getObject(ctx,type); // don't set the attributes value in the components attributemap // if it is null, as this will throw a NullPointerException. if(value!=null) { c.getAttributes().put(name, value); } }
public void applyMetadata(FaceletContext ctx, Object instance) { ((UIComponent) instance).getAttributes().put(_name, _attr.getObject(ctx, _type)); } }
@Override public void applyMetadata(FaceletContext ctx, Object instance) { UIComponent c = (UIComponent) instance; Object value = attribute.getObject(ctx,type); // don't set the attributes value in the components attributemap // if it is null, as this will throw a NullPointerException. if(value!=null) { c.getAttributes().put(name, value); } }
public void applyMetadata(FaceletContext ctx, Object instance) { ((UIComponent) instance).getAttributes().put(_name, _attr.getObject(ctx, _type)); } }
/** * {@inheritDoc} */ @Override protected LinksProvider buildLinksProvider(FaceletContext context) { return new PageLinksProvider((Page<?>) this.page.getObject(context, Page.class)); } }
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); } } }
@Override 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 (IllegalAccessException | IllegalArgumentException e) { throw new TagAttributeException(this.attribute, e); } } }
@Override 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 (IllegalAccessException | IllegalArgumentException e) { throw new TagAttributeException(this.attribute, e); } } }
@Override 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 (IllegalAccessException | IllegalArgumentException e) { throw new TagAttributeException(this.attribute, e); } } }
@Override public void applyAttachedObject(FacesContext context, UIComponent parent) { FaceletContext ctx = (FaceletContext) context.getAttributes() .get(FaceletContext.FACELET_CONTEXT_KEY); ActionSource as = (ActionSource) parent; String renderStr = (String) render.getObject(ctx, String.class); ActionListener listener = new LazyActionListener(toList(renderStr)); as.addActionListener(listener); }
@Override public void applyAttachedObject(FacesContext context, UIComponent parent) { FaceletContext ctx = (FaceletContext) context.getAttributes() .get(FaceletContext.FACELET_CONTEXT_KEY); ActionSource as = (ActionSource) parent; String renderStr = (String) render.getObject(ctx, String.class); ActionListener listener = new LazyActionListener(toList(renderStr)); as.addActionListener(listener); }
@Override public void applyAttachedObject(FacesContext context, UIComponent parent) { FaceletContext ctx = (FaceletContext) context.getAttributes() .get(FaceletContext.FACELET_CONTEXT_KEY); ActionSource as = (ActionSource) parent; String renderStr = (String) render.getObject(ctx, String.class); ActionListener listener = new LazyActionListener(toList(renderStr)); as.addActionListener(listener); }
@Override public void applyAttachedObject(FacesContext context, UIComponent parent) { FaceletContext ctx = (FaceletContext) context.getAttributes() .get(FaceletContext.FACELET_CONTEXT_KEY); ActionSource as = (ActionSource) parent; String renderStr = (String) render.getObject(ctx, String.class); ActionListener listener = new LazyActionListener(toList(renderStr)); as.addActionListener(listener); }
protected void setBehaviorAttribute(FaceletContext ctx, AjaxBehavior behavior, TagAttribute attr, AjaxBehavior.Property property) { if (null != attr) { if (attr.isLiteral()) { behavior.setLiteral(property, attr.getObject(ctx, property.expectedType)); } else { behavior.setValueExpression(property, attr.getValueExpression(ctx, property.expectedType)); } } }
protected void setBehaviorAttribute(FaceletContext ctx, E behavior, TagAttribute attr, Class<?> type) { if (attr != null) { String attributeName = attr.getLocalName(); if (attr.isLiteral()) { behavior.setLiteral(attributeName, attr.getObject(ctx, type)); } else { behavior.setValueExpression(attributeName, attr.getValueExpression(ctx, type)); } } }