docs: public void resolve() throws IOException, CmsException {
  
          initMacroContent();
          String input = getMacroInput();
          if (input == null) {
              return;
          }
          if (input.length() < 3) {
              // macro must have at last 3 chars "${}" or "%()"
              m_context.getOut().print(input);
              return;
          }
  
          int newDelimPos = input.indexOf(I_CmsMacroResolver.MACRO_DELIMITER);
          int oldDelomPos = input.indexOf(I_CmsMacroResolver.MACRO_DELIMITER_OLD);
  
          if ((oldDelomPos == -1) && (newDelimPos == -1)) {
              // no macro delimiter found in input
              m_context.getOut().print(input);
              return;
          }
  
          int len = input.length();
          int nextDelimPos, delimPos1, delimPos2, endPos;
          String macro;
          char startChar, endChar;
          int delimPos;
  
          if ((oldDelomPos == -1) || ((newDelimPos > -1) && (newDelimPos < oldDelomPos))) {
              delimPos = newDelimPos;
              startChar = I_CmsMacroResolver.MACRO_START;
              endChar = I_CmsMacroResolver.MACRO_END;
          } else {
              delimPos = oldDelomPos;
              startChar = I_CmsMacroResolver.MACRO_START_OLD;
              endChar = I_CmsMacroResolver.MACRO_END_OLD;
          }
  
          // append chars before the first delimiter found
          m_context.getOut().print(input.substring(0, delimPos));
          do {
              delimPos1 = delimPos + 1;
              delimPos2 = delimPos1 + 1;
              if (delimPos2 >= len) {
                  // remaining chars can't be a macro (minimum size is 3)
                  m_context.getOut().print(input.substring(delimPos, len));
                  break;
              }
              // get the next macro delimiter
              if ((newDelimPos > -1) && (newDelimPos < delimPos1)) {
                  newDelimPos = input.indexOf(I_CmsMacroResolver.MACRO_DELIMITER, delimPos1);
              }
              if ((oldDelomPos > -1) && (oldDelomPos < delimPos1)) {
                  oldDelomPos = input.indexOf(I_CmsMacroResolver.MACRO_DELIMITER_OLD, delimPos1);
              }
              if ((oldDelomPos == -1) && (newDelimPos == -1)) {
                  // none found, make sure remaining chars in this segment are appended
                  nextDelimPos = len;
              } else {
                  // check if the next delimiter is old or new style
                  if ((oldDelomPos == -1) || ((newDelimPos > -1) && (newDelimPos < oldDelomPos))) {
                      nextDelimPos = newDelimPos;
                  } else {
                      nextDelimPos = oldDelomPos;
                  }
              }
              // check if the next char is a "macro start"
              char start = input.charAt(delimPos1);
              if (start == startChar) {
                  // we have a starting macro sequence "${" or "%(", now check if this segment contains a "}" or ")"
                  endPos = input.indexOf(endChar, delimPos);
                  if ((endPos > 0) && (endPos < nextDelimPos)) {
                      // this segment contains a closing macro delimiter "}" or "]", so we may have found a macro
                      macro = input.substring(delimPos2, endPos);
                      // resolve macro
                      try {
                          printMacroValue(macro);
                      } catch (Exception ex) {
                          LOG.error("Writing value for macro '" + macro + "' failed.", ex);
                      }
                      endPos++;
                  } else {
                      // no complete macro "${...}" or "%(...)" in this segment
                      endPos = delimPos;
                  }
              } else {
                  // no macro start char after the "$" or "%"
                  endPos = delimPos;
              }
              // set macro style for next delimiter found
              if (nextDelimPos == newDelimPos) {
                  startChar = I_CmsMacroResolver.MACRO_START;
                  endChar = I_CmsMacroResolver.MACRO_END;
              } else {
                  startChar = I_CmsMacroResolver.MACRO_START_OLD;
                  endChar = I_CmsMacroResolver.MACRO_END_OLD;
              }
              // append the remaining chars after the macro to the start of the next macro
              m_context.getOut().print(input.substring(endPos, nextDelimPos));
              delimPos = nextDelimPos;
          } while (delimPos < len);
      }