com.thaiopensource.validate.picl.ChoicePattern Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of jing Show documentation
Show all versions of jing Show documentation
Jing - tool for validating RelaxNG - (OSGi-compatible version)
package com.thaiopensource.validate.picl;
class ChoicePattern extends Pattern {
private final Pattern[] choices;
ChoicePattern(Pattern[] choices) {
this.choices = choices;
}
boolean matches(Path path, int rootDepth) {
for (int i = 0; i < choices.length; i++)
if (choices[i].matches(path, rootDepth))
return true;
return false;
}
public String toString() {
StringBuffer buf = new StringBuffer();
for (int i = 0; i < choices.length; i++) {
if (i != 0)
buf.append('|');
buf.append(choices[i].toString());
}
return buf.toString();
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy