code: public Composite add(Object o)
      {
          if (nest!=null)
              nest.add(o);
          else
          {
              if (o!=null)
              {
                  if (o instanceof Element)
                  {
                      if(o instanceof Page)
                          throw new IllegalArgumentException("Can't insert Page in Composite");
                      elements.add(o);
                  }
                  else if (o instanceof String)
                      elements.add(o);
                  else 
                      elements.add(o.toString());
              }
          }
          return this;
      }
docs: Add an Object to the Composite by converting it to a Element or.
  String
  @param o The Object to add. If it is a String or Element, it is
  added directly, otherwise toString() is called.
  @return This Composite (for chained commands)