本文整理汇总了Java中com.sun.tools.doclets.internal.toolkit.util.Util类的典型用法代码示例。如果您正苦于以下问题:Java Util类的具体用法?Java Util怎么用?Java Util使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Util类属于com.sun.tools.doclets.internal.toolkit.util包,在下文中一共展示了Util类的9个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: processOpenAPIClasses
import com.sun.tools.doclets.internal.toolkit.util.Util; //导入依赖的package包/类
@Override
protected void processOpenAPIClasses(ClassDoc[] classes,
Configuration configuration) {
for (int i = 0; i < classes.length; i++) {
if (configuration.nodeprecated
&& (Util.isDeprecated(classes[i]) || Util
.isDeprecated(classes[i].containingPackage()))) {
continue;
}
if (this.isServiceInterface(classes[i])) {
this.processServiceClass(classes[i], configuration);
MethodDoc[] methods = classes[i].methods();
for (int l = 0; l < methods.length; l++) {
if (configuration.nodeprecated
&& Util.isDeprecated(methods[l])) {
continue;
}
this.processOpenAPIMethod(methods[l], configuration);
}
}
}
}
示例2: processServiceClass
import com.sun.tools.doclets.internal.toolkit.util.Util; //导入依赖的package包/类
protected void processServiceClass(ClassDoc service,
Configuration configuration) {
Tag[] serviceTagArray = service.tags(WRTagTaglet.NAME);
for (int i = 0; i < serviceTagArray.length; i++) {
Set<String> serviceTags = WRTagTaglet.getTagSet(serviceTagArray[i]
.text());
for (Iterator<String> iter = serviceTags.iterator(); iter.hasNext();) {
String tag = iter.next();
if (!this.taggedOpenAPIMethods.containsKey(tag)) {
this.taggedOpenAPIMethods
.put(tag, new HashSet<MethodDoc>());
}
// all method of this service should be processed later.
for (int j = 0; j < service.methods().length; j++) {
if (configuration.nodeprecated
&& Util.isDeprecated(service.methods()[j])) {
continue;
}
this.taggedOpenAPIMethods.get(tag)
.add(service.methods()[j]);
}
}
this.wrDoc.getWRTags().addAll(serviceTags);
}
}
示例3: processOpenAPIClasses
import com.sun.tools.doclets.internal.toolkit.util.Util; //导入依赖的package包/类
@Override
public void processOpenAPIClasses(ClassDoc[] classDocs,
Configuration configuration) {
this.excludedUrls = this.getExcludedUrls(configuration);
processAnnotationDubboInterfaces(classDocs);
for (int i = 0; i < classDocs.length; i++) {
if (configuration.nodeprecated
&& (Util.isDeprecated(classDocs[i]) || Util
.isDeprecated(classDocs[i].containingPackage()))) {
continue;
}
if (this.isController(classDocs[i])
|| this.isAPIClass(classDocs[i])) {
this.processControllerClass(classDocs[i], configuration);
MethodDoc[] methods = classDocs[i].methods();
for (int l = 0; l < methods.length; l++) {
this.processOpenAPIMethod(methods[l], configuration);
}
}
}
}
示例4: processControllerClass
import com.sun.tools.doclets.internal.toolkit.util.Util; //导入依赖的package包/类
private void processControllerClass(ClassDoc controller,
Configuration configuration) {
Tag[] controllerTagArray = controller.tags(WRTagTaglet.NAME);
for (int i = 0; i < controllerTagArray.length; i++) {
Set<String> controllerTags = WRTagTaglet
.getTagSet(controllerTagArray[i].text());
for (Iterator<String> iter = controllerTags.iterator(); iter
.hasNext();) {
String tag = iter.next();
if (!this.taggedOpenAPIMethods.containsKey(tag)) {
this.taggedOpenAPIMethods
.put(tag, new HashSet<MethodDoc>());
}
// all action method of this controller should be processed
// later.
for (int j = 0; j < controller.methods().length; j++) {
if (configuration.nodeprecated
&& Util.isDeprecated(controller.methods()[j])) {
continue;
}
if (isOpenAPIMethod(controller.methods()[j])) {
this.taggedOpenAPIMethods.get(tag).add(
controller.methods()[j]);
}
}
}
this.wrDoc.getWRTags().addAll(controllerTags);
}
}
示例5: getFieldValidatorDesc
import com.sun.tools.doclets.internal.toolkit.util.Util; //导入依赖的package包/类
protected String getFieldValidatorDesc(FieldDoc fieldDoc) {
StringBuilder strBuilder = new StringBuilder();
for (AnnotationDesc annotationDesc : fieldDoc.annotations()) {
if (annotationDesc.annotationType().qualifiedTypeName().startsWith("org.hibernate.validator.constraints")
|| annotationDesc.annotationType().qualifiedTypeName().startsWith("javax.validation.constraints")
|| annotationDesc.annotationType().qualifiedTypeName().startsWith("lombok.NonNull")) {
strBuilder.append("@");
strBuilder.append(annotationDesc.annotationType().name());
if (annotationDesc.elementValues().length > 0) {
strBuilder.append("(");
boolean isFirstElement = true;
for (AnnotationDesc.ElementValuePair elementValuePair : annotationDesc.elementValues()) {
if (!isFirstElement) {
strBuilder.append(",");
}
strBuilder.append(elementValuePair.element().name());
strBuilder.append("=");
strBuilder.append(
net.winroad.wrdoclet.utils.Util.decodeUnicode(elementValuePair.value().toString()));
isFirstElement = false;
}
strBuilder.append(")");
}
strBuilder.append(" ");
}
}
return strBuilder.toString();
}
示例6: getFieldNameOfAccesser
import com.sun.tools.doclets.internal.toolkit.util.Util; //导入依赖的package包/类
protected String getFieldNameOfAccesser(String methodName) {
if (methodName.startsWith("get")) {
return net.winroad.wrdoclet.utils.Util.uncapitalize(methodName.replaceFirst("get", ""));
} else if (methodName.startsWith("set")) {
return net.winroad.wrdoclet.utils.Util.uncapitalize(methodName.replaceFirst("set", ""));
} else {
return net.winroad.wrdoclet.utils.Util.uncapitalize(methodName.replaceFirst("is", ""));
}
}
示例7: startGeneration3
import com.sun.tools.doclets.internal.toolkit.util.Util; //导入依赖的package包/类
private boolean startGeneration3(RootDoc root) throws Exception {
configuration = ConfigurationImpl.getInstance();
configuration.root = root;
if (root.classes().length == 0) {
configuration.message.
error("doclet.No_Public_Classes_To_Document");
return false;
}
configuration.setOptions();
configuration.getDocletSpecificMsg().notice("doclet.build_version",
configuration.getDocletSpecificBuildDate());
ClassTree classtree = new ClassTree(configuration,
configuration.nodeprecated);
generateClassFiles(root, classtree);
if (configuration.sourcepath != null
&& configuration.sourcepath.length() > 0) {
StringTokenizer pathTokens = new StringTokenizer(configuration.sourcepath,
String.valueOf(File.pathSeparatorChar));
boolean first = true;
while (pathTokens.hasMoreTokens()) {
Util.copyDocFiles(configuration,
pathTokens.nextToken() + File.separator,
DocletConstants.DOC_FILES_DIR_NAME, first);
first = false;
}
}
PackageListWriter.generate(configuration);
generatePackageFiles(classtree);
generateOtherFiles(root, classtree);
configuration.tagletManager.printReport();
return true;
}
示例8: buildOpenAPIByClasses
import com.sun.tools.doclets.internal.toolkit.util.Util; //导入依赖的package包/类
protected void buildOpenAPIByClasses(Configuration configuration) {
Set<Entry<String, Set<ClassDoc>>> classes = this.taggedOpenAPIClasses.entrySet();
for (Iterator<Entry<String, Set<ClassDoc>>> tagClsIter = classes.iterator(); tagClsIter.hasNext();) {
Entry<String, Set<ClassDoc>> kv = tagClsIter.next();
String tagName = kv.getKey();
if (!this.wrDoc.getTaggedOpenAPIs().containsKey(tagName)) {
this.wrDoc.getTaggedOpenAPIs().put(tagName, new LinkedList<OpenAPI>());
}
Set<ClassDoc> classDocSet = kv.getValue();
for (Iterator<ClassDoc> clsIter = classDocSet.iterator(); clsIter.hasNext();) {
ClassDoc classDoc = clsIter.next();
OpenAPI openAPI = new OpenAPI();
openAPI.setDeprecated(Util.isDeprecated(classDoc) || Util.isDeprecated(classDoc.containingPackage()));
Tag[] tags = classDoc.tags(WRTagTaglet.NAME);
if (tags.length == 0) {
openAPI.addTag(tagName);
} else {
for (Tag t : tags) {
openAPI.addTags(WRTagTaglet.getTagSet(t.text()));
}
}
openAPI.setQualifiedName(classDoc.qualifiedName());
if (StringUtils.isNotBlank(classDoc.commentText())) {
openAPI.setDescription(classDoc.commentText());
}
String brief;
if (classDoc.tags(WRBriefTaglet.NAME).length == 0) {
brief = getBriefFromCommentText(classDoc.commentText());
} else {
brief = classDoc.tags(WRBriefTaglet.NAME)[0].text();
}
openAPI.setBrief(brief);
if (StringUtils.isBlank(openAPI.getDescription())) {
openAPI.setDescription(openAPI.getBrief());
}
openAPI.setModificationHistory(this.getModificationHistory(classDoc));
openAPI.setRequestMapping(this.parseRequestMapping(classDoc));
openAPI.addInParameter(this.getInputParams(classDoc));
openAPI.setOutParameter(this.getOutputParam(classDoc));
this.wrDoc.getTaggedOpenAPIs().get(tagName).add(openAPI);
}
}
}
示例9: buildOpenAPIs
import com.sun.tools.doclets.internal.toolkit.util.Util; //导入依赖的package包/类
protected void buildOpenAPIs(Configuration configuration) {
Set<Entry<String, Set<MethodDoc>>> methods = this.taggedOpenAPIMethods.entrySet();
for (Iterator<Entry<String, Set<MethodDoc>>> tagMthIter = methods.iterator(); tagMthIter.hasNext();) {
Entry<String, Set<MethodDoc>> kv = tagMthIter.next();
String tagName = kv.getKey();
if (!this.wrDoc.getTaggedOpenAPIs().containsKey(tagName)) {
this.wrDoc.getTaggedOpenAPIs().put(tagName, new LinkedList<OpenAPI>());
}
Set<MethodDoc> methodDocSet = kv.getValue();
for (Iterator<MethodDoc> mthIter = methodDocSet.iterator(); mthIter.hasNext();) {
MethodDoc methodDoc = mthIter.next();
OpenAPI openAPI = new OpenAPI();
openAPI.setDeprecated(Util.isDeprecated(methodDoc) || Util.isDeprecated(methodDoc.containingClass())
|| Util.isDeprecated(methodDoc.containingPackage()));
Tag[] tags = this.getTagTaglets(methodDoc);
if (tags.length == 0 && this.methodMap.containsKey(methodDoc)) {
tags = this.getTagTaglets(this.methodMap.get(methodDoc));
}
if (tags.length == 0) {
openAPI.addTag(methodDoc.containingClass().simpleTypeName());
} else {
for (Tag t : tags) {
openAPI.addTags(WRTagTaglet.getTagSet(t.text()));
}
}
openAPI.setQualifiedName(methodDoc.qualifiedName());
if (StringUtils.isNotBlank(methodDoc.commentText())) {
openAPI.setDescription(methodDoc.commentText());
} else if (this.methodMap.containsKey(methodDoc)) {
openAPI.setDescription(this.methodMap.get(methodDoc).commentText());
}
String brief;
if (methodDoc.tags(WRBriefTaglet.NAME).length == 0) {
brief = getBriefFromCommentText(methodDoc.commentText());
} else {
brief = methodDoc.tags(WRBriefTaglet.NAME)[0].text();
}
if (StringUtils.isBlank(brief) && this.methodMap.containsKey(methodDoc)) {
if (this.methodMap.get(methodDoc).tags(WRBriefTaglet.NAME).length == 0) {
brief = getBriefFromCommentText(this.methodMap.get(methodDoc).commentText());
} else {
brief = this.methodMap.get(methodDoc).tags(WRBriefTaglet.NAME)[0].text();
}
}
openAPI.setBrief(brief);
if (StringUtils.isBlank(openAPI.getDescription())) {
openAPI.setDescription(openAPI.getBrief());
}
openAPI.setModificationHistory(this.getModificationHistory(methodDoc));
openAPI.setRequestMapping(this.parseRequestMapping(methodDoc));
if (openAPI.getRequestMapping() != null) {
openAPI.setAuthNeeded(this.isAPIAuthNeeded(openAPI.getRequestMapping().getUrl()));
}
openAPI.addInParameters(this.getInputParams(methodDoc));
openAPI.setOutParameter(this.getOutputParam(methodDoc));
openAPI.setReturnCode(this.getReturnCode(methodDoc));
this.wrDoc.getTaggedOpenAPIs().get(tagName).add(openAPI);
}
}
}