Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/*
* Copyright (c) 2010, 2018 Oracle and/or its affiliates. All rights reserved.
*
* This program and the accompanying materials are made available under the
* terms of the Eclipse Public License v. 2.0, which is available at
* http://www.eclipse.org/legal/epl-2.0.
*
* This Source Code may also be made available under the following Secondary
* Licenses when the conditions for such availability set forth in the
* Eclipse Public License v. 2.0 are satisfied: GNU General Public License,
* version 2 with the GNU Classpath Exception, which is available at
* https://www.gnu.org/software/classpath/license.html.
*
* SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0
*/
package com.sun.enterprise.admin.cli.schemadoc;
import java.io.File;
import java.io.FileWriter;
import java.io.IOException;
import java.io.InputStream;
import java.io.InputStreamReader;
import java.io.PrintWriter;
import java.lang.reflect.InvocationTargetException;
import java.util.Arrays;
import java.util.HashSet;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Set;
import org.glassfish.api.admin.config.PropertyDesc;
import org.jvnet.hk2.annotations.Service;
import org.jvnet.hk2.config.Attribute;
import org.jvnet.hk2.config.types.Property;
@Service(name = "html")
public class HtmlFormat implements SchemaOutputFormat {
private PrintWriter tocWriter;
private PrintWriter detail;
private Set toc = new HashSet();
private File dir;
private Map defs;
@SuppressWarnings({ "IOResourceOpenedButNotSafelyClosed" })
@Override
public void output(Context context) {
dir = context.getDocDir();
defs = context.getClassDefs();
try {
try {
tocWriter = new PrintWriter(new FileWriter(new File(dir, "toc.HTML")));
detail = new PrintWriter(new FileWriter(new File(dir, "detail.HTML")));
} catch (IOException e) {
e.printStackTrace();
throw new RuntimeException(e.getMessage());
}
println(tocWriter,
"");
println(detail, "");
copyResources();
buildToc(defs.get(context.getRootClassName()));
} catch (Exception e) {
e.printStackTrace();
throw new RuntimeException(e);
} finally {
println(tocWriter, "");
footer(tocWriter);
footer(detail);
if (tocWriter != null) {
tocWriter.close();
}
if (detail != null) {
detail.close();
}
}
}
private void buildDetail(ClassDef def) {
println(detail, "