/** * @param context * @param component * @param property * @param attributeName * * @throws IOException */ public void encodeAttribute(FacesContext context, UIComponent component, Object property, String attributeName) throws IOException { ResponseWriter writer = context.getResponseWriter(); Object value = component.getAttributes().get(property); if (RenderKitUtils.shouldRenderAttribute(value)) { writer.writeAttribute(attributeName, value, property.toString()); } }
/** * @param context * @param component * @param property * @param attributeName * * @throws IOException */ public void encodeAttribute(FacesContext context, UIComponent component, Object property, String attributeName) throws IOException { ResponseWriter writer = context.getResponseWriter(); Object value = component.getAttributes().get(property); if (RenderKitUtils.shouldRenderAttribute(value)) { writer.writeAttribute(attributeName, value, property.toString()); } }
/** * @param context * @param component * @param property * @param attributeName * * @throws IOException */ public void encodeAttribute(FacesContext context, UIComponent component, Object property, String attributeName) throws IOException { ResponseWriter writer = context.getResponseWriter(); Object value = component.getAttributes().get(property); if (RenderKitUtils.shouldRenderAttribute(value)) { writer.writeAttribute(attributeName, value, property.toString()); } }
public static void renderAttribute(FacesContext facesContext, String attributeName, Object attributeValue) throws IOException { if (!shouldRenderAttribute(attributeValue)) { return; } ResponseWriter writer = facesContext.getResponseWriter(); String prefixedAttributeName = prefixAttributeName(attributeName, writer); if (Arrays.binarySearch(URI_ATTRIBUTE_NAMES, attributeName) >= 0) { writer.writeURIAttribute(prefixedAttributeName, attributeValue, null); } else if (Arrays.binarySearch(BOOLEAN_ATTRIBUTE_NAMES, attributeName) >= 0) { boolean booleanAttributeValue = Boolean.valueOf(String.valueOf(attributeValue)); if (booleanAttributeValue) { // TODO - is passing in Boolean.TRUE value documented somewhere? writer.writeAttribute(prefixedAttributeName, Boolean.TRUE, null); } } else { writer.writeAttribute(prefixedAttributeName, attributeValue, null); } }
public static void renderAttribute(FacesContext facesContext, String attributeName, Object attributeValue) throws IOException { if (!shouldRenderAttribute(attributeValue)) { return; } ResponseWriter writer = facesContext.getResponseWriter(); String prefixedAttributeName = prefixAttributeName(attributeName, writer); if (Arrays.binarySearch(URI_ATTRIBUTE_NAMES, attributeName) >= 0) { writer.writeURIAttribute(prefixedAttributeName, attributeValue, null); } else if (Arrays.binarySearch(BOOLEAN_ATTRIBUTE_NAMES, attributeName) >= 0) { boolean booleanAttributeValue = Boolean.valueOf(String.valueOf(attributeValue)); if (booleanAttributeValue) { // TODO - is passing in Boolean.TRUE value documented somewhere? writer.writeAttribute(prefixedAttributeName, Boolean.TRUE, null); } } else { writer.writeAttribute(prefixedAttributeName, attributeValue, null); } }
public static void renderAttribute(FacesContext facesContext, String attributeName, Object attributeValue) throws IOException { if (!shouldRenderAttribute(attributeValue)) { return; } ResponseWriter writer = facesContext.getResponseWriter(); String prefixedAttributeName = prefixAttributeName(attributeName, writer); if (Arrays.binarySearch(URI_ATTRIBUTE_NAMES, attributeName) >= 0) { writer.writeURIAttribute(prefixedAttributeName, attributeValue, null); } else if (Arrays.binarySearch(BOOLEAN_ATTRIBUTE_NAMES, attributeName) >= 0) { boolean booleanAttributeValue = Boolean.valueOf(String.valueOf(attributeValue)); if (booleanAttributeValue) { // TODO - is passing in Boolean.TRUE value documented somewhere? writer.writeAttribute(prefixedAttributeName, Boolean.TRUE, null); } } else { writer.writeAttribute(prefixedAttributeName, attributeValue, null); } }
/** * Encode one pass-thru attribute, with plain/boolean/url value, got from properly component attribute. * * @param context * @param writer * @param attribute * @throws IOException */ public void encodePassThruAttribute(FacesContext context, Map<String, Object> attributes, ResponseWriter writer, String attribute) throws IOException { Object value = attributeValue(attribute, attributes.get(getComponentAttributeName(attribute))); if ((null != value) && RenderKitUtils.shouldRenderAttribute(value)) { if (Arrays.binarySearch(HtmlConstants.PASS_THRU_URI, attribute) >= 0) { String url = context.getApplication().getViewHandler().getResourceURL(context, value.toString()); url = context.getExternalContext().encodeResourceURL(url); writer.writeURIAttribute(attribute, url, attribute); } else { writer.writeAttribute(attribute, value, attribute); } } }
/** * Encode one pass-thru attribute, with plain/boolean/url value, got from properly component attribute. * * @param context * @param writer * @param attribute * @throws IOException */ public void encodePassThruAttribute(FacesContext context, Map<String, Object> attributes, ResponseWriter writer, String attribute) throws IOException { Object value = attributeValue(attribute, attributes.get(getComponentAttributeName(attribute))); if ((null != value) && RenderKitUtils.shouldRenderAttribute(value)) { if (Arrays.binarySearch(HtmlConstants.PASS_THRU_URI, attribute) >= 0) { String url = context.getApplication().getViewHandler().getResourceURL(context, value.toString()); url = context.getExternalContext().encodeResourceURL(url); writer.writeURIAttribute(attribute, url, attribute); } else { writer.writeAttribute(attribute, value, attribute); } } }
/** * Encode one pass-thru attribute, with plain/boolean/url value, got from properly component attribute. * * @param context * @param writer * @param attribute * @throws IOException */ public void encodePassThruAttribute(FacesContext context, Map<String, Object> attributes, ResponseWriter writer, String attribute) throws IOException { Object value = attributeValue(attribute, attributes.get(getComponentAttributeName(attribute))); if ((null != value) && RenderKitUtils.shouldRenderAttribute(value)) { if (Arrays.binarySearch(HtmlConstants.PASS_THRU_URI, attribute) >= 0) { String url = context.getApplication().getViewHandler().getResourceURL(context, value.toString()); url = context.getExternalContext().encodeResourceURL(url); writer.writeURIAttribute(attribute, url, attribute); } else { writer.writeAttribute(attribute, value, attribute); } } }
shouldRenderAttribute(value) ) { responseWriter.writeAttribute("class",value,null);
shouldRenderAttribute(value) ) { responseWriter.writeAttribute("class",value,null);
shouldRenderAttribute(value) ) { responseWriter.writeAttribute("class",value,null);
shouldRenderAttribute(value) ) { responseWriter.writeAttribute("class",value,null);
shouldRenderAttribute(value) ) { responseWriter.writeAttribute("class",value,null);
shouldRenderAttribute(value) ) { responseWriter.writeAttribute("class",value,null);
shouldRenderAttribute(value) ) { responseWriter.writeAttribute("value",value,null);
shouldRenderAttribute(value) ) { responseWriter.writeAttribute("class",value,null);
shouldRenderAttribute(value) ) { responseWriter.writeAttribute("class",value,null);
shouldRenderAttribute(value) ) { responseWriter.writeAttribute("class",value,null);
shouldRenderAttribute(value) ) { responseWriter.writeAttribute("value",value,null);