Examples of registerMapping()


Examples of com.thoughtworks.xstream.io.xml.QNameMap.registerMapping()

      else {
        final QNameMap nsm = new QNameMap();
        for (Map.Entry<String,String> me : namespaces.entrySet() ) {
          final String namespaceURI = (String)me.getKey();
          final String localPart = (String)me.getValue();
          nsm.registerMapping(new QName(namespaceURI, localPart), localPart);
        }
        XStream stream = new XStream(new StaxDriver(nsm));
       
        if ("XPATH_RELATIVE_REFERENCES".equals(mode))
        {
View Full Code Here

Examples of com.thoughtworks.xstream.io.xml.QNameMap.registerMapping()

  private List<String> names = new ArrayList<String>();

  public XmlMediaType() {
    QNameMap qnameMap = new QNameMap();
    QName qname = new QName("http://www.w3.org/2005/Atom", "atom");
    qnameMap.registerMapping(qname, DefaultRelation.class);
    // we need the replacer because
    // xstream replaces an _ with __ (two underscore) more information at
    // http://xstream.codehaus.org/faq.html#XML_double_underscores
    XmlFriendlyReplacer replacer = new XmlFriendlyReplacer("$", "_");
    helper = new XStreamHelper(new StaxDriver(qnameMap, replacer));
View Full Code Here

Examples of com.thoughtworks.xstream.io.xml.QNameMap.registerMapping()

  private List<Class> typesToEnhance = new ArrayList<Class>();

  public XmlMediaType() {
    QNameMap qnameMap = new QNameMap();
    QName qname = new QName("http://www.w3.org/2005/Atom", "atom");
    qnameMap.registerMapping(qname, DefaultRelation.class);
    helper = new XStreamHelper(new StaxDriver(qnameMap));
  }


View Full Code Here

Examples of com.thoughtworks.xstream.io.xml.QNameMap.registerMapping()

  private List<String> names = new ArrayList<String>();

  public XmlMediaType(Enhancer enhancer) {
    QNameMap qnameMap = new QNameMap();
    QName qname = new QName("http://www.w3.org/2005/Atom", "atom");
    qnameMap.registerMapping(qname, DefaultRelation.class);
    // we need the replacer because
    // xstream replaces an _ with __ (two underscore) more information at
    // http://xstream.codehaus.org/faq.html#XML_double_underscores
    XmlFriendlyReplacer replacer = new XmlFriendlyReplacer("$", "_");
    helper = new XStreamHelper(new StaxDriver(qnameMap, replacer), enhancer);
View Full Code Here

Examples of org.apache.tuscany.tomcat.TuscanyHost.registerMapping()

    public void testServletMapping() throws Exception {
        TuscanyHost tuscanyHost = (TuscanyHost) host;
        host.addChild(ctx);

        MockServlet servlet = new MockServlet();
        tuscanyHost.registerMapping("/testContext/magicServlet", servlet);
        assertSame(ctx, host.map("/testContext/magicServlet"));
        MessageBytes uri = MessageBytes.newInstance();
        uri.setString("/testContext/magicServlet");
        MappingData mappingData = new MappingData();
        ctx.getMapper().map(uri, mappingData);
View Full Code Here

Examples of org.apache.tuscany.tomcat.TuscanyHost.registerMapping()

    public void testServletMappingWithWildard() throws Exception {
        TuscanyHost tuscanyHost = (TuscanyHost) host;
        host.addChild(ctx);

        MockServlet servlet = new MockServlet();
        tuscanyHost.registerMapping("/testContext/magicServlet/*", servlet);
        assertSame(ctx, host.map("/testContext/magicServlet/foo"));
        MessageBytes uri = MessageBytes.newInstance();
        uri.setString("/testContext/magicServlet/foo");
        MappingData mappingData = new MappingData();
        mappingData.recycle();
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.