Examples of AnnotationValue


Examples of org.jboss.jandex.AnnotationValue

            return secureWsdlAccess;
        }

        private String stringValueOrNull(final AnnotationInstance annotation, final String attribute) {
            if (annotation == null) return null;
            final AnnotationValue value = annotation.value(attribute);
            return value != null ? value.asString() : null;
        }
View Full Code Here

Examples of org.jboss.jandex.AnnotationValue

            return value != null ? value.asString() : null;
        }

        private boolean booleanValue(final AnnotationInstance annotation, final String attribute) {
            if (annotation == null) return false;
            final AnnotationValue value = annotation.value(attribute);
            return value != null ? value.asBoolean() : false;
        }
View Full Code Here

Examples of org.jboss.jandex.AnnotationValue

        // TODO: how about @WebServiceProvider JMS based endpoints?

        //group @WebService annotations in the deployment by wsdl contract location
        Map<String, List<AnnotationInstance>> map = new HashMap<String, List<AnnotationInstance>>();
        for (AnnotationInstance webServiceAnnotation : webServiceAnnotations) {
            final AnnotationValue wsdlLocation = webServiceAnnotation.value(WSDL_LOCATION);
            final AnnotationValue port = webServiceAnnotation.value(PORT_NAME);
            final AnnotationValue service = webServiceAnnotation.value(SERVICE_NAME);
            //support for contract-first development only: pick-up @WebService annotations referencing a provided wsdl contract only
            if (wsdlLocation != null && port != null && service != null) {
                String key = wsdlLocation.asString();
                List<AnnotationInstance> annotations = map.get(key);
                if (annotations == null) {
                    annotations = new LinkedList<AnnotationInstance>();
                    map.put(key, annotations);
                }
                annotations.add(webServiceAnnotation);
            }
        }

        //extract SOAP-over-JMS 1.0 bindings
        final JMSEndpointsMetaData endpointsMetaData = new JMSEndpointsMetaData();
        if (!map.isEmpty()) {

            for (String wsdlLocation : map.keySet()) {
                try {
                    final ResourceRoot resourceRoot = getWsdlResourceRoot(unit, wsdlLocation);
                    if (resourceRoot == null) continue;
                    final UnifiedVirtualFile uvf = new VirtualFileAdaptor(resourceRoot.getRoot());
                    URL url = uvf.findChild(wsdlLocation).toURL();
                    SOAPAddressWSDLParser parser = new SOAPAddressWSDLParser(url);
                    for (AnnotationInstance ai : map.get(wsdlLocation)) {
                        String port = ai.value(PORT_NAME).asString();
                        String service = ai.value(SERVICE_NAME).asString();
                        AnnotationValue targetNS = ai.value(TARGET_NAMESPACE);
                        String tns = targetNS != null ? targetNS.asString() : null;
                        QName serviceName = new QName(tns, service);
                        QName portName = new QName(tns, port);
                        String soapAddress = parser.filterSoapAddress(serviceName, portName, SOAPAddressWSDLParser.SOAP_OVER_JMS_NS);
                        if (soapAddress != null) {
                            ClassInfo webServiceClassInfo = (ClassInfo) ai.target();
View Full Code Here

Examples of org.jboss.jandex.AnnotationValue

        }
        return false;
    }

    private static String getStringAttribute(final AnnotationInstance annotation, final String attributeName) {
        final AnnotationValue attributeValue = annotation.value(attributeName);
        if (attributeValue != null) {
            final String trimmedAttributeValue = attributeValue.asString().trim();
            return "".equals(trimmedAttributeValue) ? null : trimmedAttributeValue;
        }
        return null;
    }
View Full Code Here

Examples of org.jboss.jandex.AnnotationValue

        classDescription.getBindingConfigurations().add(bindingConfiguration);
    }

    private BindingConfiguration getBindingConfiguration(final AnnotationInstance datasourceAnnotation) {

        final AnnotationValue nameValue = datasourceAnnotation.value("name");
        if (nameValue == null || nameValue.asString().isEmpty()) {
            throw MESSAGES.annotationAttributeMissing("@DataSourceDefinition", "name");
        }
        String name = nameValue.asString();
        // if the name doesn't have a namespace then it defaults to java:comp/env
        if (!name.startsWith("java:")) {
            name = "java:comp/env/" + name;
        }

        final AnnotationValue classValue = datasourceAnnotation.value("className");
        if (classValue == null || classValue.asString().equals(Object.class.getName())) {
            throw MESSAGES.annotationAttributeMissing("@DataSourceDefinition", "className");
        }

        final String type = classValue.asString();
        final DirectDataSourceInjectionSource directDataSourceInjectionSource = new DirectDataSourceInjectionSource();
        directDataSourceInjectionSource.setClassName(type);
        directDataSourceInjectionSource.setDatabaseName(asString(datasourceAnnotation, DirectDataSourceInjectionSource.DATABASE_NAME_PROP));
        directDataSourceInjectionSource.setDescription(asString(datasourceAnnotation, DirectDataSourceInjectionSource.DESCRIPTION_PROP));
        directDataSourceInjectionSource.setInitialPoolSize(asInt(datasourceAnnotation, DirectDataSourceInjectionSource.INITIAL_POOL_SIZE_PROP));
View Full Code Here

Examples of org.jboss.jandex.AnnotationValue

        final BindingConfiguration bindingDescription = new BindingConfiguration(name, directDataSourceInjectionSource);
        return bindingDescription;
    }

    private int asInt(AnnotationInstance annotation, String string) {
        AnnotationValue value = annotation.value(string);
        return value == null ? -1 : value.asInt();
    }
View Full Code Here

Examples of org.jboss.jandex.AnnotationValue

        AnnotationValue value = annotation.value(string);
        return value == null ? -1 : value.asInt();
    }

    private String asString(final AnnotationInstance annotation, String property) {
        AnnotationValue value = annotation.value(property);
        return value == null ? null : value.asString();
    }
View Full Code Here

Examples of org.jboss.jandex.AnnotationValue

        AnnotationValue value = annotation.value(property);
        return value == null ? null : value.asString();
    }

    private boolean asBool(final AnnotationInstance annotation, String property) {
        AnnotationValue value = annotation.value(property);
        return value == null ? true : value.asBoolean();
    }
View Full Code Here

Examples of org.jboss.jandex.AnnotationValue

        AnnotationValue value = annotation.value(property);
        return value == null ? true : value.asBoolean();
    }

    private String[] asArray(final AnnotationInstance annotation, String property) {
        AnnotationValue value = annotation.value(property);
        return value == null ? null : value.asStringArray();
    }
View Full Code Here

Examples of org.jboss.jandex.AnnotationValue

    String wsdlLocation() {
        return wsdlLocation;
    }

    private String stringValueOrNull(final AnnotationInstance annotation, final String attribute) {
        final AnnotationValue value = annotation.value(attribute);
        return value != null ? value.asString() : null;
    }
View Full Code Here
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.