1 15 package org.apache.tapestry.resolver; 16 17 import org.apache.hivemind.Resource; 18 import org.apache.tapestry.INamespace; 19 import org.apache.tapestry.Tapestry; 20 import org.apache.tapestry.engine.ISpecificationSource; 21 import org.apache.tapestry.spec.IComponentSpecification; 22 23 31 32 public class AbstractSpecificationResolver 33 { 34 35 private INamespace _namespace; 36 37 38 private IComponentSpecification _specification; 39 40 41 private ISpecificationSource _specificationSource; 42 43 private ISpecificationResolverDelegate _delegate; 44 45 private String _applicationId; 46 47 private Resource _contextRoot; 48 49 50 51 private Resource _webInfLocation; 52 53 private Resource _webInfAppLocation; 54 55 public void initializeService() 56 { 57 _webInfLocation = _contextRoot.getRelativeResource("WEB-INF/"); 58 59 _webInfAppLocation = _webInfLocation.getRelativeResource(_applicationId + "/"); 60 } 61 62 67 68 public ISpecificationResolverDelegate getDelegate() 69 { 70 return _delegate; 71 } 72 73 76 77 protected Resource getContextRoot() 78 { 79 return _contextRoot; 80 } 81 82 public void setContextRoot(Resource contextRoot) 83 { 84 _contextRoot = contextRoot; 85 } 86 87 90 91 protected void setNamespace(INamespace namespace) 92 { 93 _namespace = namespace; 94 } 95 96 99 100 public INamespace getNamespace() 101 { 102 return _namespace; 103 } 104 105 108 109 protected ISpecificationSource getSpecificationSource() 110 { 111 return _specificationSource; 112 } 113 114 117 118 protected Resource getWebInfLocation() 119 { 120 return _webInfLocation; 121 } 122 123 127 128 protected Resource getWebInfAppLocation() 129 { 130 return _webInfAppLocation; 131 } 132 133 136 137 public IComponentSpecification getSpecification() 138 { 139 return _specification; 140 } 141 142 145 146 protected void setSpecification(IComponentSpecification specification) 147 { 148 _specification = specification; 149 } 150 151 154 155 protected void reset() 156 { 157 _namespace = null; 158 _specification = null; 159 } 160 161 162 public void setDelegate(ISpecificationResolverDelegate delegate) 163 { 164 _delegate = delegate; 165 } 166 167 168 public void setApplicationId(String applicationId) 169 { 170 _applicationId = applicationId; 171 } 172 173 174 public void setSpecificationSource(ISpecificationSource source) 175 { 176 _specificationSource = source; 177 } 178 179 } | Popular Tags |