|
| 1 | +/* |
| 2 | + * Copyright 2011 <a href="mailto:lincolnbaxter@gmail.com">Lincoln Baxter, III</a> |
| 3 | + * |
| 4 | + * Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 | + * you may not use this file except in compliance with the License. |
| 6 | + * You may obtain a copy of the License at |
| 7 | + * |
| 8 | + * http://www.apache.org/licenses/LICENSE-2.0 |
| 9 | + * |
| 10 | + * Unless required by applicable law or agreed to in writing, software |
| 11 | + * distributed under the License is distributed on an "AS IS" BASIS, |
| 12 | + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. |
| 13 | + * See the License for the specific language governing permissions and |
| 14 | + * limitations under the License. |
| 15 | + */ |
| 16 | +package org.ocpsoft.rewrite.annotation.scan; |
| 17 | + |
| 18 | +import org.ocpsoft.rewrite.annotation.api.ClassContext; |
| 19 | +import org.ocpsoft.rewrite.annotation.api.MethodContext; |
| 20 | +import org.ocpsoft.rewrite.bind.BindingBuilder; |
| 21 | +import org.ocpsoft.rewrite.config.ConfigurationBuilder; |
| 22 | +import org.ocpsoft.rewrite.config.RuleBuilder; |
| 23 | +import org.ocpsoft.rewrite.context.ContextBase; |
| 24 | + |
| 25 | +/** |
| 26 | + * Default implementation of {@link MethodContext} |
| 27 | + * |
| 28 | + * @author Christian Kaltepoth |
| 29 | + */ |
| 30 | +@SuppressWarnings("rawtypes") |
| 31 | +public class MethodContextImpl extends ContextBase implements MethodContext |
| 32 | +{ |
| 33 | + |
| 34 | + private final ClassContext classContext; |
| 35 | + |
| 36 | + private BindingBuilder bindingBuilder; |
| 37 | + |
| 38 | + public MethodContextImpl(ClassContext classContext) |
| 39 | + { |
| 40 | + this.classContext = classContext; |
| 41 | + } |
| 42 | + |
| 43 | + @Override |
| 44 | + public ClassContext getClassContext() |
| 45 | + { |
| 46 | + return classContext; |
| 47 | + } |
| 48 | + |
| 49 | + @Override |
| 50 | + public ConfigurationBuilder getConfigurationBuilder() |
| 51 | + { |
| 52 | + return classContext.getConfigurationBuilder(); |
| 53 | + } |
| 54 | + |
| 55 | + @Override |
| 56 | + public RuleBuilder getRuleBuilder() |
| 57 | + { |
| 58 | + return classContext.getRuleBuilder(); |
| 59 | + } |
| 60 | + |
| 61 | + @Override |
| 62 | + public void setBindingBuilder(BindingBuilder bindingBuilder) |
| 63 | + { |
| 64 | + this.bindingBuilder = bindingBuilder; |
| 65 | + } |
| 66 | + |
| 67 | + @Override |
| 68 | + public BindingBuilder getBindingBuilder() |
| 69 | + { |
| 70 | + return bindingBuilder; |
| 71 | + } |
| 72 | + |
| 73 | +} |
0 commit comments