org/codehaus/griffon/runtime/builder/DefaultCompositeBuilderCustomizer.java

`DefaultCompositeBuilderCustomizer.java`
`01 /* 02 * Copyright 2008-2012 the original author or authors. 03 * 04 * Licensed under the Apache License, Version 2.0 (the "License"); 05 * you may not use this file except in compliance with the License. 06 * You may obtain a copy of the License at 07 * 08 * http://www.apache.org/licenses/LICENSE-2.0 09 * 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.codehaus.griffon.runtime.builder; 17 18 import groovy.lang.Closure; 19 import groovy.util.Factory; 20 import groovy.util.FactoryBuilderSupport; 21 import org.slf4j.Logger; 22 import org.slf4j.LoggerFactory; 23 24 /** 25 * Default implementation of the <code>CompositeBuilderCustomizer</code> interface. 26 * 27 * @author Andres Almiray 28 * @since 0.9.3 29 */ 30 public class DefaultCompositeBuilderCustomizer implements CompositeBuilderCustomizer { 31 private static final Logger LOG = LoggerFactory.getLogger(DefaultCompositeBuilderCustomizer.class); 32 33 public void registerFactory(FactoryBuilderSupport builder, String name, String groupName, Factory factory) { 34 if (LOG.isTraceEnabled()) { 35 LOG.trace("Registering factory " + groupName + ":" + name + " with " + factory); 36 } 37 builder.registerFactory(name, groupName, factory); 38 } 39 40 public void registerBeanFactory(FactoryBuilderSupport builder, String name, String groupName, Class<?> beanClass) { 41 if (LOG.isTraceEnabled()) { 42 LOG.trace("Registering factory " + groupName + ":" + name + " with " + beanClass.getName()); 43 } 44 builder.registerBeanFactory(name, groupName, beanClass); 45 } 46 47 public void registerExplicitMethod(FactoryBuilderSupport builder, String name, String groupName, Closure method) { 48 if (LOG.isTraceEnabled()) { 49 LOG.trace("Registering method " + groupName + ":" + name); 50 } 51 builder.registerExplicitMethod(name, groupName, method); 52 } 53 54 public void registerExplicitProperty(FactoryBuilderSupport builder, String name, String groupName, Closure getter, Closure setter) { 55 if (LOG.isTraceEnabled()) { 56 LOG.trace("Registering property " + groupName + ":" + name); 57 } 58 builder.registerExplicitProperty(name, groupName, getter, setter); 59 } 60 }`