/** * Returns an enumerator for accessing the set of selectors. * @return an enumerator that goes through each of the selectors */ @Override public Enumeration<FileSelector> selectorElements() { if (isReference()) { return getRef().selectorElements(); } return super.selectorElements(); }
/** * Verify that a pattern specifies files deeper * than the level of the specified file. * @param pattern the pattern to check. * @param name the name to check. * @return whether the pattern is deeper than the name. * @since Ant 1.6.3 */ private boolean isDeeper(final TokenizedPattern pattern, final TokenizedPath name) { return pattern.containsPattern(SelectorUtils.DEEP_TREE_MATCH) || pattern.depth() > name.depth(); }
/** * Gives the count of the number of selectors in this container * @return the number of selectors in this container */ @Override public int selectorCount() { if (isReference()) { return getRef().selectorCount(); } return super.selectorCount(); }
/** * Returns the set of selectors as an array. * @param p the current project * @return an array of selectors in this container */ @Override public FileSelector[] getSelectors(Project p) { if (isReference()) { return getRef().getSelectors(p); } return super.getSelectors(p); }
/** * Indicates whether there are any selectors here. * @return whether any selectors are in this container */ @Override public boolean hasSelectors() { if (isReference()) { return getRef().hasSelectors(); } return super.hasSelectors(); }
/** * removes from a pattern all tokens to the right containing wildcards * @param input the input string * @return the leftmost part of the pattern without wildcards */ public static String rtrimWildcardTokens(String input) { return new TokenizedPattern(input).rtrimWildcardTokens().toString(); } }
/** * Add a new selector into this container. * * @param selector the new selector to add */ @Override public void appendSelector(FileSelector selector) { if (isReference()) { throw noChildrenAllowed(); } super.appendSelector(selector); }
/** * Makes sure that there is only one entry, sets an error message if * not. */ public void verifySettings() { if (selectorCount() != 1) { setError( "One and only one selector is allowed within the <not> tag"); } }
/** * add a selector size entry on the selector list * @param selector the selector to add */ public void addSize(SizeSelector selector) { appendSelector(selector); }
/** * add an "Or" selector entry on the selector list * @param selector the selector to add */ public void addOr(OrSelector selector) { appendSelector(selector); }
/** * Checks to make sure all settings are kosher. In this case, it * means that the pattern attribute has been set. * */ public void verifySettings() { if (contains == null) { setError("The text attribute is required"); } }
/** * Checks to make sure all settings are kosher. In this case, it * means that the pattern attribute has been set. * */ @Override public void verifySettings() { if (type == null) { setError("The type attribute is required"); } }
/** * add a selector filename entry on the selector list * @param selector the selector to add */ public void addFilename(FilenameSelector selector) { appendSelector(selector); }
/** * add a regular expression selector entry on the selector list * @param selector the selector to add */ public void addContainsRegexp(ContainsRegexpSelector selector) { appendSelector(selector); }
/** * adds a different selector to the selector list * @param selector the selector to add */ public void addDifferent(DifferentSelector selector) { appendSelector(selector); }
/** * @param e ExecutableSelector * @since 1.10.0 */ public void addExecutable(ExecutableSelector e) { appendSelector(e); }
/** * adds a type selector to the selector list * @param selector the selector to add */ public void addType(TypeSelector selector) { appendSelector(selector); }
/** * adds a type selector to the selector list * @param selector the selector to add */ public void addType(TypeSelector selector) { appendSelector(selector); }
/** * @param e ExecutableSelector * @since 1.10.0 */ public void addExecutable(ExecutableSelector e) { appendSelector(e); }
/** * @param e SymlinkSelector * @since 1.10.0 */ public void addSymlink(SymlinkSelector e) { appendSelector(e); }