Package org.exolab.castor.builder.binding.xml

Examples of org.exolab.castor.builder.binding.xml.PackageType


            _binding.setDefaultBindingType(loaded.getDefaultBindingType());

            //--packages
            Enumeration<PackageType> packages = loaded.enumeratePackage();
            while (packages.hasMoreElements()) {
                PackageType tempPackage = packages.nextElement();
                _binding.addPackage(tempPackage);
            }

            //--NamingXML
            NamingXMLType naming = loaded.getNamingXML();
View Full Code Here


        if (packages.length == 0) {
            return;
        }

        for (int i = 0; i < packages.length; i++) {
            PackageType temp = packages[i];
            PackageTypeChoice choice = temp.getPackageTypeChoice();
            if (choice.getNamespace() != null) {
                super.setNamespacePackageMapping(choice.getNamespace(), temp.getName());
            } else if (choice.getSchemaLocation() != null) {
                //1--Handle relative locations
                String tempLocation = choice.getSchemaLocation();
                String currentDir = System.getProperty("user.dir");
                currentDir = currentDir.replace('\\', '/');
                if (tempLocation.startsWith("./")) {
                    tempLocation = tempLocation.substring(1);
                    tempLocation = currentDir + tempLocation;
                } else if (tempLocation.startsWith("../")) {
                     tempLocation = tempLocation.substring("../".length());
                     int lastDir = currentDir.lastIndexOf('/');
                     currentDir = currentDir.substring(0, lastDir + 1);
                     tempLocation = currentDir + tempLocation;
                }
                super.setLocationPackageMapping(tempLocation, temp.getName());
                currentDir = null;
                tempLocation = null;
            }
        }
    }
View Full Code Here

TOP

Related Classes of org.exolab.castor.builder.binding.xml.PackageType

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.