public ContextAwareTagValueExpression(TagAttribute tagAttribute, ValueExpression valueExpression) { _location = tagAttribute.getLocation(); _qName = tagAttribute.getQName(); _wrapped = valueExpression; }
public ContextAwareTagMethodExpression(TagAttribute tagAttribute, MethodExpression methodExpression) { _location = tagAttribute.getLocation(); _qName = tagAttribute.getQName(); _wrapped = methodExpression; }
private void replaceAttr(List<TagAttribute> attrs, TagAttribute attr, String value, String search, String replace) { if (search.equals(attr.getQName())) { attrs.set(attrs.indexOf(attr), new TagAttributeImpl( attr.getLocation(), attr.getNamespace(), replace, replace, value)); } } }
private void replaceAttr(List<TagAttribute> attrs, TagAttribute attr, String value, String search, String replace) { if (search.equals(attr.getQName())) { attrs.set(attrs.indexOf(attr), new TagAttributeImpl( attr.getLocation(), attr.getNamespace(), replace, replace, value)); } } }
public void replaceAttribute(String old, String replacement) { for (int i = 0; i < attrs.length;i++) { TagAttribute a = attrs[i]; if (a.getLocalName().equals(old)) { a = TagAttributeUtilities.createTagAttribute(a.getLocation(), JSF_NAMESPACE, replacement, replacement, a.getValue()); attrs[i] = a; } } }
public void replaceAttributeValue(String name, String newValue) { for (int i = 0; i < attrs.length;i++) { TagAttribute a = attrs[i]; if (a.getLocalName().equals(name)) { a = TagAttributeUtilities.createTagAttribute(a.getLocation(), JSF_NAMESPACE, name, a.getQName(), newValue); attrs[i] = a; } } }
public void replaceAttributeValue(String name, String newValue) { for (int i = 0; i < attrs.length;i++) { TagAttribute a = attrs[i]; if (a.getLocalName().equals(name)) { a = TagAttributeUtilities.createTagAttribute(a.getLocation(), JSF_NAMESPACE, name, a.getQName(), newValue); attrs[i] = a; } } }
public void replaceAttribute(String old, String replacement) { for (int i = 0; i < attrs.length;i++) { TagAttribute a = attrs[i]; if (a.getLocalName().equals(old)) { a = TagAttributeUtilities.createTagAttribute(a.getLocation(), JSF_NAMESPACE, replacement, replacement, a.getValue()); attrs[i] = a; } } }
modifiedValue = modifiedValue.replace(exp, "#" + exp.substring(1, exp.length() - 1)); if ("value".equals(a.getLocalName())) { TagAttribute modifiedAttribute = TagAttributeUtilities.createTagAttribute(a.getLocation(), PASS_THROUGH_NAMESPACE, "ng-model", "ng-model", exp.substring(2, exp.length() - 2)); modified.add(modifiedAttribute); if (a.getLocalName().startsWith("ng-")) { modifiedAttribute = TagAttributeUtilities.createTagAttribute(a.getLocation(), PASS_THROUGH_NAMESPACE, a.getLocalName(), a.getLocalName(), modifiedValue); hasChanges = true; } else { modifiedAttribute = TagAttributeUtilities.createTagAttribute(a.getLocation(), a.getNamespace(), a.getLocalName(), a.getQName(), modifiedValue);
modifiedValue = modifiedValue.replace(exp, "#" + exp.substring(1, exp.length() - 1)); if ("value".equals(a.getLocalName())) { TagAttribute modifiedAttribute = TagAttributeUtilities.createTagAttribute(a.getLocation(), PASS_THROUGH_NAMESPACE, "ng-model", "ng-model", exp.substring(2, exp.length() - 2)); modified.add(modifiedAttribute); if (a.getLocalName().startsWith("ng-")) { modifiedAttribute = TagAttributeUtilities.createTagAttribute(a.getLocation(), PASS_THROUGH_NAMESPACE, a.getLocalName(), a.getLocalName(), modifiedValue); hasChanges = true; hasChanges=true; modifiedAttribute = TagAttributeUtilities.createTagAttribute(a.getLocation(), a.getNamespace(), a.getLocalName(), a.getQName(), modifiedValue);
protected TagAttribute convertTagAttribute(TagAttribute attribute) { Location location = attribute.getLocation(); String ns = attribute.getNamespace(); String myLocalName = attribute.getLocalName(); String qName; String value = attribute.getValue(); if (Namespace.jsf.uri.equals(attribute.getNamespace())) { // make this a component attribute qName = myLocalName; ns = ""; } else { if (ns.length() != 0 && !ns.equals(attribute.getTag().getNamespace())) { // the attribute has a different namespace than the tag. preserve it. return attribute; } if (attribute.getLocalName().equals(otherHtmlIdAttribute)) { // special case for input name qName = "id"; myLocalName = "id"; } else { // make this a pass through attribute qName = "p:" + myLocalName; ns = Namespace.p.uri; } } return new TagAttributeImpl(location, ns, myLocalName, qName, value); } }
protected TagAttribute convertTagAttribute(TagAttribute attribute) { Location location = attribute.getLocation(); String ns = attribute.getNamespace(); String myLocalName = attribute.getLocalName(); String qName; String value = attribute.getValue(); if (Namespace.jsf.uri.equals(attribute.getNamespace())) { // make this a component attribute qName = myLocalName; ns = ""; } else { if (ns.length() != 0 && !ns.equals(attribute.getTag().getNamespace())) { // the attribute has a different namespace than the tag. preserve it. return attribute; } if (attribute.getLocalName().equals(otherHtmlIdAttribute)) { // special case for input name qName = "id"; myLocalName = "id"; } else { // make this a pass through attribute qName = "p:" + myLocalName; ns = Namespace.p.uri; } } return new TagAttributeImpl(location, ns, myLocalName, qName, value); } }
protected TagAttribute convertTagAttribute(TagAttribute attribute) { Location location = attribute.getLocation(); String ns = attribute.getNamespace(); String myLocalName = attribute.getLocalName(); String qName; String value = attribute.getValue(); if (Namespace.jsf.uri.equals(attribute.getNamespace())) { // make this a component attribute qName = myLocalName; ns = ""; } else { if (ns.length() != 0 && !ns.equals(attribute.getTag().getNamespace())) { // the attribute has a different namespace than the tag. preserve it. return attribute; } if (attribute.getLocalName().equals(otherHtmlIdAttribute)) { // special case for input name qName = "id"; myLocalName = "id"; } else { // make this a pass through attribute qName = "p:" + myLocalName; ns = Namespace.p.uri; } } return new TagAttributeImpl(location, ns, myLocalName, qName, value); } }
protected TagAttribute convertTagAttribute(TagAttribute attribute) { Location location = attribute.getLocation(); String ns = attribute.getNamespace(); String myLocalName = attribute.getLocalName(); String qName; String value = attribute.getValue(); if (Namespace.jsf.uri.equals(attribute.getNamespace())) { // make this a component attribute qName = myLocalName; ns = ""; } else { if (ns.length() != 0 && !ns.equals(attribute.getTag().getNamespace())) { // the attribute has a different namespace than the tag. preserve it. return attribute; } if (attribute.getLocalName().equals(otherHtmlIdAttribute)) { // special case for input name qName = "id"; myLocalName = "id"; } else { // make this a pass through attribute qName = "p:" + myLocalName; ns = Namespace.p.uri; } } return new TagAttributeImpl(location, ns, myLocalName, qName, value); } }
protected TagAttribute convertTagAttribute(TagAttribute attribute) { Location location = attribute.getLocation(); String ns = attribute.getNamespace(); String myLocalName = attribute.getLocalName(); String qName; String value = attribute.getValue(); if (Namespace.jsf.uri.equals(attribute.getNamespace())) { // make this a component attribute qName = myLocalName; ns = ""; } else { if (ns.length() != 0 && !ns.equals(attribute.getTag().getNamespace())) { // the attribute has a different namespace than the tag. // preserve it. return attribute; } if (attribute.getLocalName().equals(otherHtmlIdAttribute)) { // special case for input name qName = "id"; myLocalName = "id"; } else { // make this a pass through attribute qName = "h:" + myLocalName; ns = Namespace.h.uri; } } return TagAttributeUtilities.createTagAttribute(location, ns, myLocalName, qName, value); } }
protected TagAttribute convertTagAttribute(TagAttribute attribute) { Location location = attribute.getLocation(); String ns = attribute.getNamespace(); String myLocalName = attribute.getLocalName(); String qName; String value = attribute.getValue(); if (Namespace.jsf.uri.equals(attribute.getNamespace())) { // make this a component attribute qName = myLocalName; ns = ""; } else { if (ns.length() != 0 && !ns.equals(attribute.getTag().getNamespace())) { // the attribute has a different namespace than the tag. // preserve it. return attribute; } if (attribute.getLocalName().equals(otherHtmlIdAttribute)) { // special case for input name qName = "id"; myLocalName = "id"; } else { // make this a pass through attribute qName = "h:" + myLocalName; ns = Namespace.h.uri; } } return TagAttributeUtilities.createTagAttribute(location, ns, myLocalName, qName, value); } }
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); }
protected TagAttribute convertTagAttribute(TagAttribute attribute) { Location location = attribute.getLocation(); String ns = attribute.getNamespace(); String myLocalName = attribute.getLocalName(); String qName; String value = attribute.getValue(); if (Namespace.jsf.uri.equals(attribute.getNamespace())) { // make this a component attribute qName = myLocalName; ns = ""; } else { if (ns.length() != 0 && !ns.equals(attribute.getTag().getNamespace())) { // the attribute has a different namespace than the tag. // preserve it. return attribute; } if (attribute.getLocalName().equals(otherHtmlIdAttribute)) { // special case for input name qName = "id"; myLocalName = "id"; } else { // make this a pass through attribute qName = "p:" + myLocalName; ns = Namespace.p.uri; } } return TagAttributeUtilities.createTagAttribute(location, ns, myLocalName, qName, value); } }
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() + ","; if (attr.getNamespace()==null || attr.getNamespace().equals("")) { if ("id".equals(attr.getLocalName())) { all[i] = TagAttributeUtilities.createTagAttribute(attr.getLocation(), "", attr.getLocalName(), attr.getQName(), attr.getValue()); } else { all[i] = TagAttributeUtilities.createTagAttribute(attr.getLocation(), PASS_THROUGH_NAMESPACE, attr.getLocalName(), attr.getQName(), attr.getValue()); } } else { all[i] = TagAttributeUtilities.createTagAttribute(attr.getLocation(), attr.getNamespace(), 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); }
qname = tagAttribute.getLocalName(); convertedTagAttributes[j] = new TagAttributeImpl(tagAttribute.getLocation(), convertedNamespace, tagAttribute.getLocalName(), qname, tagAttribute.getValue()); qname = "p:"+tagAttribute.getLocalName(); convertedTagAttributes[j] = new TagAttributeImpl(tagAttribute.getLocation(), convertedNamespace, tagAttribute.getLocalName(), qname, tagAttribute.getValue()); qname = "p:"+tagAttribute.getLocalName(); convertedTagAttributes[j] = new TagAttributeImpl(tagAttribute.getLocation(), convertedNamespace, tagAttribute.getLocalName(), qname, tagAttribute.getValue());