Package org.exolab.castor.util

Examples of org.exolab.castor.util.LocalConfiguration


    protected Object readInternal(InputStream is) throws IOException {
        Object object = null;
        try {
            // Use JAXP if we are instructed to do so.
            if (USING_JAXP) {
                LocalConfiguration castorConfig = LocalConfiguration.getInstance();
                // empty string means "use JAXP" for Castor
                castorConfig.getProperties().setProperty("org.exolab.castor.parser", "");
                castorConfig.getProperties().setProperty("org.exolab.castor.xml.serializer.factory",
                        "org.exolab.castor.xml.XercesJDK5XMLSerializerFactory" );
            }
           
            if (LOG.isDebugEnabled()) {
                LOG.debug("Pluto descriptor service implementation using JAXP: [" + USING_JAXP + "]");                       
View Full Code Here


            //  http://castor.org/javadoc/org/exolab/castor/xml/Marshaller.html#setDoctype(java.lang.String,%20java.lang.String)
            Marshaller marshaller = new Marshaller(writer);
            marshaller.setMapping(getCastorMapping());
           
            // Use JAXP if we are instructed to do so.
            LocalConfiguration castorConfig = LocalConfiguration.getInstance();
            if (USING_JAXP) {               
                // empty string means "use JAXP" for Castor
                castorConfig.getProperties().setProperty("org.exolab.castor.parser", "" );               
                castorConfig.getProperties().setProperty("org.exolab.castor.xml.serializer.factory",
                        "org.exolab.castor.xml.XercesJDK5XMLSerializerFactory" );
            }
           
            if (LOG.isDebugEnabled()) {
                LOG.debug("Pluto descriptor service implementation using JAXP: [" + USING_JAXP + "]");                       
            }
           
            castorConfig.getProperties().setProperty("org.exolab.castor.indent", "true");
            setCastorMarshallerOptions(marshaller, object);
            marshaller.marshal(object);
        } catch (IOException e) {
            LOG.error(e.getMessage(), e);
            throw e;
View Full Code Here

        init();
    } //-- Introspector

    private void init() {
       
        LocalConfiguration config = LocalConfiguration.getInstance();
       
        if (_defaultNaming == null) {
            _defaultNaming = config.getXMLNaming();
        }
        _naming = _defaultNaming;
        setPrimitiveNodeType(config.getPrimitiveNodeType());
       
        //-- wrap collections in a container element?
        String wrap = config.getProperty(WRAP_COLLECTIONS_PROPERTY, null);
        if (wrap != null) {
            _wrapCollectionsInContainer = Boolean.valueOf(wrap).booleanValue();
        }
       
        //-- Save Hashtable / Map keys ?
        String saveKeys = config.getProperty(Configuration.Property.SaveMapKeys, null);
        if (saveKeys != null) {
            if ("false".equals(saveKeys) || "off".equals(saveKeys)) {
                _saveMapKeys = false;
            }
        }
View Full Code Here

    public XMLMappingLoader( ClassLoader loader, PrintWriter logWriter )
        throws MappingException
    {
        super( loader, logWriter );
       
        LocalConfiguration config = LocalConfiguration.getInstance();
       
        _primitiveNodeType = config.getPrimitiveNodeType();
        _naming            = config.getXMLNaming();

    } //-- XMLMappingLoader
View Full Code Here

            File file = new File(DEFAULT_FILE);
          Changelog changelog = parser.parse(file);
           
            file = new File(DEFAULT_OUTPUT);
            FileWriter writer = new FileWriter(file);
            LocalConfiguration config = LocalConfiguration.getInstance();
            config.getProperties().setProperty(Configuration.Property.Indent, "true");
            Marshaller marshaller = new Marshaller(writer);
            marshaller.setRootElement("changelog");
            marshaller.setSuppressXSIType(true);
            marshaller.marshal(changelog);
           
View Full Code Here

    protected Object readInternal(InputStream is) throws IOException {
        Object object = null;
        try {
            // Use JAXP if we are instructed to do so.
            if (USING_JAXP) {
                LocalConfiguration castorConfig = LocalConfiguration.getInstance();
                // empty string means "use JAXP" for Castor
                castorConfig.getProperties().setProperty("org.exolab.castor.parser", "");
                castorConfig.getProperties().setProperty("org.exolab.castor.xml.serializer.factory",
                        "org.exolab.castor.xml.XercesJDK5XMLSerializerFactory" );
            }
           
            if (LOG.isDebugEnabled()) {
                LOG.debug("Pluto descriptor service implementation using JAXP: [" + USING_JAXP + "]");                       
View Full Code Here

            //  http://castor.org/javadoc/org/exolab/castor/xml/Marshaller.html#setDoctype(java.lang.String,%20java.lang.String)
            Marshaller marshaller = new Marshaller(writer);
            marshaller.setMapping(getCastorMapping());
           
            // Use JAXP if we are instructed to do so.
            LocalConfiguration castorConfig = LocalConfiguration.getInstance();
            if (USING_JAXP) {               
                // empty string means "use JAXP" for Castor
                castorConfig.getProperties().setProperty("org.exolab.castor.parser", "" );               
                castorConfig.getProperties().setProperty("org.exolab.castor.xml.serializer.factory",
                        "org.exolab.castor.xml.XercesJDK5XMLSerializerFactory" );
            }
           
            if (LOG.isDebugEnabled()) {
                LOG.debug("Pluto descriptor service implementation using JAXP: [" + USING_JAXP + "]");                       
            }
           
            castorConfig.getProperties().setProperty("org.exolab.castor.indent", "true");
            setCastorMarshallerOptions(marshaller, object);
            marshaller.marshal(object);
        } catch(IOException io) {
            throw io;
        } catch (Exception e) {
View Full Code Here

                is = this.getClass().getResourceAsStream(TYPE_DEFINITIONS);
            TypeList typeList = (TypeList)unmarshaller.unmarshal( new org.xml.sax.InputSource(is) );

                //print what we just read (only in debug mode and if we have a logWriter)
                LocalConfiguration config = LocalConfiguration.getInstance();
            if (config.debug() && getLogWriter()!= null)
                  typeList.Print(getLogWriter());

                //Store the types by name in the typesByName and typesByCode hashtables
                //and create for each its associated SimpleType instance.
                Vector types= typeList.getTypes();
View Full Code Here

        init();
    } //-- Introspector

    private void init() {
       
        LocalConfiguration config = LocalConfiguration.getInstance();
       
        if (_defaultNaming == null) {
            _defaultNaming = config.getXMLNaming();
        }
        _naming = _defaultNaming;
        setPrimitiveNodeType(config.getPrimitiveNodeType());
       
        //-- wrap collections in a container element?
        String wrap = config.getProperty(WRAP_COLLECTIONS_PROPERTY, null);
        if (wrap != null) {
            _wrapCollectionsInContainer = Boolean.valueOf(wrap).booleanValue();
        }
       
    }
View Full Code Here

            StringTokenizer tokenizer;
            Class           infoClass;
            Method          method;

            allInfo = new Vector();
            LocalConfiguration config = LocalConfiguration.getInstance();
            tokenizer = new StringTokenizer( config.getProperty( "org.exolab.castor.mapping.collections", "" ), ", " );
            while ( tokenizer.hasMoreTokens() ) {
                try {
                    if ( CollectionHandlers.class.getClassLoader() != null )
                        infoClass = CollectionHandlers.class.getClassLoader().loadClass( tokenizer.nextToken() );
                    else
View Full Code Here

TOP

Related Classes of org.exolab.castor.util.LocalConfiguration

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.