Examples of Types


Examples of javax.lang.model.util.Types

    public synchronized AnnotationMirror getOperatorAnnotation(ExecutableElement element) {
        TypeMirror targetType = environment
                .getElementUtils()
                .getTypeElement(targetOperatorAnnotation.getName())
                .asType();
        Types types = environment.getTypeUtils();
        for (AnnotationMirror annotation : element.getAnnotationMirrors()) {
            if (types.isSameType(annotation.getAnnotationType(), targetType)) {
                return annotation;
            }
        }
        return null;
    }
View Full Code Here

Examples of javax.lang.model.util.Types

            TypeMirror firstParameter) throws ResolveException {
        assert environment != null;
        assert selectorMethod != null;
        assert firstParameter != null;
        TypeMirror erasedSelector = environment.getErasure(firstParameter);
        Types types = environment.getTypeUtils();
        if (types.isSameType(erasedSelector, environment.getDeclaredType(List.class)) == false) {
            throw new ResolveException(MessageFormat.format(
                    "マスタ選択を行うメソッド{0}の1つめの引数は、List<...>の形式でなければなりません",
                    selectorMethod.getSimpleName()));
        }
        DeclaredType list = (DeclaredType) firstParameter;
View Full Code Here

Examples of javax.lang.model.util.Types

            VariableElement variable = (VariableElement) member;
            TypeMirror constantType = variable.asType();
            if (constantType.getKind() != TypeKind.DECLARED) {
                return false;
            }
            Types types = environment.getTypeUtils();
            return types.isSameType(constantType, type);
        }
View Full Code Here

Examples of javax.lang.model.util.Types

  }

  public static String extractClosestRealTypeAsString(TypeMirror type, Context context) {
    if ( type instanceof TypeVariable ) {
      final TypeMirror compositeUpperBound = ( ( TypeVariable ) type ).getUpperBound();
      final Types types = context.getProcessingEnvironment().getTypeUtils();
      final List<? extends TypeMirror> upperBounds = types.directSupertypes( compositeUpperBound );
      if ( upperBounds.size() == 0 ) {
        return compositeUpperBound.toString();
      }
      else {
        //take the first one
View Full Code Here

Examples of javax.wsdl.Types

        final String value)
    {
        Element element = null;
        if (value != null)
        {
            final Types types = definition.getTypes();
            final Collection elements = types.getExtensibilityElements();
            for (final Iterator iterator = elements.iterator(); iterator.hasNext();)
            {
                final Object object = iterator.next();
                if (object instanceof Schema)
                {
View Full Code Here

Examples of javax.wsdl.Types

    }

    private static Collection<Schema> getSchemas(final Definition definition)
    {
        final Collection<Schema> schemas = new ArrayList<Schema>();
        final Types types = definition.getTypes();
        final Collection elements = types.getExtensibilityElements();
        for (final Iterator iterator = elements.iterator(); iterator.hasNext();)
        {
            final Object object = iterator.next();
            if (object instanceof Schema)
            {
View Full Code Here

Examples of javax.wsdl.Types

    private static Schema getElementSchemaByAttribute(
        final Definition definition,
        final String attribute,
        final String value)
    {
        final Types types = definition.getTypes();
        final Collection elements = types.getExtensibilityElements();
        Schema schema = null;
        for (final Iterator iterator = elements.iterator(); iterator.hasNext();)
        {
            final Object object = iterator.next();
            if (object instanceof Schema)
View Full Code Here

Examples of javax.wsdl.Types

            wmodel.getJaxbContext().generateSchema(resolver);
        } catch (Exception e2) {
            throw new ToolException(msg, e2);
        }

        Types types = definition.createTypes();

        try {
            Schema schema;

            schema = (Schema)extensionRegistry.createExtension(Types.class,
                                                               new QName("http://www.w3.org/2001/XMLSchema",
                                                                         "schema"));

            DocumentBuilder docBuilder;
            docBuilder = DocumentBuilderFactory.newInstance().newDocumentBuilder();
            Document doc = docBuilder.newDocument();
            Element element = doc.createElement("xsd:schema");
            Map<String, String> schemafileMap = wmodel.getSchemaNSFileMap();

            Set<Map.Entry<String, String>> entryset = schemafileMap.entrySet();
            Iterator<Map.Entry<String, String>> ite = entryset.iterator();
            while (ite.hasNext()) {
                Map.Entry<String, String> entry = (Map.Entry<String, String>)ite.next();
                Element importelement = doc.createElement("xsd:import");
                importelement.setAttribute("namespace", entry.getKey());
                importelement.setAttribute("schemaLocation", entry.getValue());
                element.appendChild(importelement);
            }
            schema.setElement(element);
            types.addExtensibilityElement(schema);
            definition.setTypes(types);
        } catch (Exception e) {
            throw new ToolException(msg, e);
        }
View Full Code Here

Examples of javax.wsdl.Types

        this.wsdlDefinition.setTargetNamespace((String)env.get(ToolConstants.CFG_NAMESPACE));
        this.wsdlDefinition
            .setQName(new QName(WSDLConstants.NS_WSDL, (String)env.get(ToolConstants.CFG_NAME)));

        Types types = this.wsdlDefinition.createTypes();
        ExtensibilityElement extElement;
        try {
            registry = wsdlFactory.newPopulatedExtensionRegistry();
            registerJAXWSBinding(Definition.class);
            registerJAXWSBinding(Types.class);
            registerJAXWSBinding(Schema.class);
            extElement = registry.createExtension(Types.class, new QName(WSDLConstants.XSD_NAMESPACE,
                                                                         "schema"));
        } catch (WSDLException wse) {
            Message msg = new Message("FAIL_TO_CREATE_SCHEMA_EXTENSION", LOG);
            throw new ToolException(msg, wse);
        }
        ((Schema)extElement).setElement(targetElement);
        types.addExtensibilityElement(extElement);
        this.wsdlDefinition.setTypes(types);

        WSDLWriter wsdlWriter = wsdlFactory.newWSDLWriter();
        Writer outputWriter = getOutputWriter();
View Full Code Here

Examples of javax.wsdl.Types

            throw new ToolException(msg, e);
        }
    }

    private void extractSchema(Definition def) {
        Types typesElement = def.getTypes();
        if (typesElement != null) {
            Iterator ite = typesElement.getExtensibilityElements().iterator();
            while (ite.hasNext()) {
                Object obj = ite.next();
                if (obj instanceof Schema) {
                    Schema schema = (Schema)obj;
                    addSchema(schema);
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.