Package org.apache.tuscany.sca.cpp.tools.common

Examples of org.apache.tuscany.sca.cpp.tools.common.Headers


            if (!outputDir.exists() && !outputDir.mkdir())
                Utils.rude("Failed to create directory " + outputDir);

            // The class below is the one that will go through the header
            // file(s)
            Headers headers = new Headers();

            if (null != interfaceHeaderFilename) {
                Utils.postEvent(Utils.DEPLOYMENT_ARTEFACT_ENCOUNTERED, file
                        .getAbsolutePath());
                Utils.postEvent(Utils.EVENT_TYPE_FILE_PARSED,
                        "Scagen processing C++ interface header "
                                + file.getAbsolutePath());
                headers.actOnFile(file, outputDir, 1);
                Utils.outputDebugString("Parsing files...");
            }

            String nameOfSorR = null;
            String referenceName = null;
            String serviceName = null;

            if (forReference) {

                Object rn = parameters.get("/componentType/reference/@name");

                if (rn instanceof String) {
                    referenceName = (String) rn;
                    nameOfSorR = referenceName;
                }
            } else {

                Object sn = parameters.get("/componentType/service/@name");

                if (sn instanceof String) {
                    serviceName = (String) sn;
                    nameOfSorR = serviceName;
                }
            }

            String moduleXmlFileHeader = null;
            String moduleXmlFileHeaderNoExt = null;
            Object moduleh = parameters
                    .get("/module/component/implementation.cpp/@header");

            if (moduleh == null) {
                moduleh = parameters
                        .get("/moduleFragment/component/implementation.cpp/@header");
            }

            if (moduleh instanceof String) {
                File f = new File((String) moduleh);
                moduleXmlFileHeader = (String) moduleh;

                String fname = f.getName();
                moduleXmlFileHeaderNoExt = fname.substring(0, fname
                        .lastIndexOf('.'));

            }

            String implClassNameAttrFromModuleFile = (String) parameters
              .get("implClass");
            String implClassNamespaceAttrFromModuleFile = (String) parameters
              .get("implNamespace");
           
            if(implClassNamespaceAttrFromModuleFile == null || implClassNamespaceAttrFromModuleFile.length() == 0)
            {
                implClassNamespaceAttrFromModuleFile = "";
            }
            else
            {
                implClassNamespaceAttrFromModuleFile += "::";
            }
           
            String interfaceClassNameAttrFromComponentTypeFile;
            if (forReference) {
                interfaceClassNameAttrFromComponentTypeFile = (String) parameters
                        .get("/componentType/reference/interface.cpp/@class");
            } else {
                interfaceClassNameAttrFromComponentTypeFile = (String) parameters
                        .get("/componentType/service/interface.cpp/@class");
            }

            List methods = headers.getAllMethods();
           
            // Pull out one of the methods' namespace attributes.
            String intfNamespace = null;
            if (methods.size() > 0) {
                Signature method = (Signature) methods.get(0);
View Full Code Here


        Utils.postEvent(Utils.EVENT_TYPE_FILE_PARSED,
                "Scagen processing C++ implementation header "
                        + header.getAbsolutePath());

        try {
            Headers headers = new Headers();

            headers.actOnFile(header, null, 1);

            methods = headers.getAllMethods();

        } catch (FileNotFoundException fnfe) {
            String path;
            try {
                path = header.getCanonicalPath();
View Full Code Here

        Utils.postEvent(Utils.EVENT_TYPE_FILE_PARSED,
                "Scagen processing C++ implementation header "
                        + header.getAbsolutePath());

        try {
            Headers headers = new Headers();

            headers.actOnFile(header, null, 1);

            methods = headers.getAllMethods();

        } catch (FileNotFoundException fnfe) {
            String path;
            try {
                path = header.getCanonicalPath();
View Full Code Here

            if (!outputDir.exists() && !outputDir.mkdir())
                Utils.rude("Failed to create directory " + outputDir);

            // The class below is the one that will go through the header
            // file(s)
            Headers headers = new Headers();

            if (null != interfaceHeaderFilename) {
                Utils.postEvent(Utils.DEPLOYMENT_ARTEFACT_ENCOUNTERED, file
                        .getAbsolutePath());
                Utils.postEvent(Utils.EVENT_TYPE_FILE_PARSED,
                        "Scagen processing C++ interface header "
                                + file.getAbsolutePath());
                headers.actOnFile(file, outputDir, 1);
                Utils.outputDebugString("Parsing files...");
            }

            String nameOfSorR = null;
            String referenceName = null;
            String serviceName = null;

            if (forReference) {

                Object rn = parameters.get("/componentType/reference/@name");

                if (rn instanceof String) {
                    referenceName = (String) rn;
                    nameOfSorR = referenceName;
                }
            } else {

                Object sn = parameters.get("/componentType/service/@name");

                if (sn instanceof String) {
                    serviceName = (String) sn;
                    nameOfSorR = serviceName;
                }
            }

            String compositeXmlFileHeader = null;
            String compositeXmlFileHeaderNoExt = null;
            Object compositeh = parameters
                    .get("/composite/component/implementation.cpp/@header");

            if (compositeh == null) {
                compositeh = parameters
                        .get("/compositeFragment/component/implementation.cpp/@header");
            }

            if (compositeh instanceof String) {
                File f = new File((String) compositeh);
                compositeXmlFileHeader = (String) compositeh;

                String fname = f.getName();
                compositeXmlFileHeaderNoExt = fname.substring(0, fname
                        .lastIndexOf('.'));

            }

            String implClassNameAttrFromCompositeFile = (String) parameters
              .get("implClass");
            String implClassNamespaceAttrFromCompositeFile = (String) parameters
              .get("implNamespace");
           
            if(implClassNamespaceAttrFromCompositeFile == null || implClassNamespaceAttrFromCompositeFile.length() == 0)
            {
                implClassNamespaceAttrFromCompositeFile = "";
            }
            else
            {
                implClassNamespaceAttrFromCompositeFile += "::";
            }
           
            String interfaceClassNameAttrFromComponentTypeFile;
            if (forReference) {
                interfaceClassNameAttrFromComponentTypeFile = (String) parameters
                        .get("/componentType/reference/interface.cpp/@class");
            } else {
                interfaceClassNameAttrFromComponentTypeFile = (String) parameters
                        .get("/componentType/service/interface.cpp/@class");
            }

            List methods = headers.getAllMethods();
           
            // Pull out one of the methods' namespace attributes.
            String intfNamespace = null;
            if (methods.size() > 0) {
                Signature method = (Signature) methods.get(0);
View Full Code Here

TOP

Related Classes of org.apache.tuscany.sca.cpp.tools.common.Headers

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.