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 TagAttributes(na)); } return tag; }
private static 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 TagAttributes(a); }
/** * Using no namespace, find the TagAttribute * * @see #get(String, String) * @param localName * tag attribute name * @return the TagAttribute found, otherwise null */ public TagAttribute get(String localName) { return get("", localName); }
public MetaRulesetImpl(Tag tag, Class type) { this.tag = tag; this.type = type; this.attributes = new HashMap(); this.mappers = new ArrayList(); this.rules = new ArrayList(); // setup attributes TagAttribute[] attrs = this.tag.getAttributes().getAll(); for (int i = 0; i < attrs.length; i++) { attributes.put(attrs[i].getLocalName(), attrs[i]); } // add default rules this.rules.add(BeanPropertyTagRule.Instance); }
protected TagAttributes createAttributes(Attributes attrs) { int len = attrs.getLength(); TagAttribute[] ta = new TagAttribute[len]; for (int i = 0; i < len; i++) { ta[i] = new TagAttribute(this.createLocation(), attrs.getURI(i), attrs.getLocalName(i), attrs .getQName(i), attrs.getValue(i)); } return new TagAttributes(ta); }
/** * 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); }
public TagMetaData(Class type) { Set s = new HashSet(); TagAttribute[] ta = tag.getAttributes().getAll(); for (int i = 0; i < ta.length; i++) { if ("class".equals(ta[i].getLocalName())) { s.add("styleClass"); } else { s.add(ta[i].getLocalName()); } } try { PropertyDescriptor[] pd = Introspector.getBeanInfo(type) .getPropertyDescriptors(); for (int i = 0; i < pd.length; i++) { if (pd[i].getWriteMethod() != null) { s.remove(pd[i].getName()); } } } catch (Exception e) { // do nothing } this.attrs = (String[]) s.toArray(new String[s.size()]); }
private Tag trimNSAttributes(Tag tag) { TagAttribute[] attr = tag.getAttributes().getAll(); int remove = 0; for (int i = 0; i < attr.length; i++) { .size()]); return new Tag(tag.getLocation(), tag.getNamespace(), tag .getLocalName(), tag.getQName(), new TagAttributes(attr));
protected MetaRuleset createMetaRuleset(Class type) { TagAttributes attributes = this.tag.getAttributes(); TagAttribute attribute = attributes.get("value"); if (attribute != null && attributes.get("selectedTab") != null) { TagAttribute idAttribute = attributes.get("id"); FacesContext facesContext = FacesContext.getCurrentInstance(); facesContext.getExternalContext().log("selectedTab attribute has been already set for component with id: " + idAttribute != null ? idAttribute.getValue() : null + "[" + attribute.getValue() + "]. value attribute is deprecated and thus has been dropped!"); } return super.createMetaRuleset(type).alias("selectedTab", "value"); }
/** * @param config */ public UserTagHandler(TagConfig config, URL location) { super(config); this.vars = this.tag.getAttributes().getAll(); this.location = location; Iterator itr = this.findNextByType(DefineHandler.class); if (itr.hasNext()) { handlers = new HashMap(); DefineHandler d = null; while (itr.hasNext()) { d = (DefineHandler) itr.next(); this.handlers.put(d.getName(), d); } } else { handlers = null; } }
protected MetaRuleset createMetaRuleset(Class type) { TagAttributes attributes = this.tag.getAttributes(); TagAttribute eventAttribute = attributes.get("event"); TagAttribute showEventAttribute = attributes.get("showEvent"); MetaRuleset ruleset = super.createMetaRuleset(type); if (eventAttribute != null) { if (showEventAttribute != null) { TagAttribute idAttribute = attributes.get("id"); FacesContext facesContext = FacesContext.getCurrentInstance(); facesContext.getExternalContext().log("showEvent attribute has been already set for component with id: " + idAttribute != null ? idAttribute.getValue() : null + "[" + eventAttribute.getValue() + "]. event attribute is deprecated and thus has been dropped!"); ruleset.ignore("event"); } else { ruleset.alias("event", "showEvent"); } } return ruleset; } }
protected MetaRuleset createSubComponentMetaRuleset(Class aClass) { MetaRuleset metaRuleset = super.createMetaRuleset(aClass); TagAttribute [] attrs = tag.getAttributes().getAll(); for (int i = 0; i < attrs.length; i++) { TagAttribute attr = attrs[i]; if (!(attr.getLocalName().equals(Attributes.CONVERTER) || attr.getLocalName().equals(Attributes.VALUE))) { metaRuleset.ignore(attr.getLocalName()); } } return metaRuleset; }
private String[] determineQName(Tag tag) { TagAttribute attr = tag.getAttributes().get("jsfc"); if (attr != null) { if (log.isLoggable(Level.FINE)) { log.fine(attr + " JSF Facelet Compile Directive Found"); } String value = attr.getValue(); String namespace, localName; int c = value.indexOf(':'); if (c == -1) { namespace = this.namespaceManager.getNamespace(""); localName = value; } else { String prefix = value.substring(0, c); namespace = this.namespaceManager.getNamespace(prefix); if (namespace == null) { throw new TagAttributeException(tag, attr, "No Namespace matched for: " + prefix); } localName = value.substring(c + 1); } return new String[] { namespace, localName }; } else { return new String[] { tag.getNamespace(), tag.getLocalName() }; } }
protected MetaRuleset createMetaRuleset(Class aClass) { MetaRuleset metaRuleset = super.createMetaRuleset(aClass); TagAttribute [] attrs = tag.getAttributes().getAll(); for (int i = 0; i < attrs.length; i++) { TagAttribute attr = attrs[i]; if (!attr.getLocalName().equals("rendered")) { metaRuleset.ignore(attr.getLocalName()); } } return metaRuleset; } }
TagAttribute attr = tag.getAttributes().get("type"); if (attr != null) { String t = attr.getValue();
protected MetaRuleset createMetaRuleset(Class aClass) { MetaRuleset metaRuleset = super.createMetaRuleset(aClass); if (UISeparator.class.isAssignableFrom(aClass)) { metaRuleset.ignore(Attributes.LABEL); return metaRuleset; } else { TagAttribute[] attrs = tag.getAttributes().getAll(); for (int i = 0; i < attrs.length; i++) { TagAttribute attr = attrs[i]; metaRuleset.ignore(attr.getLocalName()); } return metaRuleset; } } }
TagAttribute[] attrs = tag.getAttributes().getAll(); if (attrs.length > 0) { for (int i = 0; i < attrs.length; i++) {