java.lang.Object
javax0.jamal.assertions.NumericAsserts
- All Implemented Interfaces:
javax0.jamal.api.Identified,javax0.jamal.api.Macro,javax0.jamal.api.ServiceLoaded
- Direct Known Subclasses:
NumericAsserts.AssertGreater,NumericAsserts.AssertGreaterOrEqual,NumericAsserts.AssertIntEquals,NumericAsserts.AssertLess,NumericAsserts.AssertLessOrEqual
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic classstatic classstatic classstatic classstatic classstatic classstatic classNested classes/interfaces inherited from interface javax0.jamal.api.Identified
javax0.jamal.api.Identified.UndefinedNested classes/interfaces inherited from interface javax0.jamal.api.Macro
javax0.jamal.api.Macro.Stateful -
Field Summary
Fields inherited from interface javax0.jamal.api.Identified
DEFAULT_MACRO, MACRO_NAME_ARG1, MACRO_NAME_ARG2Fields inherited from interface javax0.jamal.api.Macro
FETCH -
Method Summary
Modifier and TypeMethodDescriptionevaluate(javax0.jamal.api.Input input, javax0.jamal.api.Processor processor) getId()The implementation of the naming assumes that the name of the class looks likeAsserXXXwhereAssertis a six character prefix, usually it is literally'Assert'and it is followed by the name of the assertion.protected abstract booleantest(int p0, int p1) protected booleanChild classes have to implement this method.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface javax0.jamal.api.Macro
fetch, getIds, prefetch
-
Method Details
-
test
protected abstract boolean test(int p0, int p1) -
test
Child classes have to implement this method.- Parameters:
parts- the parts that have at leastN-1parts. If there were not enough parts an exception was already thrown and this method is not invoked.- Returns:
trueif the assertion is okay andfalseotherwise. This method should not care about trimming or negation, it is done before and after the method was executed.- Throws:
javax0.jamal.api.BadSyntax
-
evaluate
public String evaluate(javax0.jamal.api.Input input, javax0.jamal.api.Processor processor) throws javax0.jamal.api.BadSyntax - Specified by:
evaluatein interfacejavax0.jamal.api.Macro- Throws:
javax0.jamal.api.BadSyntax
-
getId
The implementation of the naming assumes that the name of the class looks likeAsserXXXwhereAssertis a six character prefix, usually it is literally'Assert'and it is followed by the name of the assertion. The name of the macro will beassert:followed by the rest of the name of the class lowercasing the first characters. For example:AssertEquals -> assert:equals AssertSomeFunnyName -> assert:somFunnyName AssireAny -> assert:anyIf the naming of the class does not conform to this schema or the macro implemented needs some special name then the method has to be overridden.
- Specified by:
getIdin interfacejavax0.jamal.api.Identified- Specified by:
getIdin interfacejavax0.jamal.api.Macro- Returns:
- the name of the macro
-