Package com.x2jb.bind.provider

Source Code of com.x2jb.bind.provider.AnnotationBindingFactoryImpl

/*
* XML 2 Java Binding (X2JB) - the excellent Java tool.
* Copyright 2009, by Richard Opalka.
*
* This is free software; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as
* published by the Free Software Foundation; either version 2.1 of
* the License, or (at your option) any later version.
*
* This software is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
* License along with this software; if not see the FSF site:
* http://www.fsf.org/ and search for the LGPL License document there.
*/
package com.x2jb.bind.provider;

import java.lang.reflect.Method;

import org.x2jb.bind.Binding;
import org.x2jb.bind.spi.provider.BindingDefinition;
import org.x2jb.bind.spi.provider.BindingFactory;

/**
* Binding factory extension for Java 5 annotations.
*
* @author <a href="mailto:richard_opalka@yahoo.com">Richard Opalka</a>
*/
public final class AnnotationBindingFactoryImpl implements BindingFactory
{

    /**
     * Constructor.
     */
    public AnnotationBindingFactoryImpl()
    {
        super();
    }

    /**
     * @see org.x2jb.bind.spi.provider.BindingFactory#getBinding(Method)
     * @param method method
     * @return BindingDefinition binding definition
     */
    public BindingDefinition getBinding( final Method method )
    {
        final Binding methodMetadata = ( Binding ) method.getAnnotation( Binding.class );
        return ( methodMetadata == null ) ? null : new AnnotationBindingImpl( methodMetadata );
    }

}
TOP

Related Classes of com.x2jb.bind.provider.AnnotationBindingFactoryImpl

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.