Package be.selckin.ws.util.java2php

Source Code of be.selckin.ws.util.java2php.JaxbUtils

package be.selckin.ws.util.java2php;

import org.reflections.Reflections;

import javax.xml.bind.annotation.XmlRootElement;
import java.util.Set;

public class JaxbUtils {
    private JaxbUtils() {
    }

    public static final String PROP_EXTRA_CLASSES = "jaxb.additionalContextClasses";

    public static Class<?>[] findExtraClasses(Class<?> type) {
        String prefix = type.getPackage().getName();
        Reflections reflections = new Reflections(prefix);
        Set<Class<?>> extraClasses = reflections.getTypesAnnotatedWith(XmlRootElement.class);
        return extraClasses.toArray(new Class<?>[extraClasses.size()]);
    }

}
TOP

Related Classes of be.selckin.ws.util.java2php.JaxbUtils

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.