Package net.java.dev.wadl.x2009.x02.MethodDocument

Examples of net.java.dev.wadl.x2009.x02.MethodDocument.Method


    Map<String, Response> responses = new HashMap<String, Response>();
    if( !isWADL11 )
      responses.put( null, methodConfig.addNewResponse() );
    for( RestRepresentation representation : restMethod.getRepresentations() )
    {
      Response response;
      if( isWADL11 )
      {
        List<Comparable> status = new ArrayList<Comparable>( ( List<Comparable> )representation.getStatus() );
        Collections.sort( status );
        StringBuilder statusStrBuilder = new StringBuilder();
        for( Object o : status )
          statusStrBuilder.append( o ).append( " " );
        String statusStr = statusStrBuilder.toString();

        if( !responses.containsKey( statusStr ) )
        {
          response = methodConfig.addNewResponse();
          response.setStatus( status );
          responses.put( statusStr, response );
        }
        else
        {
          response = responses.get( statusStr );
        }
      }
      else
      {
        response = responses.get( null );
      }

      Representation representationConfig = response.addNewRepresentation();
      generateRepresentation( representationConfig, representation );

      if( !isWADL11 && representation.getType() == RestRepresentation.Type.FAULT )
      {
        Element resp = ( Element )response.getDomNode();
        Element rep = ( Element )representationConfig.getDomNode();
        Element fault = resp.getOwnerDocument().createElementNS( Constants.WADL11_NS, "fault" );

        NamedNodeMap attributes = rep.getAttributes();
        for( int i = 0; i < attributes.getLength(); i++ )
View Full Code Here


        Map<String, Response> responses = new HashMap<String, Response>();
        if (!isWADL11) {
            responses.put(null, methodConfig.addNewResponse());
        }
        for (RestRepresentation representation : restMethod.getRepresentations()) {
            Response response;
            if (isWADL11) {
                List<Comparable> status = new ArrayList<Comparable>((List<Comparable>) representation.getStatus());
                Collections.sort(status);
                StringBuilder statusStrBuilder = new StringBuilder();
                for (Object o : status) {
                    statusStrBuilder.append(o).append(" ");
                }
                String statusStr = statusStrBuilder.toString();

                if (!responses.containsKey(statusStr)) {
                    response = methodConfig.addNewResponse();
                    response.setStatus(status);
                    responses.put(statusStr, response);
                } else {
                    response = responses.get(statusStr);
                }
            } else {
                response = responses.get(null);
            }

            Representation representationConfig = response.addNewRepresentation();
            generateRepresentation(representationConfig, representation);

            if (!isWADL11 && representation.getType() == RestRepresentation.Type.FAULT) {
                Element resp = (Element) response.getDomNode();
                Element rep = (Element) representationConfig.getDomNode();
                Element fault = resp.getOwnerDocument().createElementNS(Constants.WADL11_NS, "fault");

                NamedNodeMap attributes = rep.getAttributes();
                for (int i = 0; i < attributes.getLength(); i++) {
View Full Code Here

        _qnameMap = new LinkedHashMap();
        _extensionHolder = new ExtensionHolder();

        for (int i = 0; i < configs.length; i++)
        {
            Config config = configs[i];
            Nsconfig[] nsa = config.getNamespaceArray();
            for (int j = 0; j < nsa.length; j++)
            {
                recordNamespaceSetting(nsa[j].getUri(), nsa[j].getPackage(), _packageMap);
                recordNamespaceSetting(nsa[j].getUri(), nsa[j].getPrefix(), _prefixMap);
                recordNamespaceSetting(nsa[j].getUri(), nsa[j].getSuffix(), _suffixMap);
            }
           
            Qnameconfig[] qnc = config.getQnameArray();
            for (int j = 0; j < qnc.length; j++)
            {
                _qnameMap.put(qnc[j].getName(), qnc[j].getJavaname());
            }

            Extensionconfig[] ext = config.getExtensionArray();
            for (int j = 0; j < ext.length; j++)
            {
                recordExtensionSetting(ext[j]);
            }
        }
View Full Code Here

        _qnameMap = new SequencedHashMap();
        _extensionHolder = new ExtensionHolder();

        for (int i = 0; i < configs.length; i++)
        {
            Config config = configs[i];
            Nsconfig[] nsa = config.getNamespaceArray();
            for (int j = 0; j < nsa.length; j++)
            {
                recordNamespaceSetting(nsa[j].getUri(), nsa[j].getPackage(), _packageMap);
                recordNamespaceSetting(nsa[j].getUri(), nsa[j].getPrefix(), _prefixMap);
                recordNamespaceSetting(nsa[j].getUri(), nsa[j].getSuffix(), _suffixMap);
                recordNamespacePrefixSetting(nsa[j].getUriprefix(), nsa[j].getPackage(), _packageMapByUriPrefix);
                recordNamespacePrefixSetting(nsa[j].getUriprefix(), nsa[j].getPrefix(), _prefixMapByUriPrefix);
                recordNamespacePrefixSetting(nsa[j].getUriprefix(), nsa[j].getSuffix(), _suffixMapByUriPrefix);
            }
           
            Qnameconfig[] qnc = config.getQnameArray();
            for (int j = 0; j < qnc.length; j++)
            {
                _qnameMap.put(qnc[j].getName(), qnc[j].getJavaname());
            }

            Extensionconfig[] ext = config.getExtensionArray();
            for (int j = 0; j < ext.length; j++)
            {
                recordExtensionSetting(ext[j]);
            }
        }
View Full Code Here

        _qnameMap = new LinkedHashMap();
        _extensionHolder = new ExtensionHolder();

        for (int i = 0; i < configs.length; i++)
        {
            Config config = configs[i];
            Nsconfig[] nsa = config.getNamespaceArray();
            for (int j = 0; j < nsa.length; j++)
            {
                recordNamespaceSetting(nsa[j].getUri(), nsa[j].getPackage(), _packageMap);
                recordNamespaceSetting(nsa[j].getUri(), nsa[j].getPrefix(), _prefixMap);
                recordNamespaceSetting(nsa[j].getUri(), nsa[j].getSuffix(), _suffixMap);
                recordNamespacePrefixSetting(nsa[j].getUriprefix(), nsa[j].getPackage(), _packageMapByUriPrefix);
                recordNamespacePrefixSetting(nsa[j].getUriprefix(), nsa[j].getPrefix(), _prefixMapByUriPrefix);
                recordNamespacePrefixSetting(nsa[j].getUriprefix(), nsa[j].getSuffix(), _suffixMapByUriPrefix);
            }
           
            Qnameconfig[] qnc = config.getQnameArray();
            for (int j = 0; j < qnc.length; j++)
            {
                _qnameMap.put(qnc[j].getName(), qnc[j].getJavaname());
            }

            Extensionconfig[] ext = config.getExtensionArray();
            for (int j = 0; j < ext.length; j++)
            {
                recordExtensionSetting(ext[j]);
            }
        }
View Full Code Here

        _prefixMap = new LinkedHashMap();
        _suffixMap = new LinkedHashMap();
        _qnameMap = new LinkedHashMap();
        for (int i = 0; i < configs.length; i++)
        {
            Config config = configs[i];
            Nsconfig[] nsa = config.getNamespaceArray();
            for (int j = 0; j < nsa.length; j++)
            {
                recordNamespaceSetting(nsa[j].getUri(), nsa[j].getPackage(), _packageMap);
                recordNamespaceSetting(nsa[j].getUri(), nsa[j].getPrefix(), _prefixMap);
                recordNamespaceSetting(nsa[j].getUri(), nsa[j].getSuffix(), _suffixMap);
            }
           
            Qnameconfig[] qnc = config.getQnameArray();
            for (int j = 0; j < qnc.length; j++)
            {
                _qnameMap.put(qnc[j].getName(), qnc[j].getJavaname());
            }
        }
View Full Code Here

        {
            XmlOptions ltgOptions = new XmlOptions();
            ltgOptions.setLoadSubstituteNamespaces(Collections.singletonMap("", "http://xml.apache.org/xmlbeans/2004/02/xmlbean/ltgfmt"));
            ltgOptions.setErrorListener(errors);
            ltgOptions.setLoadLineNumbers();
            TestsDocument doc = TestsDocument.Factory.parse(ltgFile, ltgOptions);
            if (!doc.validate(ltgOptions))
                throw new Exception("Document " + ltgFile + " not valid.");

            org.apache.xml.xmlbeans.x2004.x02.xmlbean.ltgfmt.TestCase[] testCases = doc.getTests().getTestArray();

            Collection result = new ArrayList();
            for (int i = 0; i < testCases.length; i++)
            {
                TestCase newCase = new TestCase();
View Full Code Here

        {
            XmlOptions ltgOptions = new XmlOptions();
            ltgOptions.setLoadSubstituteNamespaces(Collections.singletonMap("", "http://xml.apache.org/xmlbeans/2004/02/xmlbean/ltgfmt"));
            ltgOptions.setErrorListener(errors);
            ltgOptions.setLoadLineNumbers();
            TestsDocument doc = TestsDocument.Factory.parse(ltgFile, ltgOptions);
            if (!doc.validate(ltgOptions))
                throw new Exception("Document " + ltgFile + " not valid.");
           
            org.apache.xml.xmlbeans.x2004.x02.xmlbean.ltgfmt.TestCase[] testCases = doc.getTests().getTestArray();
           
            Collection result = new ArrayList();
            for (int i = 0; i < testCases.length; i++)
            {
                TestCase newCase = new TestCase();
View Full Code Here

            {
                // unable to read digest... no problem, ignore then
            }

            // ok, this really is a new XSD file then, of unknown URL origin
            DownloadedSchemaEntry newEntry = addNewEntry();
            newEntry.setFilename(filename);
            warning("Caching information on new local file " + filename);
            if (digest != null)
                newEntry.setSha1(digest);

            seenResources.add(updateResource(newEntry));
        }

        if (deleteOnlyMentioned)
View Full Code Here

        }

        DownloadedSchemas downloadedSchemas = _importsDoc.getDownloadedSchemas();
        for (int i = 0; i < downloadedSchemas.sizeOfEntryArray(); i++)
        {
            DownloadedSchemaEntry cacheEntry = downloadedSchemas.getEntryArray(i);

            if (seenCacheEntries.contains(cacheEntry) == setToDelete)
            {
                SchemaResource resource = (SchemaResource)_resourceForCacheEntry.get(cacheEntry);
                warning("Removing obsolete cache entry for " + resource.getFilename());
View Full Code Here

TOP

Related Classes of net.java.dev.wadl.x2009.x02.MethodDocument.Method

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.