1 17 package org.alfresco.repo.dictionary; 18 19 import org.alfresco.service.cmr.dictionary.AspectDefinition; 20 import org.alfresco.service.cmr.dictionary.AssociationDefinition; 21 import org.alfresco.service.cmr.dictionary.ClassDefinition; 22 import org.alfresco.service.cmr.dictionary.DataTypeDefinition; 23 import org.alfresco.service.cmr.dictionary.PropertyDefinition; 24 import org.alfresco.service.cmr.dictionary.TypeDefinition; 25 import org.alfresco.service.namespace.QName; 26 27 34 class DelegateModelQuery implements ModelQuery 35 { 36 37 private ModelQuery query; 38 private ModelQuery delegate; 39 40 41 47 DelegateModelQuery(ModelQuery query, ModelQuery delegate) 48 { 49 this.query = query; 50 this.delegate = delegate; 51 } 52 53 54 57 public DataTypeDefinition getDataType(QName name) 58 { 59 DataTypeDefinition def = query.getDataType(name); 60 if (def == null) 61 { 62 def = delegate.getDataType(name); 63 } 64 return def; 65 } 66 67 68 71 public DataTypeDefinition getDataType(Class javaClass) 72 { 73 DataTypeDefinition def = query.getDataType(javaClass); 74 if (def == null) 75 { 76 def = delegate.getDataType(javaClass); 77 } 78 return def; 79 } 80 81 82 85 public TypeDefinition getType(QName name) 86 { 87 TypeDefinition def = query.getType(name); 88 if (def == null) 89 { 90 def = delegate.getType(name); 91 } 92 return def; 93 } 94 95 96 99 public AspectDefinition getAspect(QName name) 100 { 101 AspectDefinition def = query.getAspect(name); 102 if (def == null) 103 { 104 def = delegate.getAspect(name); 105 } 106 return def; 107 } 108 109 110 113 public ClassDefinition getClass(QName name) 114 { 115 ClassDefinition def = query.getClass(name); 116 if (def == null) 117 { 118 def = delegate.getClass(name); 119 } 120 return def; 121 } 122 123 124 127 public PropertyDefinition getProperty(QName name) 128 { 129 PropertyDefinition def = query.getProperty(name); 130 if (def == null) 131 { 132 def = delegate.getProperty(name); 133 } 134 return def; 135 } 136 137 138 141 public AssociationDefinition getAssociation(QName name) 142 { 143 AssociationDefinition def = query.getAssociation(name); 144 if (def == null) 145 { 146 def = delegate.getAssociation(name); 147 } 148 return def; 149 } 150 151 } 152 | Popular Tags |