Examples of registerConverter()


Examples of com.dotcms.repackage.com.thoughtworks.xstream.XStream.registerConverter()

        if(clazz.equals(DashboardSummary404.class) || clazz.equals(DashboardUserPreferences.class)){
          _xstream.addDefaultImplementation(com.dotcms.repackage.net.sf.hibernate.collection.Set.class, java.util.Set.class);
          _xstream.addDefaultImplementation(com.dotcms.repackage.net.sf.hibernate.collection.List.class, java.util.List.class);
          _xstream.addDefaultImplementation(com.dotcms.repackage.net.sf.hibernate.collection.Map.class, java.util.Map.class);
          Mapper mapper = _xstream.getMapper();
          _xstream.registerConverter(new HibernateCollectionConverter(mapper));
          _xstream.registerConverter(new HibernateMapConverter(mapper));
        }

        /*
         * String _shortClassName =
View Full Code Here

Examples of com.opensymphony.xwork2.conversion.impl.XWorkConverter.registerConverter()

        Foo foo = new Foo();
        ValueStack vs = ActionContext.getContext().getValueStack();
        vs.getContext().put(XWorkConverter.REPORT_CONVERSION_ERRORS, Boolean.TRUE);

        XWorkConverter c = (XWorkConverter)((OgnlTypeConverterWrapper) Ognl.getTypeConverter(vs.getContext())).getTarget();
        c.registerConverter(Cat.class.getName(), new FooBarConverter());
        vs.push(foo);

        vs.setValue("cats", new String[]{"1", "2"});
        assertNotNull(foo.getCats());
        assertEquals(2, foo.getCats().size());
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.registerConverter()

    public static String serialize(final Object object) {
        String result = null;

        XStream xstream = new XStream();
        xstream.registerConverter(new GuardedStringConverter());
        try {
            result = URLEncoder.encode(xstream.toXML(object), SyncopeConstants.DEFAULT_ENCODING);
        } catch (UnsupportedEncodingException e) {
            LOG.error("During serialization", e);
        }
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.registerConverter()

    @SuppressWarnings("unchecked")
    public static <T extends Object> T deserialize(final String serialized) {
        T result = null;

        XStream xstream = new XStream();
        xstream.registerConverter(new GuardedStringConverter());
        try {
            result = (T) xstream.fromXML(URLDecoder.decode(serialized, SyncopeConstants.DEFAULT_ENCODING));
        } catch (UnsupportedEncodingException e) {
            LOG.error("During deserialization", e);
        }
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.registerConverter()

    @SuppressWarnings("unchecked")
    private void read(InputStream input) {
        m_roles.clear();
        // We use DomDriver because the standard XPP driver has issues with attributes.
        XStream xstream = new XStream(/*new DomDriver()*/);
        xstream.registerConverter(ROLEMAPCONVERTER);
        xstream.registerConverter(ROLECONVERTER);
        xstream.registerConverter(DICTCONVERTER);
        xstream.aliasType("roles", Map.class);
        try {
            Map<String, RoleImpl> fromXML = (Map<String, RoleImpl>) xstream.fromXML(input);
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.registerConverter()

    private void read(InputStream input) {
        m_roles.clear();
        // We use DomDriver because the standard XPP driver has issues with attributes.
        XStream xstream = new XStream(/*new DomDriver()*/);
        xstream.registerConverter(ROLEMAPCONVERTER);
        xstream.registerConverter(ROLECONVERTER);
        xstream.registerConverter(DICTCONVERTER);
        xstream.aliasType("roles", Map.class);
        try {
            Map<String, RoleImpl> fromXML = (Map<String, RoleImpl>) xstream.fromXML(input);
            m_roles.putAll(fromXML);
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.registerConverter()

        m_roles.clear();
        // We use DomDriver because the standard XPP driver has issues with attributes.
        XStream xstream = new XStream(/*new DomDriver()*/);
        xstream.registerConverter(ROLEMAPCONVERTER);
        xstream.registerConverter(ROLECONVERTER);
        xstream.registerConverter(DICTCONVERTER);
        xstream.aliasType("roles", Map.class);
        try {
            Map<String, RoleImpl> fromXML = (Map<String, RoleImpl>) xstream.fromXML(input);
            m_roles.putAll(fromXML);
        }
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.registerConverter()

     * @throws java.io.IOException When there is a problem creating the stream, or
     * the other end of the stream fails.
     */
    private void write(OutputStream out) throws IOException {
        XStream xstream = new XStream(new DomDriver());
        xstream.registerConverter(ROLEMAPCONVERTER);
        xstream.registerConverter(ROLECONVERTER);
        xstream.registerConverter(DICTCONVERTER);
        xstream.aliasType("roles", Map.class);
        xstream.toXML(m_roles, out);
        try {
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.registerConverter()

     * the other end of the stream fails.
     */
    private void write(OutputStream out) throws IOException {
        XStream xstream = new XStream(new DomDriver());
        xstream.registerConverter(ROLEMAPCONVERTER);
        xstream.registerConverter(ROLECONVERTER);
        xstream.registerConverter(DICTCONVERTER);
        xstream.aliasType("roles", Map.class);
        xstream.toXML(m_roles, out);
        try {
            out.close();
View Full Code Here

Examples of com.thoughtworks.xstream.XStream.registerConverter()

     */
    private void write(OutputStream out) throws IOException {
        XStream xstream = new XStream(new DomDriver());
        xstream.registerConverter(ROLEMAPCONVERTER);
        xstream.registerConverter(ROLECONVERTER);
        xstream.registerConverter(DICTCONVERTER);
        xstream.aliasType("roles", Map.class);
        xstream.toXML(m_roles, out);
        try {
            out.close();
        }
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.