return eq(attr.qName(), value);
}
+ public COMPOSITION lt(QName attr, Object value) {
+ addConstraint(new Lt(attr, value));
+ return composition;
+ }
+
+ public COMPOSITION lt(QNamed attr, Object value) {
+ return lt(attr.qName(), value);
+ }
+
+ public COMPOSITION lte(QName attr, Object value) {
+ addConstraint(new Lte(attr, value));
+ return composition;
+ }
+
+ public COMPOSITION lte(QNamed attr, Object value) {
+ return lte(attr.qName(), value);
+ }
+
+ public COMPOSITION gt(QName attr, Object value) {
+ addConstraint(new Gt(attr, value));
+ return composition;
+ }
+
+ public COMPOSITION gt(QNamed attr, Object value) {
+ return gt(attr.qName(), value);
+ }
+
+ public COMPOSITION gte(QName attr, Object value) {
+ addConstraint(new Gte(attr, value));
+ return composition;
+ }
+
+ public COMPOSITION gte(QNamed attr, Object value) {
+ return gte(attr.qName(), value);
+ }
+
+ public COMPOSITION like(QName attr, String pattern) {
+ addConstraint(new Like(attr, pattern));
+ return composition;
+ }
+
+ public COMPOSITION like(QNamed attr, String pattern) {
+ return like(attr.qName(), pattern);
+ }
+
+ /*
+ * PROPERTIES CONSTRAINTS
+ */
+
public COMPOSITION isDefined(QName attr) {
addConstraint(new IsDefined(attr));
return composition;
* CLASSES
*/
- public static class Not implements Constraint {
- final Constraint negated;
-
- public Not(Constraint negated) {
- this.negated = negated;
- }
-
- public Constraint getNegated() {
- return negated;
- }
-
- }
-
- public static class Eq implements Constraint {
- final QName prop;
- final Object value;
-
- public Eq(QName prop, Object value) {
- super();
- this.prop = prop;
- this.value = value;
- }
-
- public QName getProp() {
- return prop;
- }
-
- public Object getValue() {
- return value;
- }
-
- }
-
- public static class IsDefined implements Constraint {
- final QName prop;
-
- public IsDefined(QName prop) {
- super();
- this.prop = prop;
- }
-
- public QName getProp() {
- return prop;
- }
- }
-
- public static class IsContentClass implements Constraint {
- final QName[] contentClasses;
-
- public IsContentClass(QName[] contentClasses) {
- this.contentClasses = contentClasses;
- }
-
- public IsContentClass(QNamed[] contentClasses) {
- this.contentClasses = new QName[contentClasses.length];
- for (int i = 0; i < contentClasses.length; i++)
- this.contentClasses[i] = contentClasses[i].qName();
- }
-
- public QName[] getContentClasses() {
- return contentClasses;
- }
-
- }
-
// public static void main(String[] args) {
// AndFilter filter = new AndFilter();
// filter.eq(new QName("test"), "test").and().not().eq(new QName("type"), "integer");
--- /dev/null
+package org.argeo.api.acr.search;
+
+import javax.xml.namespace.QName;
+
+/** Whether this property equals this value. */
+public class Eq extends PropertyValueContraint {
+ public Eq(QName prop, Object value) {
+ super(prop, value);
+ }
+}
--- /dev/null
+package org.argeo.api.acr.search;
+
+import javax.xml.namespace.QName;
+
+/** Whether this property is strictly greater than this value. */
+public class Gt extends PropertyValueContraint {
+ public Gt(QName prop, Object value) {
+ super(prop, value);
+ }
+}
--- /dev/null
+package org.argeo.api.acr.search;
+
+import javax.xml.namespace.QName;
+
+/** Whether this property is greater than this value or equal. */
+public class Gte extends PropertyValueContraint {
+ public Gte(QName prop, Object value) {
+ super(prop, value);
+ }
+}
--- /dev/null
+package org.argeo.api.acr.search;
+
+import javax.xml.namespace.QName;
+
+import org.argeo.api.acr.QNamed;
+
+/** Whether the content is all these content classes. */
+public class IsContentClass implements Constraint {
+ final QName[] contentClasses;
+
+ public IsContentClass(QName[] contentClasses) {
+ this.contentClasses = contentClasses;
+ }
+
+ public IsContentClass(QNamed[] contentClasses) {
+ this.contentClasses = new QName[contentClasses.length];
+ for (int i = 0; i < contentClasses.length; i++)
+ this.contentClasses[i] = contentClasses[i].qName();
+ }
+
+ public QName[] getContentClasses() {
+ return contentClasses;
+ }
+
+}
--- /dev/null
+package org.argeo.api.acr.search;
+
+import javax.xml.namespace.QName;
+
+/** Whether this property is defined. */
+public class IsDefined implements Constraint {
+ final QName prop;
+
+ public IsDefined(QName prop) {
+ this.prop = prop;
+ }
+
+ public QName getProp() {
+ return prop;
+ }
+}
--- /dev/null
+package org.argeo.api.acr.search;
+
+import javax.xml.namespace.QName;
+
+/** Whether this property equals this value. */
+public class Like extends PropertyValueContraint {
+ public Like(QName prop, String pattern) {
+ super(prop, pattern);
+ }
+}
--- /dev/null
+package org.argeo.api.acr.search;
+
+import javax.xml.namespace.QName;
+
+/** Whether this property is strictly less than this value. */
+public class Lt extends PropertyValueContraint {
+ public Lt(QName prop, Object value) {
+ super(prop, value);
+ }
+}
--- /dev/null
+package org.argeo.api.acr.search;
+
+import javax.xml.namespace.QName;
+
+/** Whether this property is less than this value or equal. */
+public class Lte extends PropertyValueContraint {
+ public Lte(QName prop, Object value) {
+ super(prop, value);
+ }
+}
--- /dev/null
+package org.argeo.api.acr.search;
+
+/** Negates the provided constraint. */
+public class Not implements Constraint {
+ final Constraint negated;
+
+ public Not(Constraint negated) {
+ this.negated = negated;
+ }
+
+ public Constraint getNegated() {
+ return negated;
+ }
+
+}
--- /dev/null
+package org.argeo.api.acr.search;
+
+import javax.xml.namespace.QName;
+
+/** Whether this property equals this value. */
+public abstract class PropertyValueContraint implements Constraint {
+ final QName prop;
+ final Object value;
+
+ public PropertyValueContraint(QName prop, Object value) {
+ this.prop = prop;
+ this.value = value;
+ }
+
+ public QName getProp() {
+ return prop;
+ }
+
+ public Object getValue() {
+ return value;
+ }
+
+}
Thread thread, Throwable thrown, StackTraceElement callLocation) {
assert level != null;
assert logger != null;
- assert msg != null;
+// assert msg != null;
assert instant != null;
assert thread != null;
+ if (msg == null)
+ msg = "null";
+
final long sequence = nextEntry.incrementAndGet();
Map<String, Serializable> logEntry = new LogEntryMap(sequence);