Refine search
/** * Constructor. * * @param orig the original tag. * @param attributes the tag attributes. */ public Tag(Tag orig, TagAttributes attributes) { this(orig.getLocation(), orig.getNamespace(), orig.getLocalName(), orig .getQName(), attributes); }
private Tag convertToACBodyTag(Tag tag, TagAttributes attributeList) { Tag t = new Tag(tag.getLocation(), ANGULAR_FACES_CORE_NAMESPACE, tag.getLocalName(), tag.getQName(), attributeList); return t; }
/** * <p class="changed_added_2_0">Wrap the argument <code>tag</code> * so the exception can reference its information.</p> * @param tag the <code>Tag</code> that caused this exception. */ public TagException(Tag tag) { super(tag.toString()); }
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 static String print(Tag tag, TagAttribute attr) { return tag.getLocation() + " <" + tag.getQName() + " " + attr.getQName() + "=\"" + attr.getValue() + "\">"; } }
private Tag convertBootsFacesTag(Tag tag) { if (HTML_NAMESPACE.equals(tag.getNamespace())) { String tagname = tag.getLocalName(); if (bootsfacesTags.containsKey(tagname)) { AFTagAttributes modifiedAttributes = new AFTagAttributes(tag.getAttributes().getAll()); Tag t = new Tag(tag.getLocation(), BOOTSFACES_NAMESPACE, tag.getLocalName(), tag.getQName(), modifiedAttributes); return t; } } return tag; } }
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 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; }
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; }
private Tag convertToSelectOneMenuTag(Tag tag, TagAttributes attributeList) { TagAttribute[] attributes = attributeList.getAll(); TagAttributes more = new AFTagAttributes(attributes); Tag t = new Tag(tag.getLocation(), BOOTSFACES_NAMESPACE, "selectOneMenu", "b:selectOneMenu", more); return t; }
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); }
/** * 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); }
private TagAttribute createElementName(Tag tag) { Location location = tag.getLocation(); String ns = Namespace.p.uri; String myLocalName = Renderer.PASSTHROUGH_RENDERER_LOCALNAME_KEY; String qName = "p:" + myLocalName; String value = tag.getLocalName(); return new TagAttributeImpl(location, ns, myLocalName, qName, value); }
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; } }
@Override protected MetaRuleset createMetaRuleset(Class type) { MetaRuleset meta = super.createMetaRuleset(type); if (!UILibrary.NAMESPACE.equals(this.tag.getNamespace()) && !UILibrary.ALIAS_NAMESPACE.equals(this.tag.getNamespace())) { meta.add(new TagMetaData(type)); } meta.alias("class", "styleClass"); return meta; }
private boolean hasJsfAttribute(Tag tag) { for (String ns : tag.getAttributes().getNamespaces()) { if (Namespace.jsf.uri.equals(ns)) { return true; } } return false; }
private String getPrefixFromTag(Tag t) { String result = t.getQName(); if (null != result) { int i; if (-1 != (i = result.indexOf(":"))) { result = result.substring(0, i); } } return result; }
CreateTagsRequest createTagsRequest = new CreateTagsRequest(); .withTags(new Tag("Name", "travel-ecommerce-" + idx)); ec2.createTags(createTagsRequest);
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); } } }