Module jamal.tools

Class Marker

  • All Implemented Interfaces:
    Marker

    public class Marker
    extends java.lang.Object
    implements Marker
    Implementation of the Marker interface that requires that exactly the same objects is passed to MacroRegister.pop(javax0.jamal.api.Marker) and to MacroRegister.push(javax0.jamal.api.Marker).

    An instance of this class is used to pass to the push(Marker) call and when we call pop(Marker) the register checks that the same instance was passed. This is much stricter than comparing only the name field. This is the reason why this class does not define Object.equals(Object) and Object.hashCode() methods.

    When object identity cannot be guaranteed then the NamedMarker implementation of the Marker interface has to be used. An example is the macro pair begin and end. See their documentation at javax0.jamal.builtins.Begin and javax0.jamal.builtins.End.

    The name field in this implementation serves documentation purposes only and is included into the message of the exception that is thrown by the method pop(Marker) when the markers do not match.

    • Constructor Summary

      Constructors 
      Constructor Description
      Marker​(java.lang.String name)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Marker

        public Marker​(java.lang.String name)
    • Method Detail

      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object