public Metadata applyRule(String name, TagAttribute attribute, MetadataTarget meta) { Method m = meta.getWriteMethod(name); // if the property is writable if (m != null) { if (attribute.isLiteral()) { return new LiteralPropertyMetadata(m, attribute); } else { return new DynamicPropertyMetadata(m, attribute); } } return null; }
/** * 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 MetaRuleset createMetaRuleset(Class type) { return super.createMetaRuleset(type).ignore("binding"); } }
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; } }
private final static String print(Tag tag, TagAttribute attr) { return tag.getLocation() + " <" + tag.getQName() + " " + attr.getQName() + "=\"" + attr.getValue() + "\">"; }
private final String getVarStatusName(FaceletContext ctx) { if (this.varStatus != null) { return this.varStatus.getValue(ctx); } return null; }
/** * Delegates to getObject with Object.class as a param * * @see #getObject(FaceletContext, Class) * @param ctx * FaceletContext to use * @return Object representation of this attribute's value */ public Object getObject(FaceletContext ctx) { return this.getObject(ctx, Object.class); }
public TagHandler(TagConfig config) { this.tagId = config.getTagId(); this.tag = config.getTag(); this.nextHandler = config.getNextHandler(); }
/** * 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 void applyMetadata(FaceletContext ctx, Object instance) { for (int i = 0; i < size; i++) { this.mappers[i].applyMetadata(ctx, instance); } }
private MetaRule getSuggestedItemsMethodRule(TagAttribute maxItems) { Class[] paramList = maxItems != null ? new Class[] {String.class, Integer.class} : new Class[]{String.class}; return new MethodRule(SUGGESTED_ITEMS_METHOD_ATTRIBUTE_NAME, List.class, paramList); }
public TagHandler createTagHandler(String ns, String localName, TagConfig tag) throws FacesException { for (int i = 0; i < this.libraries.length; i++) { if (this.libraries[i].containsTagHandler(ns, localName)) { return this.libraries[i].createTagHandler(ns, localName, tag); } } return null; }
private final int getEnd(FaceletContext ctx) { if (this.end != null) { return this.end.getInt(ctx); } return Integer.MAX_VALUE - 1; //hotspot bug in the JVM }
public boolean containsNamespace(String ns) { for (int i = 0; i < this.libraries.length; i++) { if (this.libraries[i].containsNamespace(ns)) { return true; } } return false; }
public TagHandler createHandler(TagConfig cfg) throws FacesException, ELException { return new UserTagHandler(cfg, this.location); } }
public boolean containsFunction(String ns, String name) { for (int i = 0; i < this.libraries.length; i++) { if (this.libraries[i].containsFunction(ns, name)) { return true; } } return false; }
/** * */ public TagAttributeException(Tag tag, TagAttribute attr) { super(print(tag, attr)); }
private final String getVarName(FaceletContext ctx) { if (this.var != null) { return this.var.getValue(ctx); } return null; }
protected MetaRuleset createMetaRuleset(Class type) { return super.createMetaRuleset(type).ignore("binding"); }
private final int getBegin(FaceletContext ctx) { if (this.begin != null) { return this.begin.getInt(ctx); } return 0; }