Class AssertEndsWith

java.lang.Object
javax0.jamal.assertions.AssertEndsWith
All Implemented Interfaces:
javax0.jamal.api.Identified, javax0.jamal.api.Macro, javax0.jamal.api.ServiceLoaded

public class AssertEndsWith extends Object
  • Nested Class Summary

    Nested classes/interfaces inherited from interface javax0.jamal.api.Identified

    javax0.jamal.api.Identified.Undefined

    Nested 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_ARG2

    Fields inherited from interface javax0.jamal.api.Macro

    FETCH
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    evaluate(javax0.jamal.api.Input input, javax0.jamal.api.Processor processor)
     
    The implementation of the naming assumes that the name of the class looks like AsserXXX where Assert is a six character prefix, usually it is literally 'Assert' and it is followed by the name of the assertion.
    protected boolean
    test(String[] parts)
    Child classes have to implement this method.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface javax0.jamal.api.Macro

    fetch, getIds, prefetch
  • Constructor Details

    • AssertEndsWith

      public AssertEndsWith()
  • Method Details

    • test

      protected boolean test(String[] parts)
      Child classes have to implement this method.
      Parameters:
      parts - the parts that have at least N-1 parts. If there were not enough parts an exception was already thrown and this method is not invoked.
      Returns:
      true if the assertion is okay and false otherwise. This method should not care about trimming or negation, it is done before and after the method was executed.
    • evaluate

      public String evaluate(javax0.jamal.api.Input input, javax0.jamal.api.Processor processor) throws javax0.jamal.api.BadSyntax
      Specified by:
      evaluate in interface javax0.jamal.api.Macro
      Throws:
      javax0.jamal.api.BadSyntax
    • getId

      public String getId()
      The implementation of the naming assumes that the name of the class looks like AsserXXX where Assert is 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 be assert: followed by the rest of the name of the class lowercasing the first characters. For example:
      
       AssertEquals -> assert:equals
       AssertSomeFunnyName -> assert:somFunnyName
       AssireAny -> assert:any
       

      If 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:
      getId in interface javax0.jamal.api.Identified
      Specified by:
      getId in interface javax0.jamal.api.Macro
      Returns:
      the name of the macro