<commit_before>package de.lessvoid.nifty.loader.xpp3.processor;


import de.lessvoid.nifty.effects.EffectEventId;
import de.lessvoid.nifty.loader.xpp3.Attributes;
import de.lessvoid.nifty.loader.xpp3.XmlParser;
import de.lessvoid.nifty.loader.xpp3.elements.EffectsType;
import de.lessvoid.nifty.loader.xpp3.elements.ElementType;
import de.lessvoid.nifty.loader.xpp3.elements.StyleType;

/**
 * EffectsType.
 * @author void
 */
public class EffectsTypeProcessor implements XmlElementProcessor {

  /**
   * the element this belongs to.
   */
  private ElementType element;

  /**
   * StyleType.
   */
  private StyleType style;

  /**
   * init with StyleType.
   * @param styleParam StyleType
   */
  public EffectsTypeProcessor(final StyleType styleParam) {
    style = styleParam;
  }

  /**
   * init it.
   * @param elementParam element
   */
  public EffectsTypeProcessor(final ElementType elementParam) {
    element = elementParam;
  }

  /**
   * process.
   * @param xmlParser xmlParser
   * @param attributes attributes
   * @throws Exception exception
   */
  public void process(final XmlParser xmlParser, final Attributes attributes) throws Exception {
    EffectsType effectsType = new EffectsType();
    xmlParser.nextTag();
    xmlParser.zeroOrMore("onStartScreen", new EffectTypeProcessor(effectsType, EffectEventId.onStartScreen));
    xmlParser.zeroOrMore("onEndScreen", new EffectTypeProcessor(effectsType, EffectEventId.onEndScreen));
    xmlParser.zeroOrMore("onHover", new EffectTypeProcessor(effectsType, EffectEventId.onHover));
    xmlParser.zeroOrMore("onClick", new EffectTypeProcessor(effectsType, EffectEventId.onClick));
    xmlParser.zeroOrMore("onFocus", new EffectTypeProcessor(effectsType, EffectEventId.onFocus));
    xmlParser.zeroOrMore("onActive", new EffectTypeProcessor(effectsType, EffectEventId.onActive));
    xmlParser.zeroOrMore("onCustom", new EffectTypeProcessor(effectsType, EffectEventId.onCustom));

    if (element != null) {
      element.setEffects(effectsType);
    }

    if (style != null) {
      style.setEffects(effectsType);<commit_msg>order of effects is not important anymore, you can mix them now<commit_after>package de.lessvoid.nifty.loader.xpp3.processor;


import de.lessvoid.nifty.effects.EffectEventId;
import de.lessvoid.nifty.loader.xpp3.Attributes;
import de.lessvoid.nifty.loader.xpp3.SubstitutionGroup;
import de.lessvoid.nifty.loader.xpp3.XmlParser;
import de.lessvoid.nifty.loader.xpp3.elements.EffectsType;
import de.lessvoid.nifty.loader.xpp3.elements.ElementType;
import de.lessvoid.nifty.loader.xpp3.elements.StyleType;

/**
 * EffectsType.
 * @author void
 */
public class EffectsTypeProcessor implements XmlElementProcessor {

  /**
   * the element this belongs to.
   */
  private ElementType element;

  /**
   * StyleType.
   */
  private StyleType style;

  /**
   * init with StyleType.
   * @param styleParam StyleType
   */
  public EffectsTypeProcessor(final StyleType styleParam) {
    style = styleParam;
  }

  /**
   * init it.
   * @param elementParam element
   */
  public EffectsTypeProcessor(final ElementType elementParam) {
    element = elementParam;
  }

  /**
   * process.
   * @param xmlParser xmlParser
   * @param attributes attributes
   * @throws Exception exception
   */
  public void process(final XmlParser xmlParser, final Attributes attributes) throws Exception {
    EffectsType effectsType = new EffectsType();
    xmlParser.nextTag();
    xmlParser.zeroOrMore(
        new SubstitutionGroup().
          add("onStartScreen", new EffectTypeProcessor(effectsType, EffectEventId.onStartScreen)).
          add("onEndScreen", new EffectTypeProcessor(effectsType, EffectEventId.onEndScreen)).
          add("onHover", new EffectTypeProcessor(effectsType, EffectEventId.onHover)).
          add("onClick", new EffectTypeProcessor(effectsType, EffectEventId.onClick)).
          add("onFocus", new EffectTypeProcessor(effectsType, EffectEventId.onFocus)).
          add("onActive", new EffectTypeProcessor(effectsType, EffectEventId.onActive)).
          add("onCustom", new EffectTypeProcessor(effectsType, EffectEventId.onCustom))
          );

    if (element != null) {
      element.setEffects(effectsType);
    }

    if (style != null) {
      style.setEffects(effectsType);
{'fraction_non_alphanumeric': 0.10567970204841713, 'fraction_numerical': 0.003026070763500931, 'mean_word_length': 4.103325415676959, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 16}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5834820', 'n_tokens_mistral': 1304, 'n_tokens_neox': 1249, 'n_words': 251}