Ejemplo n.º 1
0
  private void extractValues(String elementName, XmlPullParser pullParser)
      throws XmlPullParserException {
    for (int i = 0; i < pullParser.getAttributeCount(); ++i) {
      String name = pullParser.getAttributeName(i);
      String value = pullParser.getAttributeValue(i);

      if (E.equals(name)) {
        this.element = Element.fromString(value);
      } else if (K.equals(name)) {
        this.keys = value;
      } else if (V.equals(name)) {
        this.values = value;
      } else if (CAT.equals(name)) {
        this.cat = value;
      } else if (CLOSED.equals(name)) {
        this.closed = Closed.fromString(value);
      } else if (ZOOM_MIN.equals(name)) {
        this.zoomMin = XmlUtils.parseNonNegativeByte(name, value);
      } else if (ZOOM_MAX.equals(name)) {
        this.zoomMax = XmlUtils.parseNonNegativeByte(name, value);
      } else {
        throw XmlUtils.createXmlPullParserException(elementName, name, value, i);
      }
    }

    validate(elementName);

    this.keyList = new ArrayList<String>(Arrays.asList(SPLIT_PATTERN.split(this.keys)));
    this.valueList = new ArrayList<String>(Arrays.asList(SPLIT_PATTERN.split(this.values)));

    this.elementMatcher = getElementMatcher(this.element);
    this.closedMatcher = getClosedMatcher(this.closed);

    this.elementMatcher = RuleOptimizer.optimize(this.elementMatcher, this.ruleStack);
    this.closedMatcher = RuleOptimizer.optimize(this.closedMatcher, this.ruleStack);
  }
Ejemplo n.º 2
0
 @Override
 public void close(TimeoutNotifier notifier) {
   notifier.getTimeoutAdmin().cancel(notifier);
   notifier.changeState(Closed.getInstance());
 }
Ejemplo n.º 3
0
 @Override
 public void close(TimeoutNotifier notifier) {
   notifier.changeState(Closed.getInstance());
 }