code: public static <Type> void processAttributes(final Type widget, final LmlTag tag, final LmlParser parser,
              final ObjectSet<String> processedAttributes, final boolean throwExceptionIfAttributeUnknown) {
          if (GdxMaps.isEmpty(tag.getNamedAttributes())) {
              return;
          }
          final LmlSyntax syntax = parser.getSyntax();
          final boolean hasProcessedAttributes = processedAttributes != null;
          for (final Entry<String, String> attribute : tag.getNamedAttributes()) {
              if (attribute == null || hasProcessedAttributes && processedAttributes.contains(attribute.key)) {
                  continue;
              }
              final LmlAttribute<Type> attributeProcessor = syntax.getAttributeProcessor(widget, attribute.key);
              if (attributeProcessor == null) {
                  if (throwExceptionIfAttributeUnknown) {
                      parser.throwErrorIfStrict("Unknown attribute: \"" + attribute.key + "\" for widget type: "
                              + widget.getClass().getName());
                  }
                  continue;
              }
              attributeProcessor.process(parser, tag, widget, attribute.value);
              if (hasProcessedAttributes) {
                  processedAttributes.add(attribute.key);
              }
          }
      }
docs: Utility method that processes all named attributes of the selected type.
  
  @param widget widget (validator, actor - processed element) that will be used to process attributes.
  @param tag contains attributes.
  @param parser will be used to parse attributes.
  @param processedAttributes already processed attribute names. These attributes will be ignored. Optional, can be
  null.
  @param throwExceptionIfAttributeUnknown if true and unknown attribute is found, a strict parser will throw an
  exception.
  @param <Type> type of processed widget. Its class tree will be used to retrieve attributes.