1 19 20 package org.netbeans.api.convertor; 21 22 import org.netbeans.spi.convertor.Convertor; 23 24 35 public final class ConvertorDescriptor extends Object { 36 37 private String namespace; 38 private String rootElement; 39 private String writes; 40 private Convertor convertor; 41 42 ConvertorDescriptor(Convertor convertor, String namespace, String rootElement, String writes) { 43 assert namespace != null && rootElement != null; 44 this.namespace = namespace; 45 this.rootElement = rootElement; 46 this.writes = writes; 47 this.convertor = convertor; 48 } 49 50 55 public String getNamespace() { 56 return namespace; 57 } 58 59 64 public String getElementName() { 65 return rootElement; 66 } 67 68 76 public String getClassName() { 77 return writes; 78 } 79 80 public boolean equals(Object o) { 81 if (!(o instanceof ConvertorDescriptor)) { 82 return false; 83 } 84 ConvertorDescriptor cd = (ConvertorDescriptor)o; 85 return namespace.equals(cd.namespace) && 86 rootElement.equals(cd.rootElement) && 87 (writes != null ? writes.equals(cd.writes) : cd.writes == null); 88 } 89 90 public int hashCode() { 91 int result = namespace.hashCode(); 92 result += 13 * rootElement.hashCode(); 93 if (writes != null) { 94 result += 17 * writes.hashCode(); 95 } 96 return result; 97 } 98 99 public String toString() { 100 return "ConvertorDescriptor[namespace='"+namespace+"', element='"+rootElement+"', writes='"+writes+"', convertor='"+convertor+"']"+super.toString(); } 102 103 Convertor getConvertor() { 104 return convertor; 105 } 106 107 } 108 | Popular Tags |