001: /*
002: * Licensed to the Apache Software Foundation (ASF) under one or more
003: * contributor license agreements. See the NOTICE file distributed with
004: * this work for additional information regarding copyright ownership.
005: * The ASF licenses this file to You under the Apache License, Version 2.0
006: * (the "License"); you may not use this file except in compliance with
007: * the License. You may obtain a copy of the License at
008: *
009: * http://www.apache.org/licenses/LICENSE-2.0
010: *
011: * Unless required by applicable law or agreed to in writing, software
012: * distributed under the License is distributed on an "AS IS" BASIS,
013: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
014: * See the License for the specific language governing permissions and
015: * limitations under the License.
016: */
017:
018: package javax.swing.text.html.parser;
019:
020: import java.util.ArrayList;
021: import java.util.List;
022:
023: /**
024: * Represents an attribute of a html tag. Contains a reference to the
025: * next attribute.
026: */
027: class HTMLAttributeList {
028:
029: /**
030: * The attribute name
031: */
032: private String attrName;
033:
034: /**
035: * The attribute value
036: */
037: private Object attrValue;
038:
039: /**
040: * The first position of the attribute
041: */
042: private int pos;
043:
044: /**
045: * The final position of the attribute
046: */
047: private int endPos;
048:
049: /**
050: * Stores a list of lexical errors
051: */
052: private List<String> error = null;
053:
054: /**
055: * A reference to the next attribute
056: */
057: private HTMLAttributeList next;
058:
059: HTMLAttributeList(final String attrName, final Object attrValue,
060: final int pos, final int endPos,
061: final HTMLAttributeList next) {
062: this (attrName, attrValue, pos, endPos, next, null);
063: }
064:
065: HTMLAttributeList(final String attrName, final Object attrValue,
066: final int pos, final int endPos,
067: final HTMLAttributeList next, List<String> error) {
068: this .attrName = attrName.toLowerCase();
069: this .attrValue = attrValue;
070: this .pos = pos;
071: this .endPos = endPos;
072: this .next = next;
073: this .error = error;
074: }
075:
076: List<String> getError() {
077: return error;
078: }
079:
080: String getAttributeName() {
081: return attrName;
082: }
083:
084: Object getAttributeValue() {
085: return attrValue;
086: }
087:
088: int getPos() {
089: return pos;
090: }
091:
092: int getEndPos() {
093: return endPos;
094: }
095:
096: HTMLAttributeList getNext() {
097: return next;
098: }
099:
100: void setNext(HTMLAttributeList nextAttr) {
101: this.next = nextAttr;
102: }
103:
104: }
|