|
Groovy example source code file (SimpleGroovyPackageDoc.java)
The Groovy SimpleGroovyPackageDoc.java source code/* * Copyright 2003-2010 the original author or authors. * * 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.codehaus.groovy.tools.groovydoc; import org.codehaus.groovy.groovydoc.GroovyClassDoc; import org.codehaus.groovy.groovydoc.GroovyPackageDoc; import java.util.ArrayList; import java.util.List; import java.util.Map; import java.util.StringTokenizer; import java.util.TreeMap; public class SimpleGroovyPackageDoc extends SimpleGroovyDoc implements GroovyPackageDoc { private static final char FS = '/'; final Map<String, GroovyClassDoc> classDocs; private String description = ""; private String summary = ""; public SimpleGroovyPackageDoc(String name) { super(name); classDocs = new TreeMap<String, GroovyClassDoc>(); } public GroovyClassDoc[] allClasses() { return classDocs.values().toArray(new GroovyClassDoc[classDocs.values().size()]); } public void setDescription(String description) { this.description = description; } public void setSummary(String summary) { this.summary = summary; } public void putAll(Map<String, GroovyClassDoc> classes) { // 2 way relationship for visible classes: // add reference to classes inside this package // add reference to this package inside classes for (Map.Entry<String, GroovyClassDoc> docEntry : classes.entrySet()) { final GroovyClassDoc classDoc = docEntry.getValue(); classDocs.put(docEntry.getKey(), classDoc); SimpleGroovyProgramElementDoc programElement = (SimpleGroovyProgramElementDoc) classDoc; programElement.setContainingPackage(this); } } public String nameWithDots() { return name().replace(FS, '.'); } public GroovyClassDoc[] allClasses(boolean arg0) { List<GroovyClassDoc> classDocValues = new ArrayList Other Groovy examples (source code examples)Here is a short list of links related to this Groovy SimpleGroovyPackageDoc.java source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.