1 29 30 package com.caucho.relaxng.pattern; 31 32 import com.caucho.relaxng.RelaxException; 33 import com.caucho.relaxng.program.NameClassItem; 34 import com.caucho.relaxng.program.NameItem; 35 import com.caucho.xml.QName; 36 37 40 public class NamePattern extends NameClassPattern { 41 private final QName _name; 42 private final NameItem _item; 43 44 47 public NamePattern(QName name) 48 { 49 _name = name; 50 _item = new NameItem(_name); 51 } 52 53 56 public String getTagName() 57 { 58 return "name"; 59 } 60 61 64 public NameClassItem createNameItem() 65 throws RelaxException 66 { 67 return _item; 68 } 69 70 73 public String toProduction() 74 { 75 return _name.getName(); 76 } 77 78 public boolean equals(Object o) 79 { 80 if (this == o) 81 return true; 82 83 if (! (o instanceof NamePattern)) 84 return false; 85 86 NamePattern elt = (NamePattern) o; 87 88 return _name.equals(elt._name); 89 } 90 91 94 public String toString() 95 { 96 return "Name[" + _name.getName() + "]"; 97 } 98 } 99 100 | Popular Tags |