1 11 package org.eclipse.jdt.core.dom; 12 13 31 public abstract class StructuralPropertyDescriptor { 32 33 36 private final String propertyId; 37 38 41 private final Class nodeClass; 42 43 53 StructuralPropertyDescriptor(Class nodeClass, String propertyId) { 54 if (nodeClass == null || propertyId == null) { 55 throw new IllegalArgumentException (); 56 } 57 this.propertyId = propertyId; 58 this.nodeClass = nodeClass; 59 } 60 61 66 public final String getId() { 67 return this.propertyId; 68 } 69 70 79 public final Class getNodeClass() { 80 return this.nodeClass; 81 } 82 83 90 public final boolean isSimpleProperty(){ 91 return (this instanceof SimplePropertyDescriptor); 92 } 93 94 101 public final boolean isChildProperty() { 102 return (this instanceof ChildPropertyDescriptor); 103 } 104 105 112 public final boolean isChildListProperty() { 113 return (this instanceof ChildListPropertyDescriptor); 114 } 115 116 120 public String toString() { 121 StringBuffer b = new StringBuffer (); 122 if (isChildListProperty()) { 123 b.append("ChildList"); } 125 if (isChildProperty()) { 126 b.append("Child"); } 128 if (isSimpleProperty()) { 129 b.append("Simple"); } 131 b.append("Property["); if (this.nodeClass != null) { 133 b.append(this.nodeClass.getName()); 134 } 135 b.append(","); if (this.propertyId != null) { 137 b.append(this.propertyId); 138 } 139 b.append("]"); return b.toString(); 141 } 142 } 143 | Popular Tags |