Package au.net.ocean.maven.plugin.annotation

Examples of au.net.ocean.maven.plugin.annotation.Component


    private org.apache.maven.plugin.descriptor.Parameter extractParameter(Field field) throws DuplicateParameterException {
        getLogger().debug("scanning field: " + field.getName());
        org.apache.maven.plugin.descriptor.Parameter parameterDescriptor = null;
        Parameter parameter = field.getAnnotation(Parameter.class);
        Component component = field.getAnnotation(Component.class);
        if (parameter != null || component != null) {
            Class<?> type = field.getType();
            StringBuffer typeNameBuffer = new StringBuffer();
            while (type.isArray()) {
                typeNameBuffer.append("[]");
                type = type.getComponentType();
            }
            String typeName = typeNameBuffer.insert(0, type.getName()).toString();
            parameterDescriptor = new org.apache.maven.plugin.descriptor.Parameter();
            parameterDescriptor.setType(typeName);
            // component overrides parameter if both are present
            if (component != null) {
                getLogger().info("found @Component: (" + typeName + "):" + field.getName());
                parameterDescriptor.setDescription(component.description());
                String role = component.role().trim();
                if (role.length() == 0) {
                    role = typeName;
                }
                String roleHint = component.roleHint().trim();
                if (roleHint.length() == 0) {
                    roleHint = null;
                }
                parameterDescriptor.setRequirement(new Requirement(role, roleHint));
                parameterDescriptor.setName(field.getName());
View Full Code Here


    private org.apache.maven.plugin.descriptor.Parameter extractParameter(Field field) throws DuplicateParameterException {
        getLogger().debug("scanning field: " + field.getName());
        org.apache.maven.plugin.descriptor.Parameter parameterDescriptor = null;
        Parameter parameter = field.getAnnotation(Parameter.class);
        Component component = field.getAnnotation(Component.class);
        if (parameter != null || component != null) {
            Class<?> type = field.getType();
            StringBuffer typeNameBuffer = new StringBuffer();
            while (type.isArray()) {
                typeNameBuffer.append("[]");
                type = type.getComponentType();
            }
            String typeName = typeNameBuffer.insert(0, type.getName()).toString();
            parameterDescriptor = new org.apache.maven.plugin.descriptor.Parameter();
            parameterDescriptor.setType(typeName);
            // component overrides parameter if both are present
            if (component != null) {
                getLogger().info("found @Component: (" + typeName + "):" + field.getName());
                parameterDescriptor.setDescription(component.description());
                String role = component.role().trim();
                if (role.length() == 0) {
                    role = typeName;
                }
                String roleHint = component.roleHint().trim();
                if (roleHint.length() == 0) {
                    roleHint = null;
                }
                parameterDescriptor.setRequirement(new Requirement(role, roleHint));
                parameterDescriptor.setName(field.getName());
View Full Code Here

TOP

Related Classes of au.net.ocean.maven.plugin.annotation.Component

Copyright © 2018 www.massapicom. 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.