Exemplo n.º 1
0
 /**
  * Returns a value for the specified parameter or {@code null}.
  *
  * @param doc documentation
  * @param name parameter name
  * @return documentation of specified variable
  */
 public static byte[] doc(final TokenObjMap<TokenList> doc, final byte[] name) {
   final TokenList params = doc != null ? doc.get(DOC_PARAM) : null;
   if (params != null) {
     for (final byte[] param : params) {
       final int vl = param.length;
       final int s = startsWith(param, '$') ? 1 : 0;
       for (int v = s; v < vl; v++) {
         if (!ws(param[v])) continue;
         if (!eq(substring(param, s, v), name)) break;
         return trim(substring(param, v + 1, vl));
       }
     }
   }
   return null;
 }
Exemplo n.º 2
0
 /**
  * Creates a comment sub element.
  *
  * @param tags map with tags
  * @param parent parent element
  */
 final void comment(final TokenObjMap<TokenList> tags, final FElem parent) {
   for (final byte[] tag : tags) {
     for (final byte[] name : tags.get(tag)) add(name, elem(tag, parent));
   }
 }