Package com.webobjects.appserver.xml

Examples of com.webobjects.appserver.xml.WOXMLDecoder


                String eoModelPath = NSPathUtilities.stringByDeletingLastPathComponent(eomodel.path());
                eoModelPath = NSPathUtilities.stringByAppendingPathComponent(eoModelPath, eomodel.name());
                eoModelPath = NSPathUtilities.stringByAppendingPathExtension(eoModelPath, "eomodeld");
                String gsvModelPath = NSPathUtilities.stringByAppendingPathComponent(eoModelPath, GSVModel.MODEL_NAME);
                gsvModelPath = NSPathUtilities.stringByAppendingPathExtension(gsvModelPath, GSVModel.MODEL_EXTENSION);
                WOXMLDecoder decoder = WOXMLDecoder.decoder();
                decoder.setEncoding("UTF-8");
                model = (GSVModel)decoder.decodeRootObject(gsvModelPath);
                model.setEomodelPath(eoModelPath)//not sure why we need to do this?
    model.init(eomodel);

                model.saveModel();          //not sure why we need to do this?
               //now cache
View Full Code Here


        }
       
        NSArray possVals = null;
       
        if (rawpossVals instanceof String) {
            WOXMLDecoder decoder = WOXMLDecoder.decoder();
            String xmlString = new String(Base64.decodeBase64((String) rawpossVals));
            log.info("xmlString: " + xmlString);
            StringReader stringReader = new StringReader(xmlString);
            InputSource is = new InputSource(stringReader);
            // invoke setEncoding (on the input source) if the XML contains multibyte characters
            try {
                possVals = (NSArray)decoder.decodeRootObject(is);
            } catch(Exception e) {
                //OWDebug.println(1, "e:"+e);
            }
            //possVals = NSArchiver .unarchiveObjectWithData(rawpossVals);
        } else if(rawpossVals instanceof NSArray){
View Full Code Here

         * @param string
         * @param mappingUrl
         * @return xml data object
         */
        public static XMLData dataForString(String string, String mappingUrl) {
            WOXMLDecoder decoder = WOXMLDecoder.decoderWithMapping(mappingUrl);
            XMLData data;
            try {
              data = (XMLData) decoder.decodeRootObject(new NSData(string.getBytes(CharEncoding.UTF_8)));
            } catch (UnsupportedEncodingException e) {
                throw NSForwardException._runtimeExceptionForThrowable(e);
            }
            data.completeDecoding();
            return data;
View Full Code Here

TOP

Related Classes of com.webobjects.appserver.xml.WOXMLDecoder

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.