Class MessageFmt.Segment

java.lang.Object
org.dellroad.stuff.text.MessageFmt.Segment
Direct Known Subclasses:
MessageFmt.ArgumentSegment, MessageFmt.TextSegment
Enclosing class:
MessageFmt

public abstract static class MessageFmt.Segment extends Object
Represents one atomic portion of a MessageFormat pattern string.
See Also:
  • Constructor Details

    • Segment

      public Segment()
  • Method Details

    • toPattern

      public abstract String toPattern()
      Encode this segment as a MessageFormat pattern fragment.

      The concatenation of the encoding of the MessageFmt.Segments in a MessageFmt produces the corresponding MessageFormat pattern string.

      This method is responsible for escaping single quotes and opening curly braces, if necessary.

      Returns:
      MessageFormat pattern string text
    • visit

      public abstract void visit(MessageFmt.SegmentSwitch target)
      Visit the method of the given switch corresponding to this instance's concrete type.
      Parameters:
      target - visitor pattern target
    • equals

      public boolean equals(Object obj)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object