// Path: src/main/java/org/mybatis/generator/api/dom/OutputUtilities.java
// public static Set<String> calculateImports(
//         Set<FullyQualifiedJavaType> importedTypes) {
//     StringBuilder sb = new StringBuilder();
//     Set<String> importStrings = new TreeSet<String>();
//     for (FullyQualifiedJavaType fqjt : importedTypes) {
//         for (String importString : fqjt.getImportList()) {
//             sb.setLength(0);
//             sb.append("import "); //$NON-NLS-1$
//             sb.append(importString);
//             sb.append(';');
//             importStrings.add(sb.toString());
//         }
//     }
// 
//     return importStrings;
// }
// 
// Path: src/main/java/org/mybatis/generator/api/dom/OutputUtilities.java
// public static void newLine(StringBuilder sb) {
//     sb.append(lineSeparator);
// }


import static org.mybatis.generator.api.dom.OutputUtilities.calculateImports;
import static org.mybatis.generator.api.dom.OutputUtilities.newLine;
import static org.mybatis.generator.internal.util.messages.Messages.getString;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;
/*
 *  Copyright 2006 The Apache Software Foundation
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package org.mybatis.generator.api.dom.java;



/**
 * @author Jeff Butler
 * 
 */
public class TopLevelEnumeration extends InnerEnum implements CompilationUnit {
    private Set<FullyQualifiedJavaType> importedTypes;

    private Set<String> staticImports;

    private List<String> fileCommentLines;

    /**
     * @param type
     */
    public TopLevelEnumeration(FullyQualifiedJavaType type) {
        super(type);
        importedTypes = new TreeSet<FullyQualifiedJavaType>();
        fileCommentLines = new ArrayList<String>();
        staticImports = new TreeSet<String>();
    }

    public String getFormattedContent() {
        StringBuilder sb = new StringBuilder();

        for (String fileCommentLine : fileCommentLines) {
            sb.append(fileCommentLine);
            newLine(sb);
        }

        if (getType().getPackageName() != null
                && getType().getPackageName().length() > 0) {
// Path: src/main/java/org/mybatis/generator/api/dom/OutputUtilities.java
// public static Set<String> calculateImports(
//         Set<FullyQualifiedJavaType> importedTypes) {
//     StringBuilder sb = new StringBuilder();
//     Set<String> importStrings = new TreeSet<String>();
//     for (FullyQualifiedJavaType fqjt : importedTypes) {
//         for (String importString : fqjt.getImportList()) {
//             sb.setLength(0);
//             sb.append("import "); //$NON-NLS-1$
//             sb.append(importString);
//             sb.append(';');
//             importStrings.add(sb.toString());
//         }
//     }
// 
//     return importStrings;
// }
// 
// Path: src/main/java/org/mybatis/generator/api/dom/OutputUtilities.java
// public static void newLine(StringBuilder sb) {
//     sb.append(lineSeparator);
// }


// Path: src/main/java/org/mybatis/generator/api/dom/java/TopLevelEnumeration.java
import static org.mybatis.generator.api.dom.OutputUtilities.calculateImports;
import static org.mybatis.generator.api.dom.OutputUtilities.newLine;
import static org.mybatis.generator.internal.util.messages.Messages.getString;
import java.util.ArrayList;
import java.util.Collections;
import java.util.List;
import java.util.Set;
import java.util.TreeSet;

/*
 *  Copyright 2006 The Apache Software Foundation
 *
 *  Licensed under the Apache License, Version 2.0 (the "License");
 *  you may not use this file except in compliance with the License.
 *  You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 *  Unless required by applicable law or agreed to in writing, software
 *  distributed under the License is distributed on an "AS IS" BASIS,
 *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 *  See the License for the specific language governing permissions and
 *  limitations under the License.
 */

package org.mybatis.generator.api.dom.java;



/**
 * @author Jeff Butler
 * 
 */
public class TopLevelEnumeration extends InnerEnum implements CompilationUnit {
    private Set<FullyQualifiedJavaType> importedTypes;

    private Set<String> staticImports;

    private List<String> fileCommentLines;

    /**
     * @param type
     */
    public TopLevelEnumeration(FullyQualifiedJavaType type) {
        super(type);
        importedTypes = new TreeSet<FullyQualifiedJavaType>();
        fileCommentLines = new ArrayList<String>();
        staticImports = new TreeSet<String>();
    }

    public String getFormattedContent() {
        StringBuilder sb = new StringBuilder();

        for (String fileCommentLine : fileCommentLines) {
            sb.append(fileCommentLine);
            newLine(sb);
        }

        if (getType().getPackageName() != null
                && getType().getPackageName().length() > 0) {
            sb.append("package "); //$NON-NLS-1$