Class MCRTextResolver.Condition

java.lang.Object
org.mycore.common.MCRTextResolver.Term
org.mycore.common.MCRTextResolver.Condition
Enclosing class:
MCRTextResolver

protected static class MCRTextResolver.Condition extends MCRTextResolver.Term
A condition is defined by squared brackets. All data which is set in these brackets is only used if the internal variables are not null and not empty. For example "[hello {lastName}]" is only resolved if the value of "lastName" is not null and not empty. Otherwise the whole content in the squared brackets are ignored.
  • Constructor Details

  • Method Details

    • resolveInternal

      protected boolean resolveInternal(String text, int pos)
      Description copied from class: MCRTextResolver.Term
      Does term specific resolving for the current character.
      Specified by:
      resolveInternal in class MCRTextResolver.Term
      Returns:
      true if the end string is reached, otherwise false
    • getValue

      public String getValue()
      Description copied from class: MCRTextResolver.Term
      Returns the value of the term. Overwrite this if you don't want to get the default termBuffer content as value.
      Overrides:
      getValue in class MCRTextResolver.Term
      Returns:
      the value of the term
    • getStartEnclosingString

      public String getStartEnclosingString()
      Description copied from class: MCRTextResolver.Term
      Implement this to define the start enclosing string for your term. The resolver searches in the text for this string, if found, the text is processed by your term.
      Specified by:
      getStartEnclosingString in class MCRTextResolver.Term
      Returns:
      the start enclosing string
    • getEndEnclosingString

      public String getEndEnclosingString()
      Description copied from class: MCRTextResolver.Term
      Implement this to define the end enclosing string for your term. You have to check manual in the resolveInternal method if the end of your term is reached.
      Specified by:
      getEndEnclosingString in class MCRTextResolver.Term
      Returns:
      the end enclosing string