Package org.springframework.roo.addon.layers.service

Source Code of org.springframework.roo.addon.layers.service.ServiceAnnotationValuesFactoryImpl

package org.springframework.roo.addon.layers.service;

import org.apache.felix.scr.annotations.Component;
import org.apache.felix.scr.annotations.Reference;
import org.apache.felix.scr.annotations.Service;
import org.springframework.roo.classpath.PhysicalTypeMetadata;
import org.springframework.roo.classpath.details.ClassOrInterfaceTypeDetails;
import org.springframework.roo.metadata.MetadataService;

/**
* Factory for {@link ServiceAnnotationValues} instances.
*
* @author Andrew Swan
* @since 1.2.0
*/
@Component
@Service
public class ServiceAnnotationValuesFactoryImpl implements
        ServiceAnnotationValuesFactory {

    @Reference private MetadataService metadataService;

    public ServiceAnnotationValues getInstance(
            final ClassOrInterfaceTypeDetails serviceInterface) {
        final PhysicalTypeMetadata physicalTypeMetadata = (PhysicalTypeMetadata) metadataService
                .get(serviceInterface.getDeclaredByMetadataId());
        if (physicalTypeMetadata == null) {
            return null;
        }
        return new ServiceAnnotationValues(physicalTypeMetadata);
    }
}
TOP

Related Classes of org.springframework.roo.addon.layers.service.ServiceAnnotationValuesFactoryImpl

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.