Package org.jdom

Examples of org.jdom.Namespace


    @SuppressWarnings("unchecked")
    public static List<ServiceEndpointDescription> getAllRemoteReferences(Bundle b) {
        List<Element> references = getAllDescriptionElements(b);
       
        List<ServiceEndpointDescription> srefs = new ArrayList<ServiceEndpointDescription>();
        Namespace ns = Namespace.getNamespace(REMOTE_SERVICES_NS);
        for (Element ref : references) {
            List<String> iNames = getProvidedInterfaces(ref.getChildren(PROVIDE_INTERFACE_ELEMENT, ns));
            Map<String, Object> remoteProps = getProperties(ref.getChildren(PROPERTY_ELEMENT, ns));
            srefs.add(new ServiceEndpointDescriptionImpl(iNames, remoteProps));
        }
View Full Code Here


        List<Element> elements = new ArrayList<Element>();
        while (urls.hasMoreElements()) {
            URL resourceURL = (URL) urls.nextElement();
            try {
                Document d = new SAXBuilder().build(resourceURL.openStream());
                Namespace ns = Namespace.getNamespace(REMOTE_SERVICES_NS);
                elements.addAll(d.getRootElement().getChildren(SERVICE_DESCRIPTION_ELEMENT, ns));
            } catch (Exception ex) {
                LOG.log(Level.WARNING, "Problem parsing: " + resourceURL, ex);
            }           
        }
View Full Code Here

                Collections.enumeration(Arrays.asList(rs1URL))).anyTimes();
        EasyMock.replay(b);
       
        List<Element> rsElements = OsgiUtils.getAllDescriptionElements(b);
        assertEquals(2, rsElements.size());
        Namespace ns = Namespace.getNamespace("http://www.osgi.org/xmlns/sd/v1.0.0");
        assertEquals("SomeService", rsElements.get(0).getChild("provide", ns).getAttributeValue("interface"));
        assertEquals("SomeOtherService", rsElements.get(1).getChild("provide", ns).getAttributeValue("interface"));
    }
View Full Code Here

                Collections.enumeration(Arrays.asList(rs1URL, rs2URL))).anyTimes();
        EasyMock.replay(b);
       
        List<Element> rsElements = OsgiUtils.getAllDescriptionElements(b);
        assertEquals(3, rsElements.size());
        Namespace ns = Namespace.getNamespace("http://www.osgi.org/xmlns/sd/v1.0.0");
        assertEquals("SomeService", rsElements.get(0).getChild("provide", ns).getAttributeValue("interface"));
        assertEquals("SomeOtherService", rsElements.get(1).getChild("provide", ns).getAttributeValue("interface"));
        assertEquals("org.example.Service", rsElements.get(2).getChild("provide", ns).getAttributeValue("interface"));
    }
View Full Code Here

                Collections.enumeration(Arrays.asList(rs1URL))).anyTimes();
        EasyMock.replay(b);
       
        List<Element> rsElements = OsgiUtils.getAllDescriptionElements(b);
        assertEquals(2, rsElements.size());
        Namespace ns = Namespace.getNamespace("http://www.osgi.org/xmlns/sd/v1.0.0");
        assertEquals("SomeService", rsElements.get(0).getChild("provide", ns).getAttributeValue("interface"));
        assertEquals("SomeOtherService", rsElements.get(1).getChild("provide", ns).getAttributeValue("interface"));
    }
View Full Code Here

               
                // We prefer explicit prefixes over those generated in the types.
                // This loop may have intended to support prefixes from individual aegis files,
                // but that isn't a good idea.
                for (Iterator itr = e.getAdditionalNamespaces().iterator(); itr.hasNext();) {
                    Namespace n = (Namespace) itr.next();
                    if (!nsMap.containsValue(n.getURI())) {
                        nsMap.add(n.getPrefix(), n.getURI());
                    }
                }

                org.w3c.dom.Document schema = new DOMOutputter().output(new Document(e));
View Full Code Here

        }
        return false;
    }

    private void processChildren(Element elem, List ns) {
        Namespace nsCourent = elem.getNamespace();
        String nsUri = (nsCourent.getURI());
        if (!exist(ns, nsUri)) {
            ns.add(nsUri.trim());
        }
        List additionalNs = elem.getAdditionalNamespaces();
        if (!additionalNs.isEmpty())
View Full Code Here

    private XPath tokenExpression;

    public WSTokenAuthService()
            throws JDOMException
    {
        Namespace namespace = Namespace.getNamespace(WSConstants.NAMESPACE_PREFIX_CRIS,
                WSConstants.NAMESPACE_CRIS);
        tokenExpression = XPath.newInstance("//cris:Token");
        tokenExpression.addNamespace(namespace);
    }
View Full Code Here

    {
        StringWriter writer = new StringWriter();

        String namespaceRoot = WSConstants.NAMESPACE_CRIS;
       
        Namespace echoNamespaceRoot = Namespace.getNamespace(WSConstants.NAMESPACE_PREFIX_CRIS,
                namespaceRoot);
        UtilsXML xml = new UtilsXML(writer, applicationService);
        xml.createPagination(hit, start, docList.size());
        xml.createType(type);
        xml.setSeeHiddenValue(seeHiddenValue);
        org.jdom.Document xmldoc = null;
        try
        {

            xmldoc = xml.createRoot(responseRootName, echoNamespaceRoot.getPrefix(),
                    echoNamespaceRoot.getURI());
        }
        catch (IOException e)
        {
            log.error(e.getMessage(), e);
        }
        catch (ParserConfigurationException e)
        {
            log.error(e.getMessage(), e);
        }
       
        // build the response XML with JDOM
        Namespace echoNamespace = Namespace.getNamespace(namespacePrefix,
                namespace);
       
        Element child = new Element("crisobjects", echoNamespace.getPrefix(),echoNamespace.getURI());
        xmldoc.getRootElement().addContent(child);
               
        if (docList != null)
        {
            List<IContainable> tmp_containables = new LinkedList<IContainable>();
View Full Code Here

    @Override
    public Element buildResponse(List<WSItem> docList, long start, long hit,
            String type, String[] splitProjection, boolean showHiddenMetadata, String nameRoot)
    {
       
        Namespace echoNamespaceRoot = Namespace.getNamespace("cris",
                WSConstants.NAMESPACE_CRIS);
        Element root = new Element(nameRoot, echoNamespaceRoot);
        root.setAttribute("hit", "" + hit);
        root.setAttribute("start", "" + start);
        root.setAttribute("rows", "" + docList.size());       
        root.setAttribute("type", "" + type);
       
        // build the response XML with JDOM
        Namespace echoNamespace = Namespace.getNamespace(WSConstants.NAMESPACE_PREFIX_ITEM,
                WSConstants.NAMESPACE_ITEM);

        Element child = new Element("crisobjects", echoNamespace);    
                   
View Full Code Here

TOP

Related Classes of org.jdom.Namespace

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.