home *** CD-ROM | disk | FTP | other *** search
- package com.ibm.xml.parser;
-
- import java.util.Enumeration;
- import java.util.Vector;
- import org.w3c.dom.Node;
-
- public class AttDef extends Child {
- static final long serialVersionUID = 3041229546206616963L;
- public static final int CDATA = 1;
- // $FF: renamed from: ID int
- public static final int field_0 = 2;
- public static final int IDREF = 3;
- public static final int IDREFS = 4;
- public static final int ENTITY = 5;
- public static final int ENTITIES = 6;
- public static final int NMTOKEN = 7;
- public static final int NMTOKENS = 8;
- public static final int NOTATION = 9;
- public static final int NAME_TOKEN_GROUP = 10;
- public static final String[] S_TYPESTR = new String[]{"*UNKNOWN*", "CDATA", "ID", "IDREF", "IDREFS", "ENTITY", "ENTITIES", "NMTOKEN", "NMTOKENS", "NOTATION", "ENUMERATION"};
- public static final int FIXED = 1;
- public static final int REQUIRED = 2;
- public static final int IMPLIED = 3;
- public static final int NOFIXED = -1;
- public static final int UNKNOWN = 0;
- String name;
- int declaredValueType = 0;
- String value;
- Vector tokens;
- int defaultValueType = -1;
-
- public AttDef(String var1) {
- this.name = var1;
- }
-
- public synchronized Object clone() {
- ((Child)this).checkFactory();
- AttDef var1 = super.factory.createAttDef(this.name);
- ((Child)var1).setFactory(((Child)this).getFactory());
- var1.value = this.value;
- var1.defaultValueType = this.defaultValueType;
- var1.declaredValueType = this.declaredValueType;
- if (this.tokens != null) {
- var1.tokens = (Vector)this.tokens.clone();
- }
-
- return var1;
- }
-
- public synchronized boolean equals(Node var1, boolean var2) {
- if (var1.getNodeType() != 22) {
- return false;
- } else {
- AttDef var3 = (AttDef)var1;
- if (!var3.getName().equals(this.getName())) {
- return false;
- } else if (var3.getDefaultType() != this.defaultValueType) {
- return false;
- } else if (var3.getDeclaredType() != this.declaredValueType) {
- return false;
- } else if (var3.getDefaultStringValue() == null && this.value == null || this.value != null && this.value.equals(var3.getDefaultStringValue())) {
- if (var3.size() == 0 && this.size() == 0) {
- return true;
- } else if (var3.size() != this.size()) {
- return false;
- } else {
- for(int var4 = 0; var4 < var3.size(); ++var4) {
- String var5 = var3.elementAt(var4);
- if (!var5.equals(this.elementAt(var4))) {
- return false;
- }
- }
-
- return true;
- }
- } else {
- return false;
- }
- }
- }
-
- public short getNodeType() {
- return 22;
- }
-
- public String getNodeName() {
- return "#attribute-definition";
- }
-
- public String getName() {
- return this.name;
- }
-
- public void setName(String var1) {
- this.name = var1;
- }
-
- public int getDeclaredType() {
- return this.declaredValueType;
- }
-
- public void setDeclaredType(int var1) {
- this.declaredValueType = var1;
- }
-
- public String getDefaultStringValue() {
- return this.value;
- }
-
- public void setDefaultStringValue(String var1) {
- this.value = TXAttribute.normalize(this.getDeclaredType(), var1);
- }
-
- public boolean addElement(String var1) {
- if (this.tokens == null) {
- this.tokens = new Vector();
- }
-
- if (this.tokens.indexOf(var1) >= 0) {
- return false;
- } else {
- this.tokens.addElement(var1);
- return true;
- }
- }
-
- public String elementAt(int var1) {
- return this.tokens == null ? null : (String)this.tokens.elementAt(var1);
- }
-
- public boolean contains(String var1) {
- if (this.tokens == null) {
- return false;
- } else {
- return this.tokens.indexOf(var1) >= 0;
- }
- }
-
- public int size() {
- return this.tokens == null ? 0 : this.tokens.size();
- }
-
- public Enumeration elements() {
- return this.tokens == null ? null : this.tokens.elements();
- }
-
- public int getDefaultType() {
- return this.defaultValueType;
- }
-
- public void setDefaultType(int var1) {
- this.defaultValueType = var1;
- }
-
- public void acceptPre(Visitor var1) throws Exception {
- var1.visitAttDefPre(this);
- }
-
- public void acceptPost(Visitor var1) throws Exception {
- var1.visitAttDefPost(this);
- }
- }
-