public void findNamedResource(String name, String... pathNames) { if (pathNames == null) return; Test test = new NameIs(name); for (String pkg : pathNames) { findInPackage(test, pkg); } }
/** * Converted object from variable translation. * * @param open * @param expression * @param stack * @param asType * @return Converted object from variable translation. */ public static Object translateVariables(char open, String expression, ValueStack stack, Class asType) { return translateVariables(open, expression, stack, asType, null); }
/** * Calls {@link #findText(Class aClass, String aTextName, Locale locale, String defaultMessage, Object[] args)} * with aTextName as the default message. * * @see #findText(Class aClass, String aTextName, Locale locale, String defaultMessage, Object[] args) */ public static String findText(Class aClass, String aTextName, Locale locale) { return findText(aClass, aTextName, locale, aTextName, new Object[0]); }
/** * Allows <code>paramNames</code> attribute to be set as comma-separated-values (csv). * * @param paramNames the paramNames to set */ public void setParamNames(String paramNames) { this.paramNames = TextParseUtil.commaDelimitedStringToSet(paramNames); }
/** * Attempts to discover classes that are annotated with to the annotation. Accumulated * classes can be accessed by calling {@link #getClasses()}. * * @param annotation the annotation that should be present on matching classes * @param packageNames one or more package names to scan (including subpackages) for classes */ public void findAnnotated(Class<? extends Annotation> annotation, String... packageNames) { if (packageNames == null) return; Test test = new AnnotatedWith(annotation); for (String pkg : packageNames) { findInPackage(test, pkg); } }
public void push(Object o) { add(0, o); } }
/** * Attempts to discover classes who's name ends with the provided suffix. Accumulated classes can be * accessed by calling {@link #getClasses()}. * * @param suffix The class name suffix to match * @param packageNames one or more package names to scan (including subpackages) for classes */ public void findSuffix(String suffix, String... packageNames) { if (packageNames == null) return; Test test = new NameEndsWith(suffix); for (String pkg : packageNames) { findInPackage(test, pkg); } }
public Filter(String pattern, boolean allow) { this.pattern = WildcardUtil.compileWildcardPattern(pattern); this.allow = allow; } }
@Override protected void tearDown() throws Exception { XWorkTestCaseHelper.tearDown(configurationManager); configurationManager = null; configuration = null; container = null; actionProxyFactory = null; }
/** * @see com.opensymphony.xwork2.util.ValueStack#size() */ public int size() { return root.size(); }
/** * @see com.opensymphony.xwork2.util.ValueStack#pop() */ public Object pop() { return root.pop(); }
@Element(value = Object.class) public Map getMap() { return map; } }
/** * @see #translateVariablesCollection(char[], String, ValueStack, boolean, ParsedValueEvaluator, int) * * @param expression * @param stack * @param excludeEmptyElements * @param evaluator * @return */ public static Collection<String> translateVariablesCollection(String expression, ValueStack stack, boolean excludeEmptyElements, ParsedValueEvaluator evaluator) { return translateVariablesCollection(new char[]{'$', '%'}, expression, stack, excludeEmptyElements, evaluator, MAX_RECURSION); }
/** * @see com.opensymphony.xwork2.util.ValueStack#peek() */ public Object peek() { return root.peek(); }
/** * @see com.opensymphony.xwork2.util.ValueStack#push(java.lang.Object) */ public void push(Object o) { root.push(o); }
/** * Creates a W3C Document that remembers the location of each element in * the source file. The location of element nodes can then be retrieved * using the {@link #getLocationObject(Element)} method. * * @param inputSource the inputSource to read the document from */ public static Document parse(InputSource inputSource) { return parse(inputSource, null); }
/** * Construct a new instance of this DOMBuilder. */ public DOMBuilder(SAXTransformerFactory factory, Node parentNode) { this.factory = factory == null? FACTORY: factory; this.parentNode = parentNode; setup(); }
public void setExcludeMethods(String excludeMethods) { this.excludeMethods = TextParseUtil.commaDelimitedStringToSet(excludeMethods); }
/** * Parse <code>expression</code> passed in against value stack. * * @param expression an OGNL expression * @param type type to return * @return Object */ protected Object parse(String expression, Class type) { if (expression == null) { return null; } return TextParseUtil.translateVariables('$', expression, stack, type); }
/** * Finds a localized text message for the given key, aTextName, in the specified resource bundle * with aTextName as the default message. * <p/> * If a message is found, it will also be interpolated. Anything within <code>${...}</code> * will be treated as an OGNL expression and evaluated as such. * * @see #findText(java.util.ResourceBundle, String, java.util.Locale, String, Object[]) */ public static String findText(ResourceBundle bundle, String aTextName, Locale locale) { return findText(bundle, aTextName, locale, aTextName, new Object[0]); }