code: private String handleTokenReplacement(String str, EntityContext context) throws Siren4JException {
          String result = "";
          // First resolve parents
          result = ReflectionUtils.replaceFieldTokens(
                  context.getParentObject(), str, context.getParentFieldInfo(), true);
          // Now resolve others
          result = ReflectionUtils.flattenReservedTokens(ReflectionUtils.replaceFieldTokens(
                  context.getCurrentObject(), result, context.getCurrentFieldInfo(), false));
          return result;
      }
docs: Helper method to do token replacement for strings.
  
  @param str
  @param context
  @return
  @throws Siren4JException