/** * Searches up the parent hierarchy from the given tag * for a Tag matching one or more of given types. * * @param from the tag to start searching from * @param tagClasses an array of types that might match * @return the tag of the given type or null if it could not be found * @see #findAncestorWithClass(Tag,Collection) */ public static Tag findAncestorWithClass(Tag from, Class[] tagClasses) { return findAncestorWithClass(from,Arrays.asList(tagClasses)); }
/** * Searches up the parent hierarchy from the given tag * for a Tag matching one or more of given types. * * @param from the tag to start searching from * @param tagClasses an array of types that might match * @return the tag of the given type or null if it could not be found * @see #findAncestorWithClass(Tag,Collection) */ public static Tag findAncestorWithClass(Tag from, Class[] tagClasses) { return findAncestorWithClass(from,Arrays.asList(tagClasses)); }
/** * Searches up the parent hierarchy from the given tag * for a Tag matching one or more of given types. * * @param from the tag to start searching from * @param tagClasses an array of types that might match * @return the tag of the given type or null if it could not be found * @see #findAncestorWithClass(Tag,Collection) */ public static Tag findAncestorWithClass(Tag from, Class[] tagClasses) { return findAncestorWithClass(from,Arrays.asList(tagClasses)); }
/** * Searches up the parent hierarchy from the given tag * for a Tag matching one or more of given types. * * @param from the tag to start searching from * @param tagClasses an array of types that might match * @return the tag of the given type or null if it could not be found * @see #findAncestorWithClass(Tag,Collection) */ public static Tag findAncestorWithClass(Tag from, Class[] tagClasses) { return findAncestorWithClass(from,Arrays.asList(tagClasses)); }
/** * Searches up the parent hierarchy for a Tag of one of the given types. * @return the tag of the given type or null if it could not be found * @see #findAncestorWithClass(Collection) */ protected Tag findAncestorWithClass(Class[] parentClasses) { return findAncestorWithClass(getParent(),parentClasses); }
/** * Searches up the parent hierarchy for a Tag of one of the given types. * @return the tag of the given type or null if it could not be found */ protected Tag findAncestorWithClass(Collection parentClasses) { return findAncestorWithClass(getParent(),parentClasses); }
/** * Searches up the parent hierarchy for a Tag of one of the given types. * @return the tag of the given type or null if it could not be found */ protected Tag findAncestorWithClass(Collection parentClasses) { return findAncestorWithClass(getParent(),parentClasses); }
/** * Searches up the parent hierarchy for a Tag of the given type. * @return the tag of the given type or null if it could not be found */ protected Tag findAncestorWithClass(Class parentClass) { return findAncestorWithClass(getParent(), parentClass); }
/** * Searches up the parent hierarchy for a Tag of one of the given types. * @return the tag of the given type or null if it could not be found * @see #findAncestorWithClass(Collection) */ protected Tag findAncestorWithClass(Class[] parentClasses) { return findAncestorWithClass(getParent(),parentClasses); }
/** * Searches up the parent hierarchy for a Tag of the given type. * @return the tag of the given type or null if it could not be found */ protected Tag findAncestorWithClass(Class parentClass) { return findAncestorWithClass(getParent(), parentClass); }
/** * Searches up the parent hierarchy for a Tag of the given type. * @return the tag of the given type or null if it could not be found */ protected Tag findAncestorWithClass(Class parentClass) { return findAncestorWithClass(getParent(), parentClass); }
/** * Searches up the parent hierarchy for a Tag of one of the given types. * @return the tag of the given type or null if it could not be found * @see #findAncestorWithClass(Collection) */ protected Tag findAncestorWithClass(Class[] parentClasses) { return findAncestorWithClass(getParent(),parentClasses); }
/** * Searches up the parent hierarchy for a Tag of one of the given types. * @return the tag of the given type or null if it could not be found */ protected Tag findAncestorWithClass(Collection parentClasses) { return findAncestorWithClass(getParent(),parentClasses); }
/** * Searches up the parent hierarchy for a Tag of the given type. * @return the tag of the given type or null if it could not be found */ protected Tag findAncestorWithClass(Class parentClass) { return findAncestorWithClass(getParent(), parentClass); }
/** * Searches up the parent hierarchy for a Tag of one of the given types. * @return the tag of the given type or null if it could not be found * @see #findAncestorWithClass(Collection) */ protected Tag findAncestorWithClass(Class[] parentClasses) { return findAncestorWithClass(getParent(),parentClasses); }
/** * Searches up the parent hierarchy for a Tag of one of the given types. * @return the tag of the given type or null if it could not be found */ protected Tag findAncestorWithClass(Collection parentClasses) { return findAncestorWithClass(getParent(),parentClasses); }
static TimeZone getTimeZone(JellyContext jc, Tag fromTag) { TimeZone tz = null; Tag t = findAncestorWithClass(fromTag, TimeZoneTag.class); if (t != null) { // use time zone from parent <timeZone> tag TimeZoneTag parent = (TimeZoneTag) t; tz = parent.getTimeZone(); } else { // get time zone from configuration setting Object obj = jc.getVariable(Config.FMT_TIME_ZONE); if (obj != null) { if (obj instanceof TimeZone) { tz = (TimeZone) obj; } else { tz = TimeZone.getTimeZone((String) obj); } } } return tz; }
/** * Evaluates this tag after all the tags properties have been initialized. * */ public void doTag(XMLOutput output) throws JellyTagException { MessageTag parent = null; Tag t = findAncestorWithClass(this, MessageTag.class); if (t != null) { parent = (MessageTag) t; } else { // must be nested inside a <fmt:message> action. throw new JellyTagException("must be nested inside a <fmt:message> action."); } Object valueInput = null; if (this.value != null) { valueInput = this.value.evaluate(context); } else { // get value from body valueInput = getBodyText(); } parent.addParam(valueInput); }
Tag t = findAncestorWithClass(this, BundleTag.class); if (t != null) {
Tag parent = findAncestorWithClass(fromTag, BundleTag.class); if (parent != null) {