public abstract class Keywords
extends java.lang.Object
TestDescription.getKeywordTable()
Modifier and Type | Class and Description |
---|---|
static class |
Keywords.Fault
An exception used to report errors while using a Keywords object.
|
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
ALL_OF
A constant to indicate that all of a list of keywords should be matched.
|
static java.lang.String |
ANY_OF
A constant to indicate that any of a list of keywords should be matched.
|
static java.lang.String |
EXPR
A constant to indicate that an expression keyword should be matched.
|
Constructor and Description |
---|
Keywords() |
Modifier and Type | Method and Description |
---|---|
abstract boolean |
accepts(java.util.Set s)
Check if this keywords object accepts, or matches, the specified
set of words.
|
static Keywords |
create(java.lang.String type,
java.lang.String text)
Create a keywords object.
|
static Keywords |
create(java.lang.String type,
java.lang.String text,
java.util.Set validKeywords)
Create a keywords object.
|
static void |
setAllowNumericKeywords(boolean allowNumericKeywords)
Allow keywords to begin with a numeric or not.
|
public static final java.lang.String ALL_OF
public static final java.lang.String ANY_OF
public static final java.lang.String EXPR
public static Keywords create(java.lang.String type, java.lang.String text) throws Keywords.Fault
type
- one of ALL_OF, ANY_OF, or EXPRtext
- if the type is one of "all of" or "any of", text should
be a white-space separated list of keywords; if type is "expr",
text should be a boolean valued expression formed from
keywords, '&' (and), '|' (or), '!' (not) and '(' ')' (parentheses).Keywords.Fault
- if there are errors in the arguments.public static Keywords create(java.lang.String type, java.lang.String text, java.util.Set validKeywords) throws Keywords.Fault
type
- one of ALL_OF, ANY_OF, or EXPRtext
- if the type is one of "all of" or "any of", text should
be a white-space separated list of keywords; if type is "expr",
text should be a boolean valued expression formed from
keywords, '&' (and), '|' (or), '!' (not) and '(' ')' (parentheses).validKeywords
- a set of valid keywords for this test suite,
or null.
If not null, all the keywords in text must be in this set.Keywords.Fault
- if there are errors in the arguments.public static void setAllowNumericKeywords(boolean allowNumericKeywords)
allowNumericKeywords
- Value to be set.public abstract boolean accepts(java.util.Set s)
s
- A set of words to compare against the keywords object.Copyright (c) 1996, 2011, Oracle and/or its affiliates. All rights reserved.