|
|||||||||||||||||||
| Source file | Conditionals | Statements | Methods | TOTAL | |||||||||||||||
| GroovyModuleDescriptorProvider.java | - | 100% | 100% | 100% |
|
||||||||||||||
| 1 | // Copyright 2004, 2005 The Apache Software Foundation | |
| 2 | // | |
| 3 | // Licensed under the Apache License, Version 2.0 (the "License"); | |
| 4 | // you may not use this file except in compliance with the License. | |
| 5 | // You may obtain a copy of the License at | |
| 6 | // | |
| 7 | // http://www.apache.org/licenses/LICENSE-2.0 | |
| 8 | // | |
| 9 | // Unless required by applicable law or agreed to in writing, software | |
| 10 | // distributed under the License is distributed on an "AS IS" BASIS, | |
| 11 | // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
| 12 | // See the License for the specific language governing permissions and | |
| 13 | // limitations under the License. | |
| 14 | ||
| 15 | package org.apache.hivemind.lib.groovy; | |
| 16 | ||
| 17 | import java.util.List; | |
| 18 | ||
| 19 | import org.apache.hivemind.ClassResolver; | |
| 20 | import org.apache.hivemind.ErrorHandler; | |
| 21 | import org.apache.hivemind.ModuleDescriptorProvider; | |
| 22 | import org.apache.hivemind.Resource; | |
| 23 | import org.apache.hivemind.impl.XmlModuleDescriptorProvider; | |
| 24 | import org.apache.hivemind.parse.XmlResourceProcessor; | |
| 25 | ||
| 26 | /** | |
| 27 | * This {@link org.apache.hivemind.ModuleDescriptorProvider} processes Groovy scripts defining | |
| 28 | * module descriptors. To all Groovy scripts executed by the provider a variable | |
| 29 | * <code>processor</code> will be bound. This variable references the | |
| 30 | * {@link HiveMindBuilder HiveMind GroovyMarkup builder}. | |
| 31 | * | |
| 32 | * @see org.apache.hivemind.lib.groovy.HiveMindBuilder | |
| 33 | * @author Knut Wannheden | |
| 34 | * @since 1.1 | |
| 35 | */ | |
| 36 | public class GroovyModuleDescriptorProvider extends XmlModuleDescriptorProvider implements | |
| 37 | ModuleDescriptorProvider | |
| 38 | { | |
| 39 | /** | |
| 40 | * Constructs an GroovyModuleDescriptorProvider only loading the ModuleDescriptor identified by | |
| 41 | * the given {@link org.apache.hivemind.Resource}. | |
| 42 | */ | |
| 43 | 1 | public GroovyModuleDescriptorProvider(ClassResolver resolver, Resource resource) |
| 44 | { | |
| 45 | 1 | super(resolver, resource); |
| 46 | } | |
| 47 | ||
| 48 | /** | |
| 49 | * Constructs an GroovyModuleDescriptorProvider loading all ModuleDescriptors identified by the | |
| 50 | * given List of {@link org.apache.hivemind.Resource} objects. | |
| 51 | */ | |
| 52 | 1 | public GroovyModuleDescriptorProvider(ClassResolver resolver, List resources) |
| 53 | { | |
| 54 | 1 | super(resolver, resources); |
| 55 | } | |
| 56 | ||
| 57 | 2 | protected XmlResourceProcessor getResourceProcessor(ClassResolver resolver, ErrorHandler handler) |
| 58 | { | |
| 59 | 2 | return new GroovyScriptProcessor(resolver, handler); |
| 60 | } | |
| 61 | } |
|
||||||||||