Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
   *
   * Copyright 1997-2007 Sun Microsystems, Inc. All rights reserved.
   *
   * The contents of this file are subject to the terms of either the GNU
   * General Public License Version 2 only ("GPL") or the Common
   * Development and Distribution License("CDDL") (collectively, the
   * "License"). You may not use this file except in compliance with the
  * License. You can obtain a copy of the License at
  * http://www.netbeans.org/cddl-gplv2.html
  * or nbbuild/licenses/CDDL-GPL-2-CP. See the License for the
  * specific language governing permissions and limitations under the
  * License.  When distributing the software, include this License Header
  * Notice in each file and include the License file at
  * nbbuild/licenses/CDDL-GPL-2-CP.  Sun designates this
  * particular file as subject to the "Classpath" exception as provided
  * by Sun in the GPL Version 2 section of the License file that
  * accompanied this code. If applicable, add the following below the
  * License Header, with the fields enclosed by brackets [] replaced by
  * your own identifying information:
  * "Portions Copyrighted [year] [name of copyright owner]"
  *
  * Contributor(s):
  *
  * The Original Software is NetBeans. The Initial Developer of the Original
  * Software is Sun Microsystems, Inc. Portions Copyright 1997-2007 Sun
  * Microsystems, Inc. All Rights Reserved.
  *
  * If you wish your version of this file to be governed by only the CDDL
  * or only the GPL Version 2, indicate your decision by adding
  * "[Contributor] elects to include this software in this distribution
  * under the [CDDL or GPL Version 2] license." If you do not indicate a
  * single choice of license, a recipient has the option to distribute
  * your version of this file under either the CDDL, the GPL Version 2 or
  * to extend the choice of license to its licensees as provided above.
  * However, if you add GPL Version 2 code and therefore, elected the GPL
  * Version 2 license, then the option applies only if the new code is
  * made subject to such option by the copyright holder.
  */
 package org.netbeans.modules.cnd.makeproject.configurations;
 
 import java.util.List;
Common subclass to ConfigurationXMLCodec and AuxConfigurationXMLCodec
 
Change History: V62 - NB 6.7 SOURCE_FOLDER_FILTER_ELEMENT V61 - NB 6.7 Store only C/C++ files in disk file list. Other files are dynamically added to view. V60 - NB 6.7 PACK_ADDITIONAL_INFOS_LIST_ELEMENT V59 (?) - NB 6.7 QT_QMAKE_SPEC_ELEMENT V58 - NB 6.7 CCOMPILERTOOL_ELEMENT2 CCCOMPILERTOOL_ELEMENT2 INCLUDE_DIRECTORIES_ELEMENT2 PATH_ELEMENT V57 - NB 6.7 new attributs for ITEM_ELEMENT: <item path="../gcc/zlib/examples/gzlog.h" ex="true" tool="1"> V56 - NB 6.7 Dont write ITEM_ELEMENT (item configuration) if default values V55 - NB 6.7 DISK_FOLDER_ELEMENT ITEM_NAME_ELEMENT V54 - NB 6.7 Qt settings are persisted: QT_ELEMENT QT_DESTDIR_ELEMENT QT_TARGET_ELEMENT QT_TARGET_VERSION_ELEMENT QT_BUILD_MODE_ELEMENT QT_MODULES_ELEMENT QT_MOC_DIR_ELEMENT QT_RCC_DIR_ELEMENT QT_UI_DIR_ELEMENT QT_DEFS_LIST_ELEMENT V53 - NB 6.7 New configuration types: 4 (QT_APPLICATION), 5 (QT_DYNAMIC_LIBRARY), 6 (QT_STATIC_LIBRARY) V52 - NB 6.7 ASSEMBLER_REQUIRED_ELEMENT V51 - NB 6.5 Now storing package type as name and not as int V50 - 09.10.08 - NB 6.5 Moved source encoding (SOURCE_ENCODING_ELEMENT) to project.xml V49 - 09.02.08 - NB 6.5 RPM package V48 - 08.08.22 - NB 6.5 PACK_TOPDIR_ELEMENT V47 - 08.01.08 - NB 6.5 Packaging persistance: ADDITIONAL_OPTIONS_ELEMENT VALUE_ATTR MANDATORY_ATTR TO_ATTR FROM_ATTR PERM_ATTR OWNER_ATTR GROUP_ATTR VERBOSE_ELEMENT PACK_ELEMENT PACK_TYPE_ELEMENT PACK_FILES_LIST_ELEMENT PACK_FILE_LIST_ELEMENT PACK_INFOS_LIST_ELEMENT PACK_INFO_LIST_ELEMENT V46 - 06.17.08 - NB 6.5 [Remote] Development Server V45 - 01.12-08 Encoding V44 - 3.08.08 - NB 6.1 ??? V43 - 3.06.08 - NB 6.1 Storing compiler flavor as name|flavor V42 - 2.26.08 - NB 6.1 Now storing required tools (c, cpp, ...) only if different from default vaue V41: Added SOURCE_ROOT_LIST_ELEMENT V40: Added PREPROCESSOR_LIST_ELEMENT and LIST_ELEMENT and saving preprocessor symbols as a list V39: Added Required Projects for unmanaged projects (REQUIRED_PROJECTS_ELEMENT) V38: Added Mac OS X platform == 4 and changed Generic platform to 5 V37: Moved active configuration (DEFAULT_CONF_ELEMENT) to private V36: ARCHITECTURE_ELEMENT added. V35: Gordon added COMPILER set changes? V34: Added C_REQUIRED_ELEMENT, CPP_REQUIRED_ELEMENT, and FORTRAN_REQUIRED_ELEMENT for build validation Changed COMPILER_SET_ELEMENT semantics from expecting an integer (0 or 1) to expecting a string (Sun, GNU, Cygwin, ...) V33: Added DEPENDENCY_CHECKING (makefile dependency checking) V32: Added Folder level configurations (FolderXMLCodc) V31: Now emitting compiler tool info for makefile based projects. This affects cCompilerTool, ccCompilerTool, and fortranCompilerTool elements. V30: added PROJECT_MAKEFILE_ELEMENT (project makefile name) V29: added FORTRANCOMPILERTOOL_ELEMENT
public abstract class CommonConfigurationXMLCodec
        extends XMLDecoder
        implements XMLEncoder {
    public final static int CURRENT_VERSION = 62;
    // Generic
    protected final static String PROJECT_DESCRIPTOR_ELEMENT = "projectDescriptor"// NOI18N
    protected final static String DEBUGGING_ELEMENT = "justfordebugging"// NOI18N
    // Old style. FIXUP: should be removed....
    protected final static String CONFIGURATION_DESCRIPTOR_ELEMENT = "configurationDescriptor"// NOI18N
    protected final static String DEFAULT_CONF_ELEMENT = "defaultConf"// NOI18N
    protected final static String CONFS_ELEMENT = "confs"// NOI18N
    protected final static String CONF_ELEMENT = "conf"// NOI18N
    protected final static String DIRECTORY_PATH_ELEMENT = "directoryPath"// NOI18N
    protected final static String PATH_ELEMENT = "pElem"// NOI18N
    protected final static String FOLDER_PATH_ELEMENT = "folderPath"// Old style. FIXUP : < version 5 // NOI18N
    protected final static String SOURCE_FOLDERS_ELEMENT = "sourceFolders"// Old style. FIXUP : < version 5 // NOI18N
    protected final static String LOGICAL_FOLDER_ELEMENT = "logicalFolder"// NOI18N
    protected final static String DISK_FOLDER_ELEMENT = "df"// NOI18N
    protected final static String ITEM_PATH_ELEMENT = "itemPath"// NOI18N
    protected final static String ITEM_NAME_ELEMENT = "in"// NOI18N
    protected final static String PROJECT_MAKEFILE_ELEMENT = "projectmakefile"// NOI18N
    protected final static String REQUIRED_PROJECTS_ELEMENT = "requiredProjects"// NOI18N
    protected final static String SOURCE_ROOT_LIST_ELEMENT = "sourceRootList"// NOI18N
    protected final static String SOURCE_FOLDERS_FILTER_ELEMENT = "sourceFolderFilter"// NOI18N
    protected final static String SOURCE_ENCODING_ELEMENT = "sourceEncoding"// NOI18N
    // Tools Set (Compiler set and platform)
    protected final static String TOOLS_SET_ELEMENT = "toolsSet"// NOI18N
    protected final static String DEVELOPMENT_SERVER_ELEMENT = "developmentServer"// NOI18N
    protected final static String COMPILER_SET_ELEMENT = "compilerSet"// NOI18N
    protected final static String C_REQUIRED_ELEMENT = "cRequired"// NOI18N
    protected final static String CPP_REQUIRED_ELEMENT = "cppRequired"// NOI18N
    protected final static String FORTRAN_REQUIRED_ELEMENT = "fortranRequired"// NOI18N
    protected final static String ASSEMBLER_REQUIRED_ELEMENT = "assemblerRequired"// NOI18N
    protected final static String PLATFORM_ELEMENT = "platform"// NOI18N
    protected final static String DEPENDENCY_CHECKING = "dependencyChecking"// NOI18N
    // Compile Type
    protected final static String NEO_CONF_ELEMENT = "neoConf"// Old style. FIXUP : should be removed.... // NOI18N
    protected final static String COMPILE_TYPE_ELEMENT = "compileType"// NOI18N
    // Makefile Type
    protected final static String EXT_CONF_ELEMENT = "extConf"// Old style. FIXUP : should be removed.... // NOI18N
    protected final static String MAKEFILE_TYPE_ELEMENT = "makefileType"// NOI18N
    protected final static String MAKETOOL_ELEMENT = "makeTool"// NOI18N
    protected final static String BUILD_COMMAND_ELEMENT = "buildCommand"// NOI18N
    protected final static String BUILD_COMMAND_WORKING_DIR_ELEMENT = "buildCommandWorkingDir"// NOI18N
    protected final static String CLEAN_COMMAND_ELEMENT = "cleanCommand"// NOI18N
    protected final static String EXECUTABLE_PATH_ELEMENT = "executablePath"// NOI18N
    // Common
    protected final static String COMMANDLINE_TOOL_ELEMENT = "commandlineTool"// NOI18N
    protected final static String ADDITIONAL_DEP_ELEMENT = "additionalDep"// NOI18N
    protected final static String ADDITIONAL_OPTIONS_ELEMENT = "additionalOptions"// NOI18N
    protected final static String OUTPUT_ELEMENT = "output"// NOI18N
    protected final static String INHERIT_INC_VALUES_ELEMENT = "inheritIncValues"// NOI18N
    protected final static String INHERIT_PRE_VALUES_ELEMENT = "inheritPreValues"// NOI18N
    // Compiler (Generic) Tool
    protected final static String INCLUDE_DIRECTORIES_ELEMENT = "includeDirectories"// NOI18N
    protected final static String INCLUDE_DIRECTORIES_ELEMENT2 = "incDir"// NOI18N
    protected final static String COMPILERTOOL_ELEMENT = "compilerTool"// OLD style. FIXUP < version 11 // NOI18N
    protected final static String DEBUGGING_SYMBOLS_ELEMENT = "debuggingSymbols"// NOI18N
    protected final static String OPTIMIZATION_LEVEL_ELEMENT = "optimizationLevel"// NOI18N
    protected final static String DEVELOPMENT_MODE_ELEMENT = "developmentMode"// NOI18N
    protected final static String COMMAND_LINE_ELEMENT = "commandLine"// NOI18N
    protected final static String STRIP_SYMBOLS_ELEMENT = "stripSymbols"// NOI18N
    protected final static String SIXTYFOUR_BITS_ELEMENT = "sixtyfourBits"// NOI18N
    protected final static String ARCHITECTURE_ELEMENT = "architecture"// NOI18N
    protected final static String PREPROCESSOR_ELEMENT = "preprocessor"// NOI18N
    protected final static String PREPROCESSOR_LIST_ELEMENT = "preprocessorList"// NOI18N
    protected final static String SUPRESS_WARNINGS_ELEMENT = "supressWarnings"// NOI18N
    protected final static String WARNING_LEVEL_ELEMENT = "warningLevel"// NOI18N
    protected final static String MT_LEVEL_ELEMENT = "mtLevel"// NOI18N
    protected final static String STANDARDS_EVOLUTION_ELEMENT = "standardsEvolution"// NOI18N
    protected final static String LANGUAGE_EXTENSION_ELEMENT = "languageExtension"// NOI18N
    // C Compiler Tool
    protected final static String SUN_CCOMPILERTOOL_OLD_ELEMENT = "sunCCompilerTool"// FIXUP <=23 // NOI18N
    protected final static String CCOMPILERTOOL_ELEMENT = "cCompilerTool"// NOI18N
    protected final static String CCOMPILERTOOL_ELEMENT2 = "cTool"// NOI18N
    protected final static String CONFORMANCE_LEVEL_ELEMENT = "conformanceLevel"// FIXUP: <=21 // NOI18N
    protected final static String CPP_STYLE_COMMENTS_ELEMENT = "cppstylecomments"// FIXUP: <=21 // NOI18N
    // CC Compiler Tool
    protected final static String SUN_CCCOMPILERTOOL_OLD_ELEMENT = "sunCCCompilerTool"// FIXUP <=23 // NOI18N
    protected final static String CCCOMPILERTOOL_ELEMENT = "ccCompilerTool"// NOI18N
    protected final static String CCCOMPILERTOOL_ELEMENT2 = "ccTool"// NOI18N
    protected final static String COMPATIBILITY_MODE_ELEMENT = "compatibilityMode"// FIXUP: <=21 // NOI18N
    protected final static String LIBRARY_LEVEL_ELEMENT = "libraryLevel"// NOI18N
    // Fortran Compiler Tool
    protected final static String FORTRANCOMPILERTOOL_ELEMENT = "fortranCompilerTool"// NOI18N
    // Custom Tool
    protected final static String CUSTOMTOOL_ELEMENT = "customTool"// NOI18N
    protected final static String CUSTOMTOOL_COMMANDLINE_ELEMENT = "customToolCommandline"// NOI18N
    protected final static String CUSTOMTOOL_DESCRIPTION_ELEMENT = "customToolDescription"// NOI18N
    protected final static String CUSTOMTOOL_OUTPUTS_ELEMENT = "customToolOutputs"// NOI18N
    protected final static String CUSTOMTOOL_ADDITIONAL_DEP_ELEMENT = "customToolAdditionalDep"// NOI18N
    // Linker Tool
    protected final static String LINKERTOOL_ELEMENT = "linkerTool"// NOI18N
    protected final static String LINKER_KPIC_ELEMENT = "linkerKpic"// NOI18N
    protected final static String LINKER_NORUNPATH_ELEMENT = "linkerNorunpath"// NOI18N
    protected final static String LINKER_ASSIGN_ELEMENT = "linkerAssign"// NOI18N
    protected final static String LINKER_ADD_LIB_ELEMENT = "linkerAddLib"// NOI18N
    protected final static String LINKER_DYN_SERCH_ELEMENT = "linkerDynSerch"// NOI18N
    protected final static String LINKER_LIB_ELEMENT = "linkerLib"// NOI18N
    protected final static String LINKER_LIB_ITEMS_ELEMENT = "linkerLibItems"// NOI18N
    protected final static String LINKER_LIB_PROJECT_ITEM_ELEMENT = "linkerLibProjectItem"// NOI18N
    protected final static String LINKER_LIB_STDLIB_ITEM_ELEMENT = "linkerLibStdlibItem"// NOI18N
    protected final static String LINKER_LIB_LIB_ITEM_ELEMENT = "linkerLibLibItem"// NOI18N
    protected final static String LINKER_LIB_FILE_ITEM_ELEMENT = "linkerLibFileItem"// NOI18N
    protected final static String LINKER_LIB_OPTION_ITEM_ELEMENT = "linkerOptionItem"// NOI18N
    // Make Artifact
    protected final static String MAKE_ARTIFACT_ELEMENT = "makeArtifact"// NOI18N
    protected final static String MAKE_ARTIFACT_PL_ELEMENT = "PL"// NOI18N
    protected final static String MAKE_ARTIFACT_CT_ELEMENT = "CT"// NOI18N
    protected final static String MAKE_ARTIFACT_CN_ELEMENT = "CN"// NOI18N
    protected final static String MAKE_ARTIFACT_AC_ELEMENT = "AC"// NOI18N
    protected final static String MAKE_ARTIFACT_BL_ELEMENT = "BL"// NOI18N
    protected final static String MAKE_ARTIFACT_WD_ELEMENT = "WD"// NOI18N
    protected final static String MAKE_ARTIFACT_BC_ELEMENT = "BC"// NOI18N
    protected final static String MAKE_ARTIFACT_CC_ELEMENT = "CC"// NOI18N
    protected final static String MAKE_ARTIFACT_OP_ELEMENT = "OP"// NOI18N
    // Archiver Tool
    protected final static String ARCHIVERTOOL_ELEMENT = "archiverTool"// NOI18N
    protected final static String ARCHIVERTOOL_RUN_RANLIB_ELEMENT = "runRanlib"// NOI18N
    protected final static String ARCHIVERTOOL_VERBOSE_ELEMENT = "archiverVerbose"// NOI18N
    protected final static String ARCHIVERTOOL_SUPRESS_ELEMENT = "archiverSupress"// NOI18N
    protected final static String VERSION_ATTR = "version"// NOI18N
    protected final static String TYPE_ATTR = "type"// NOI18N
    protected final static String NAME_ATTR = "name"// NOI18N
    protected final static String ROOT_ATTR = "root"// NOI18N
    protected final static String SET_ATTR = "set"// NOI18N
    protected final static String DISPLAY_NAME_ATTR = "displayName"// NOI18N
    protected final static String PROJECT_FILES_ATTR = "projectFiles"// NOI18N
    protected final static String VALUE_ATTR = "value"// NOI18N
    protected final static String MANDATORY_ATTR = "mandatory"// NOI18N
    protected final static String TO_ATTR = "to"// NOI18N
    protected final static String FROM_ATTR = "from"// NOI18N
    protected final static String PERM_ATTR = "perm"// NOI18N
    protected final static String OWNER_ATTR = "owner"// NOI18N
    protected final static String GROUP_ATTR = "group"// NOI18N
    protected final static String TRUE_VALUE = "true"// NOI18N
    protected final static String FALSE_VALUE = "false"// NOI18N
    protected final static String LIST_ELEMENT = "Elem"// NOI18N
    protected final static String VERBOSE_ELEMENT = "verbose"// NOI18N
    protected final static String PACK_ELEMENT = "packaging"// NOI18N
    protected final static String PACK_TYPE_ELEMENT = "packType"// NOI18N
    protected final static String PACK_FILES_LIST_ELEMENT = "packFileList"// NOI18N
    protected final static String PACK_FILE_LIST_ELEMENT = "packFileListElem"// NOI18N
    protected final static String PACK_INFOS_LIST_ELEMENT = "packInfoList"// NOI18NP
    protected final static String PACK_INFO_LIST_ELEMENT = "packInfoListElem"// NOI18NP
    protected final static String PACK_ADDITIONAL_INFOS_LIST_ELEMENT = "packAddInfosListElem"// NOI18NP
    protected final static String PACK_TOPDIR_ELEMENT = "packTopDir"// NOI18N
    // Qt-related
    protected final static String QT_ELEMENT = "qt"// NOI18N
    protected final static String QT_DESTDIR_ELEMENT = "destdir"// NOI18N
    protected final static String QT_TARGET_ELEMENT = "target"// NOI18N
    protected final static String QT_VERSION_ELEMENT = "version"// NOI18N
    protected final static String QT_BUILD_MODE_ELEMENT = "buildMode"// NOI18N
    protected final static String QT_MODULES_ELEMENT = "modules"// NOI18N
    protected final static String QT_MOC_DIR_ELEMENT = "mocDir"// NOI18N
    protected final static String QT_RCC_DIR_ELEMENT = "rccDir"// NOI18N
    protected final static String QT_UI_DIR_ELEMENT = "uiDir"// NOI18N
    protected final static String QT_DEFS_LIST_ELEMENT = "defs"// NOI18N
    protected final static String QT_QMAKE_SPEC_ELEMENT = "qmakeSpec"// NOI18N
    private boolean publicLocation;
    protected CommonConfigurationXMLCodec(ConfigurationDescriptor projectDescriptor,
            boolean publicLocation) {
        this. = projectDescriptor;
        this. = publicLocation;
    }
    // interface XMLEncoder
    public void encode(XMLEncoderStream xes) {
        if () {
            writeLogicalFolders(xes);
            writeSourceRoots(xes);
        //writeSourceEncoding(xes);
        }
        if (!) {
            xes.element("" + .getConfs().getActiveAsIndex()); // NOI18N
        }
        writeConfsBlock(xes);
    }
    private void writeConfsBlock(XMLEncoderStream xes) {
        xes.elementOpen();
        Configurations confs = .getConfs();
        for (int i = 0; i < confs.size(); i++) {
            MakeConfiguration makeConfiguration =
                    (MakeConfigurationconfs.getConf(i);
            xes.elementOpen(,
                    new AttrValuePair[]{
                        new AttrValuePair("" + makeConfiguration.getName()), // NOI18N
                        new AttrValuePair("" + makeConfiguration.getConfigurationType().getValue()), // NOI18N
                    });
            if () {
                writeToolsSetBlock(xesmakeConfiguration);
                if (makeConfiguration.isQmakeConfiguration()) {
                    writeQmakeConfiguration(xesmakeConfiguration.getQmakeConfiguration());
                }
                if (makeConfiguration.isMakefileConfiguration()) {
                    writeMakefileProjectConfBlock(xesmakeConfiguration);
                } else {
                    writeCompiledProjectConfBlock(xesmakeConfiguration);
                }
                writePackaging(xesmakeConfiguration.getPackagingConfiguration());
                ConfigurationAuxObject[] profileAuxObjects = confs.getConf(i).getAuxObjects();
                for (int j = 0; j < profileAuxObjects.lengthj++) {
                    ConfigurationAuxObject auxObject = profileAuxObjects[j];
                    if (auxObject.shared()) {
                        XMLEncoder encoder = auxObject.getXMLEncoder();
                        encoder.encode(xes);
                    }
                }
            } else {
                ConfigurationAuxObject[] profileAuxObjects = confs.getConf(i).getAuxObjects();
                for (int j = 0; j < profileAuxObjects.lengthj++) {
                    ConfigurationAuxObject auxObject = profileAuxObjects[j];
                    if (!auxObject.shared()) {
                        XMLEncoder encoder = auxObject.getXMLEncoder();
                        encoder.encode(xes);
                    }
                }
            }
            xes.elementClose();
        }
        xes.elementClose();
    }
    private void writeToolsSetBlock(XMLEncoderStream xesMakeConfiguration makeConfiguration) {
        xes.elementOpen();
        xes.element(makeConfiguration.getDevelopmentHost().getHostKey());
        xes.element("" + makeConfiguration.getCompilerSet().getNameAndFlavor());
        if (makeConfiguration.getCRequired().getValue() != makeConfiguration.getCRequired().getDefault()) {
            xes.element("" + makeConfiguration.getCRequired().getValue());
        }
        if (makeConfiguration.getCppRequired().getValue() != makeConfiguration.getCppRequired().getDefault()) {
            xes.element("" + makeConfiguration.getCppRequired().getValue());
        }
        if (makeConfiguration.getFortranRequired().getValue() != makeConfiguration.getFortranRequired().getDefault()) {
            xes.element("" + makeConfiguration.getFortranRequired().getValue());
        }
        if (makeConfiguration.getAssemblerRequired().getValue() != makeConfiguration.getAssemblerRequired().getDefault()) {
            xes.element("" + makeConfiguration.getAssemblerRequired().getValue());
        }
        xes.element("" + makeConfiguration.getDevelopmentHost().getBuildPlatform()); // NOI18N
        if (makeConfiguration.getDependencyChecking().getModified()) {
            xes.element("" + makeConfiguration.getDependencyChecking().getValue()); // NOI18N
        }
        xes.elementClose();
    }
    private void writeCompiledProjectConfBlock(XMLEncoderStream xesMakeConfiguration makeConfiguration) {
        xes.elementOpen();
        writeCCompilerConfiguration(xesmakeConfiguration.getCCompilerConfiguration());
        writeCCCompilerConfiguration(xesmakeConfiguration.getCCCompilerConfiguration());
        writeFortranCompilerConfiguration(xesmakeConfiguration.getFortranCompilerConfiguration());
        switch (makeConfiguration.getConfigurationType().getValue()) {
            case .:
            case .:
            case .:
            case .:
                writeLinkerConfiguration(xesmakeConfiguration.getLinkerConfiguration());
                break;
            case .:
            case .:
                writeArchiverConfiguration(xesmakeConfiguration.getArchiverConfiguration());
                break;
        }
        writeRequiredProjects(xesmakeConfiguration.getRequiredProjectsConfiguration());
    }
    private void writeQmakeConfiguration(XMLEncoderStream xesQmakeConfiguration qmake) {
        xes.elementOpen();
        if (qmake.getDestdir().getModified()) {
            xes.element(qmake.getDestdirValue());
        }
        if (qmake.getTarget().getModified()) {
            xes.element(qmake.getTargetValue());
        }
        if (qmake.getVersion().getModified()) {
            xes.element(qmake.getVersion().getValue());
        }
        if (qmake.getBuildMode().getModified()) {
            xes.element(, String.valueOf(qmake.getBuildMode().getValue()));
        }
        xes.element(qmake.getEnabledModules());
        if (qmake.getMocDir().getModified()) {
            xes.element(qmake.getMocDir().getValue());
        }
        if (qmake.getRccDir().getModified()) {
            xes.element(qmake.getRccDir().getValue());
        }
        if (qmake.getUiDir().getModified()) {
            xes.element(qmake.getUiDir().getValue());
        }
        if (qmake.getQmakeSpec().getModified()) {
            xes.element(qmake.getQmakeSpec().getValue());
        }
        if (qmake.getCustomDefs().getModified()) {
            xes.elementOpen();
            for (String line : qmake.getCustomDefs().getValue()) {
                xes.element(line);
            }
            xes.elementClose();
        }
        xes.elementClose();
    }
            MakeConfiguration makeConfiguration) {
        xes.elementOpen();
        xes.element(makeConfiguration.getMakefileConfiguration().getBuildCommand().getValue());
        xes.element(makeConfiguration.getMakefileConfiguration().getCleanCommand().getValue());
        xes.element(makeConfiguration.getMakefileConfiguration().getOutput().getValue());
        writeCCompilerConfiguration(xesmakeConfiguration.getCCompilerConfiguration());
        writeCCCompilerConfiguration(xesmakeConfiguration.getCCCompilerConfiguration());
        writeFortranCompilerConfiguration(xesmakeConfiguration.getFortranCompilerConfiguration());
        //IZ#110443:Adding "Dependencies" node for makefile projects property is premature
        //if (makeConfiguration.getLinkerConfiguration() != null)
        //    writeLinkerConfiguration(xes, makeConfiguration.getLinkerConfiguration());
        xes.elementClose();
        writeRequiredProjects(xesmakeConfiguration.getRequiredProjectsConfiguration());
    }
    private void writeLogicalFolders(XMLEncoderStream xes) {
    }
    private void writeLogicalFolder(XMLEncoderStream xesFolder folder) {
                new AttrValuePair[]{
                    new AttrValuePair("" + folder.getName()), // NOI18N
                    new AttrValuePair("" + folder.getDisplayName()), // NOI18N
                    new AttrValuePair("" + folder.isProjectFiles()), // NOI18N
                });
        // write out subfolders
        Folder[] subfolders = folder.getFoldersAsArray();
        for (int i = 0; i < subfolders.lengthi++) {
            if (subfolders[i].isDiskFolder()) {
                writeDiskFolder(xessubfolders[i]);
            } else {
                writeLogicalFolder(xessubfolders[i]);
            }
        }
        // write out items
        Item[] items = folder.getItemsAsArray();
        for (int i = 0; i < items.lengthi++) {
            xes.element(items[i].getPath());
        }
    }
    private void writeDiskFolder(XMLEncoderStream xesFolder folder) {
        if (folder.getRoot() != null) {
            xes.elementOpen(,
                    new AttrValuePair[]{
                        new AttrValuePair("" + folder.getName()), // NOI18N
                        new AttrValuePair("" + folder.getRoot()), // NOI18N
                    });
        } else {
            xes.elementOpen(,
                    new AttrValuePair[]{
                        new AttrValuePair("" + folder.getName()), // NOI18N
                    });
        }
        // write out subfolders
        Folder[] subfolders = folder.getFoldersAsArray();
        for (int i = 0; i < subfolders.lengthi++) {
            writeDiskFolder(xessubfolders[i]);
        }
        // write out items
        Item[] items = folder.getItemsAsArray();
        for (int i = 0; i < items.lengthi++) {
            xes.element(items[i].getName());
        }
        xes.elementClose();
    }
    private void writeSourceRoots(XMLEncoderStream xes) {
        List<Stringlist = makeProjectDescriptor.getSourceRoots();
        if (list.size() > 0) {
            // Filter
                xes.element(makeProjectDescriptor.getFolderVisibilityQuery().getRegEx());
            }
            // Source Root
            xes.elementOpen();
            for (String l : list) {
                xes.element(l);
            }
            xes.elementClose();
        }
    }
//    private void writeSourceEncoding(XMLEncoderStream xes) {
//        xes.element(SOURCE_ENCODING_ELEMENT, ((MakeConfigurationDescriptor)projectDescriptor).getSourceEncoding());
//    }
    public static void writeCCompilerConfiguration(XMLEncoderStream xesCCompilerConfiguration cCompilerConfiguration) {
        if (!cCompilerConfiguration.getModified()) {
            return;
        }
        if (cCompilerConfiguration.getDevelopmentMode().getModified()) {
            xes.element("" + cCompilerConfiguration.getDevelopmentMode().getValue()); // NOI18N
        }
        if (cCompilerConfiguration.getStrip().getModified()) {
            xes.element("" + cCompilerConfiguration.getStrip().getValue()); // NOI18N
        }
        if (cCompilerConfiguration.getSixtyfourBits().getModified()) {
            xes.element("" + cCompilerConfiguration.getSixtyfourBits().getValue()); // NOI18N
        }
        if (cCompilerConfiguration.getTool().getModified()) {
            xes.element("" + cCompilerConfiguration.getTool().getValue()); // NOI18N
        }
        if (cCompilerConfiguration.getIncludeDirectories().getModified()) {
            writeDirectories(xescCompilerConfiguration.getIncludeDirectories().getValue());
        }
        if (cCompilerConfiguration.getStandardsEvolution().getModified()) {
            xes.element("" + cCompilerConfiguration.getStandardsEvolution().getValue()); // NOI18N
        }
        if (cCompilerConfiguration.getLanguageExt().getModified()) {
            xes.element("" + cCompilerConfiguration.getLanguageExt().getValue()); // NOI18N
        }
        if (cCompilerConfiguration.getInheritIncludes().getModified()) {
            xes.element("" + cCompilerConfiguration.getInheritIncludes().getValue()); // NOI18N
        }
        if (cCompilerConfiguration.getCommandLineConfiguration().getModified()) {
            xes.element("" + cCompilerConfiguration.getCommandLineConfiguration().getValue()); // NOI18N
        }
        if (cCompilerConfiguration.getPreprocessorConfiguration().getModified()) {
            writeList(xescCompilerConfiguration.getPreprocessorConfiguration().getValue());
        }
        if (cCompilerConfiguration.getInheritPreprocessor().getModified()) {
            xes.element("" + cCompilerConfiguration.getInheritPreprocessor().getValue()); // NOI18N
        }
        if (cCompilerConfiguration.getWarningLevel().getModified()) {
            xes.element("" + cCompilerConfiguration.getWarningLevel().getValue()); // NOI18N
        }
        if (cCompilerConfiguration.getMTLevel().getModified()) {
            xes.element("" + cCompilerConfiguration.getMTLevel().getValue()); // NOI18N
        }
        if (cCompilerConfiguration.getAdditionalDependencies().getModified()) {
            xes.element("" + cCompilerConfiguration.getAdditionalDependencies().getValue()); // NOI18N
        }
    }
    public static void writeCCCompilerConfiguration(XMLEncoderStream xesCCCompilerConfiguration ccCompilerConfiguration) {
        if (!ccCompilerConfiguration.getModified()) {
            return;
        }
        if (ccCompilerConfiguration.getDevelopmentMode().getModified()) {
            xes.element("" + ccCompilerConfiguration.getDevelopmentMode().getValue()); // NOI18N
        }
        if (ccCompilerConfiguration.getStrip().getModified()) {
            xes.element("" + ccCompilerConfiguration.getStrip().getValue()); // NOI18N
        }
        if (ccCompilerConfiguration.getSixtyfourBits().getModified()) {
            xes.element("" + ccCompilerConfiguration.getSixtyfourBits().getValue()); // NOI18N
        }
        if (ccCompilerConfiguration.getTool().getModified()) {
            xes.element("" + ccCompilerConfiguration.getTool().getValue()); // NOI18N
        }
        if (ccCompilerConfiguration.getIncludeDirectories().getModified()) {
            writeDirectories(xesccCompilerConfiguration.getIncludeDirectories().getValue()); // NOI18N
        }
        if (ccCompilerConfiguration.getStandardsEvolution().getModified()) {
            xes.element("" + ccCompilerConfiguration.getStandardsEvolution().getValue()); // NOI18N
        }
        if (ccCompilerConfiguration.getLanguageExt().getModified()) {
            xes.element("" + ccCompilerConfiguration.getLanguageExt().getValue()); // NOI18N
        }
        if (ccCompilerConfiguration.getInheritIncludes().getModified()) {
            xes.element("" + ccCompilerConfiguration.getInheritIncludes().getValue()); // NOI18N
        }
        if (ccCompilerConfiguration.getCommandLineConfiguration().getModified()) {
            xes.element("" + ccCompilerConfiguration.getCommandLineConfiguration().getValue()); // NOI18N
        }
        if (ccCompilerConfiguration.getPreprocessorConfiguration().getModified()) {
            writeList(xesccCompilerConfiguration.getPreprocessorConfiguration().getValue());
        }
        if (ccCompilerConfiguration.getInheritPreprocessor().getModified()) {
            xes.element("" + ccCompilerConfiguration.getInheritPreprocessor().getValue()); // NOI18N
        }
        if (ccCompilerConfiguration.getWarningLevel().getModified()) {
            xes.element("" + ccCompilerConfiguration.getWarningLevel().getValue()); // NOI18N
        }
        if (ccCompilerConfiguration.getMTLevel().getModified()) {
            xes.element("" + ccCompilerConfiguration.getMTLevel().getValue()); // NOI18N
        }
        if (ccCompilerConfiguration.getLibraryLevel().getModified()) {
            xes.element("" + ccCompilerConfiguration.getLibraryLevel().getValue()); // NOI18N
        }
        if (ccCompilerConfiguration.getAdditionalDependencies().getModified()) {
            xes.element("" + ccCompilerConfiguration.getAdditionalDependencies().getValue()); // NOI18N
        }
    }
    public static void writeFortranCompilerConfiguration(XMLEncoderStream xesFortranCompilerConfiguration fortranCompilerConfiguration) {
        if (!fortranCompilerConfiguration.getModified()) {
            return;
        }
        if (fortranCompilerConfiguration.getDevelopmentMode().getModified()) {
            xes.element("" + fortranCompilerConfiguration.getDevelopmentMode().getValue()); // NOI18N
        }
        if (fortranCompilerConfiguration.getStrip().getModified()) {
            xes.element("" + fortranCompilerConfiguration.getStrip().getValue()); // NOI18N
        }
        if (fortranCompilerConfiguration.getSixtyfourBits().getModified()) {
            xes.element("" + fortranCompilerConfiguration.getSixtyfourBits().getValue()); // NOI18N
        }
        if (fortranCompilerConfiguration.getTool().getModified()) {
            xes.element("" + fortranCompilerConfiguration.getTool().getValue()); // NOI18N
        }
        if (fortranCompilerConfiguration.getCommandLineConfiguration().getModified()) {
            xes.element("" + fortranCompilerConfiguration.getCommandLineConfiguration().getValue()); // NOI18N
        }
        if (fortranCompilerConfiguration.getWarningLevel().getModified()) {
            xes.element("" + fortranCompilerConfiguration.getWarningLevel().getValue()); // NOI18N
        }
        if (fortranCompilerConfiguration.getAdditionalDependencies().getModified()) {
            xes.element("" + fortranCompilerConfiguration.getAdditionalDependencies().getValue()); // NOI18N
        }
    }
    public static void writeCustomToolConfiguration(XMLEncoderStream xesCustomToolConfiguration customToolConfiguration) {
        if (!customToolConfiguration.getModified()) {
            return;
        }
        xes.elementOpen();
        if (customToolConfiguration.getCommandLine().getModified()) {
            xes.element("" + customToolConfiguration.getCommandLine().getValue()); // NOI18N
        }
        if (customToolConfiguration.getDescription().getModified()) {
            xes.element("" + customToolConfiguration.getDescription().getValue()); // NOI18N
        }
        if (customToolConfiguration.getOutputs().getModified()) {
            xes.element("" + customToolConfiguration.getOutputs().getValue()); // NOI18N
        }
        if (customToolConfiguration.getAdditionalDependencies().getModified()) {
            xes.element("" + customToolConfiguration.getAdditionalDependencies().getValue()); // NOI18N
        }
        xes.elementClose();
    }
    public static void writeLinkerConfiguration(XMLEncoderStream xesLinkerConfiguration linkerConfiguration) {
        xes.elementOpen();
        if (linkerConfiguration.getOutput().getModified()) {
            xes.element(linkerConfiguration.getOutput().getValue());
        }
        if (linkerConfiguration.getAdditionalLibs().getModified()) {
            writeDirectories(xeslinkerConfiguration.getAdditionalLibs().getValue());
        }
        if (linkerConfiguration.getDynamicSearch().getModified()) {
            writeDirectories(xeslinkerConfiguration.getDynamicSearch().getValue());
        }
        if (linkerConfiguration.getStripOption().getModified()) {
            xes.element("" + linkerConfiguration.getStripOption().getValue()); // NOI18N
        }
        if (linkerConfiguration.getPICOption().getModified()) {
            xes.element("" + linkerConfiguration.getPICOption().getValue()); // NOI18N
        }
        if (linkerConfiguration.getNorunpathOption().getModified()) {
            xes.element("" + linkerConfiguration.getNorunpathOption().getValue()); // NOI18N
        }
        if (linkerConfiguration.getNameassignOption().getModified()) {
            xes.element("" + linkerConfiguration.getNameassignOption().getValue()); // NOI18N
        }
        if (linkerConfiguration.getAdditionalDependencies().getModified()) {
            xes.element("" + linkerConfiguration.getAdditionalDependencies().getValue()); // NOI18N
        }
        if (linkerConfiguration.getTool().getModified()) {
            xes.element(linkerConfiguration.getTool().getValue());
        }
        writeLibrariesConfiguration(xeslinkerConfiguration.getLibrariesConfiguration());
        if (linkerConfiguration.getCommandLineConfiguration().getModified()) {
            xes.element("" + linkerConfiguration.getCommandLineConfiguration().getValue()); // NOI18N
        }	//xes.element(DEBUGGING_ELEMENT, "" + linkerConfiguration.getTool().getValue() + " " + linkerConfiguration.getOptions()); // NOI18N
        xes.elementClose();
    }
    public static void writeLibrariesConfiguration(XMLEncoderStream xesLibrariesConfiguration librariesConfiguration) {
        List<LibraryItemlibraryItems = librariesConfiguration.getValue();
        for (LibraryItem item : libraryItems) {
            if (item instanceof LibraryItem.ProjectItem) {
                xes.elementOpen();
                writeMakeArtifact(xes, ((LibraryItem.ProjectItemitem).getMakeArtifact());
                xes.elementClose();
            } else if (item instanceof LibraryItem.StdLibItem) {
                xes.element(, ((LibraryItem.StdLibItemitem).getName());
            } else if (item instanceof LibraryItem.LibItem) {
                xes.element(, ((LibraryItem.LibItemitem).getLibName());
            } else if (item instanceof LibraryItem.LibFileItem) {
                xes.element(, ((LibraryItem.LibFileItemitem).getPath());
            } else if (item instanceof LibraryItem.OptionItem) {
                xes.element(, ((LibraryItem.OptionItemitem).getLibraryOption());
            }
        }
    }
    public static void writeRequiredProjects(XMLEncoderStream xesRequiredProjectsConfiguration requiredProjectsConfiguration) {
        List<LibraryItem.ProjectItemprojectItems = requiredProjectsConfiguration.getValue();
        if (!projectItems.isEmpty()) {
            xes.elementOpen();
            for (LibraryItem.ProjectItem item : projectItems) {
                writeMakeArtifact(xesitem.getMakeArtifact());
            }
            xes.elementClose();
        }
    }
    private static void writePackaging(XMLEncoderStream xesPackagingConfiguration packagingConfiguration) {
        if (!packagingConfiguration.isModified()) {
            return;
        }
        xes.elementOpen();
        xes.element("" + packagingConfiguration.getName()); // NOI18N
        if (packagingConfiguration.getVerbose().getModified()) {
            xes.element("" + packagingConfiguration.getVerbose().getValue()); // NOI18N
        }
        if (packagingConfiguration.getOutput().getModified()) {
            xes.element(packagingConfiguration.getOutput().getValue());
        }
        if (packagingConfiguration.getTool().getModified()) {
            xes.element(packagingConfiguration.getTool().getValue());
        }
        if (packagingConfiguration.getOptions().getModified()) {
            xes.element(packagingConfiguration.getOptions().getValue());
        }
        if (packagingConfiguration.getTopDir().getModified()) {
            xes.element(packagingConfiguration.getTopDir().getValue());
        }
        List<PackagerFileElementfilesList = packagingConfiguration.getFiles().getValue();
        for (PackagerFileElement elem : filesList) {
            xes.element(,
                    new AttrValuePair[]{
                        new AttrValuePair("" + elem.getType().toString()), // NOI18N
                        new AttrValuePair("" + elem.getTo()), // NOI18N
                        new AttrValuePair("" + elem.getFrom()), // NOI18N
                        new AttrValuePair("" + elem.getPermission()), // NOI18N
                        new AttrValuePair("" + elem.getOwner()), // NOI18N
                        new AttrValuePair("" + elem.getGroup()), // NOI18N
                    });
        }
        PackagerDescriptor packager = PackagerManager.getDefault().getPackager(packagingConfiguration.getType().getValue());
        if (packager.hasInfoList()) {
            xes.elementOpen();
            List<PackagerInfoElementinfoList = packagingConfiguration.getHeaderSubList(packagingConfiguration.getType().getValue());
            for (PackagerInfoElement elem : infoList) {
                xes.element(,
                        new AttrValuePair[]{
                            new AttrValuePair("" + elem.getName()), // NOI18N
                            new AttrValuePair("" + elem.getValue()), // NOI18N
                            new AttrValuePair("" + elem.isMandatory()), // NOI18N
                        });
            }
            xes.elementClose();
            if (!packagingConfiguration.getAdditionalInfo().getValue().isEmpty()) {
                writeList(xespackagingConfiguration.getAdditionalInfo().getValue());
            }
        }
        xes.elementClose();
    }
    public static void writeMakeArtifact(XMLEncoderStream xesMakeArtifact makeArtifact) {
                new AttrValuePair[]{
                    new AttrValuePair(makeArtifact.getProjectLocation()),
                    new AttrValuePair("" + makeArtifact.getConfigurationType()), // NOI18N
                    new AttrValuePair(makeArtifact.getConfigurationName()),
                    new AttrValuePair("" + makeArtifact.getActive()), // NOI18N
                    new AttrValuePair("" + makeArtifact.getBuild()), // NOI18N
                    new AttrValuePair(makeArtifact.getWorkingDirectory()),
                    new AttrValuePair(makeArtifact.getBuildCommand()),
                    new AttrValuePair(makeArtifact.getCleanCommand()),
                    new AttrValuePair(