Refine search
private boolean containsAdvancesSearchExpression(Tag tag, String attribute) { boolean changeIt=false; TagAttribute forAttribute = tag.getAttributes().get(attribute); if (null != forAttribute) { String value = forAttribute.getValue(); if (value.contains("*")) changeIt=true; if (value.contains("@")) changeIt=true; if (value.equals("@form") || value.equals("@none") || value.equals("@this") || value.equals("@all")) changeIt=false; if (value.startsWith("#{")) changeIt=false; } return changeIt; }
public static void copyPassthroughAttributes(FaceletContext ctx, UIComponent c, Tag t) { if (null == c || null == t) { return; } TagAttribute[] passthroughAttrs = t.getAttributes().getAll(PassThroughAttributeLibrary.Namespace); if (null != passthroughAttrs && 0 < passthroughAttrs.length) { Map<String, Object> componentPassthroughAttrs = c.getPassThroughAttributes(true); Object attrValue = null; for (TagAttribute cur : passthroughAttrs) { attrValue = (cur.isLiteral()) ? cur.getValue(ctx) : cur.getValueExpression(ctx, Object.class); componentPassthroughAttrs.put(cur.getLocalName(), attrValue); } } }
private boolean hasJsfAttribute(Tag tag) { for (String ns : tag.getAttributes().getNamespaces()) { if (Namespace.jsf.uri.equals(ns)) { return true; } } return false; }
private Tag trimJSFCAttribute(Tag tag) { TagAttribute attr = tag.getAttributes().get("jsfc"); if (attr != null) { TagAttribute[] oa = tag.getAttributes().getAll(); TagAttribute[] na = new TagAttribute[oa.length - 1]; int p = 0; for (int i = 0; i < oa.length; i++) { if (!"jsfc".equals(oa[i].getLocalName())) { na[p++] = oa[i]; } } return new Tag(tag, new TagAttributesImpl(na)); } return tag; }
/** * Utility method for fetching the appropriate TagAttribute * * @param localName * name of attribute * @return TagAttribute if found, otherwise null */ protected final TagAttribute getAttribute(String localName) { return this.tag.getAttributes().get(localName); }
protected Tag convertTag(Tag tag, Namespace namespace, String localName) { Location location = tag.getLocation(); String ns = namespace.uri; String qName = namespace.name() + ":" + localName; TagAttributes attributes = convertAttributes(tag.getAttributes()); Tag converted = new Tag(location, ns, localName, qName, attributes); for (TagAttribute tagAttribute : attributes.getAll()) { // set the correct tag tagAttribute.setTag(converted); } return converted; }
private Tag convertDivElementToPanelGroup(Tag tag, TagAttributes modifiedAttributes, boolean isDiv) { TagAttribute[] attributes = modifiedAttributes.getAll(); TagAttributes more = addBlockAttributeIfNeeded(tag, isDiv, attributes); Tag t = new Tag(tag.getLocation(), JSF_NAMESPACE, "panelGroup", "h:panelGroup", more); return t; }
private Tag generateTagIfNecessary(Tag tag, TagAttributes modifiedAttributes) { TagAttribute id = tag.getAttributes().get("", "id"); if (null != id || modifiedAttributes != tag.getAttributes()) { if (tag.getLocalName().equals("div") && modifiedAttributes instanceof AFTagAttributes) { return generatePuiHtmlTag(tag, modifiedAttributes, "puiDiv"); } else if (tag.getLocalName().equals("span") && modifiedAttributes instanceof AFTagAttributes) { return generatePuiHtmlTag(tag, modifiedAttributes, "puiSpan"); } else return new Tag(tag.getLocation(), tag.getNamespace(), tag.getLocalName(), tag.getQName(), modifiedAttributes); } return null; }
private Tag generatePuiHtmlTag(Tag tag, TagAttributes modifiedAttributes, final String htmlTag) { String keys = ""; TagAttribute[] all = modifiedAttributes.getAll(); for (int i = 0; i < all.length; i++) { TagAttribute attr = all[i]; keys += attr.getLocalName() + ","; all[i] = TagAttributeUtilities.createTagAttribute(attr.getLocation(), PASS_THROUGH_NAMESPACE, attr.getLocalName(), attr.getQName(), attr.getValue()); } if (keys.endsWith(",")) keys = keys.substring(0, keys.length() - 1); ((AFTagAttributes) modifiedAttributes).addAttribute(tag.getLocation(), ANGULAR_FACES_CORE_NAMESPACE, "attributeNames", "attributeNames", keys); return new Tag(tag.getLocation(), ANGULAR_FACES_CORE_NAMESPACE, htmlTag, htmlTag, modifiedAttributes); }
public MetaRulesetImpl(Tag tag, Class<?> type) { _tag = tag; _type = type; _attributes = new HashMap<String, TagAttribute>(); _mappers = new ArrayList<Metadata>(); _rules = new ArrayList<MetaRule>(); // setup attributes for (TagAttribute attribute : _tag.getAttributes().getAll()) { _attributes.put(attribute.getLocalName(), attribute); } // add default rules _rules.add(BeanPropertyTagRule.Instance); }
private Tag convertToPuiMessagesTag(Tag tag, TagAttributes attributeList) { if (tag.getNamespace().equals(PRIMEFACES_NAMESPACE)) { AFTagAttributes modifiedAttributes = new AFTagAttributes(attributeList.getAll()); modifiedAttributes.addAttribute(tag.getLocation(), PASS_THROUGH_NAMESPACE, "primefaces", "primefaces", "true"); Tag t = new Tag(tag.getLocation(), HTML_NAMESPACE, "puimessages", "puimessages", modifiedAttributes); return t; } else { Tag t = new Tag(tag.getLocation(), HTML_NAMESPACE, "puimessages", "puimessages", attributeList); return t; } }
for (String namespace : tag.getAttributes().getNamespaces()) if (EMPTY_NAMESPACE.equals(tag.getNamespace()) || XHTML_NAMESPACE.equals(tag.getNamespace())) String localName = tag.getLocalName();
public TagAttributesAlloyImpl(TagAttributes tagAttributes) { TagAttribute[] tagAttributesArray = tagAttributes.getAll(); for (TagAttribute tagAttribute : tagAttributesArray) { String localName = tagAttribute.getLocalName(); if (!Renderer.PASSTHROUGH_RENDERER_LOCALNAME_KEY.equals(localName)) { String namespace = tagAttribute.getNamespace(); String mapKey = getMapKey(namespace, localName); this.tagAttributeMap.put(mapKey, tagAttribute); } } }
protected TagAttributes convertAttributes(TagAttributes original) { Map<String, TagAttribute> attributes = new HashMap<String, TagAttribute>(); TagAttribute elementName = createElementName(original.getTag()); attributes.put(elementName.getQName(), elementName); for (TagAttribute attribute : original.getAll()) { TagAttribute converted = convertTagAttribute(attribute); // avoid duplicates attributes.put(converted.getQName(), converted); } return new TagAttributesImpl(attributes.values().toArray(new TagAttribute[attributes.size()])); }
private TagAttributes removeType(TagAttributes attrs) { TagAttribute[] o = attrs.getAll(); TagAttribute[] a = new TagAttribute[o.length - 1]; int p = 0; for (int i = 0; i < o.length; i++) { if (!"type".equals(o[i].getLocalName())) { a[p++] = o[i]; } } return new TagAttributesImpl(a); }
protected TagAttributes convertAttributes(TagAttributes original, Tag element) { Map<String, TagAttribute> attributes = new HashMap<String, TagAttribute>(); TagAttribute elementName = createElementName(element); attributes.put(elementName.getQName(), elementName); for (TagAttribute attribute : original.getAll()) { TagAttribute converted = convertTagAttribute(attribute); // avoid duplicates attributes.put(converted.getQName(), converted); } return new AFTagAttributes(attributes.values().toArray(new TagAttribute[attributes.size()])); }
public PageResourceHandler(TagConfig config) { super(config); this.config = config; name = getAttribute("name"); type = getAttribute("type"); flavor = getAttribute("flavor"); target = getAttribute("target"); includeTimestamp = getAttribute("includeTimestamp"); vars = tag.getAttributes().getAll(); }
protected TagAttribute getAttribute(String name) { return attributes.get(name); }
private Tag trimJSFCAttribute(Tag tag) { TagAttribute attr = tag.getAttributes().get("jsfc"); if (attr != null) { TagAttribute[] oa = tag.getAttributes().getAll(); TagAttribute[] na = new TagAttribute[oa.length - 1]; int p = 0; for (int i = 0; i < oa.length; i++) { if (!"jsfc".equals(oa[i].getLocalName())) { na[p++] = oa[i]; } } return new Tag(tag, new TagAttributesImpl(na)); } return tag; }