From f57b87e8f6b8ca9e3c1e640dca51c2a18ee1ef6a Mon Sep 17 00:00:00 2001 From: "J. Duke" Date: Sat, 1 Dec 2007 00:00:00 +0000 Subject: [PATCH] Initial load --- langtools/.hgignore | 3 + langtools/ASSEMBLY_EXCEPTION | 27 + langtools/LICENSE | 347 ++ langtools/README | 43 + langtools/THIRD_PARTY_README | 1616 +++++++ langtools/make/Makefile | 180 + langtools/make/Makefile-classic | 419 ++ langtools/make/README | 43 + langtools/make/build.properties | 135 + langtools/make/build.xml | 759 +++ langtools/make/jprt.config | 241 + langtools/make/jprt.properties | 55 + langtools/make/netbeans/README | 28 + langtools/make/netbeans/apt/README | 15 + langtools/make/netbeans/apt/build.xml | 62 + .../make/netbeans/apt/nbproject/project.xml | 108 + langtools/make/netbeans/common/shared.xml | 186 + ...standard-context-menu-items-no-javadoc.ent | 56 + .../common/standard-context-menu-items.ent | 57 + .../standard-ide-actions-no-javadoc.ent | 161 + .../netbeans/common/standard-ide-actions.ent | 161 + langtools/make/netbeans/compiler/README | 11 + langtools/make/netbeans/compiler/build.xml | 63 + .../netbeans/compiler/nbproject/project.xml | 108 + langtools/make/netbeans/doclets/README | 16 + langtools/make/netbeans/doclets/build.xml | 60 + .../netbeans/doclets/nbproject/project.xml | 108 + langtools/make/netbeans/javadoc/README | 16 + langtools/make/netbeans/javadoc/build.xml | 63 + .../netbeans/javadoc/nbproject/project.xml | 108 + langtools/make/netbeans/javah/README | 21 + langtools/make/netbeans/javah/build.xml | 60 + .../make/netbeans/javah/nbproject/project.xml | 108 + langtools/make/netbeans/javap/README | 11 + langtools/make/netbeans/javap/build.xml | 60 + .../make/netbeans/javap/nbproject/project.xml | 108 + langtools/make/test/HelloWorld.apt.gold.txt | 19 + langtools/make/test/HelloWorld.gold.h | 21 + langtools/make/test/HelloWorld.java | 45 + .../make/test/HelloWorld.javadoc.gold.txt | 15 + langtools/make/test/HelloWorld.javap.gold.txt | 7 + langtools/make/test/README | 4 + langtools/make/test/TEST.ROOT | 0 langtools/make/test/bootstrap/javac.sh | 42 + langtools/make/test/bootstrap/javadoc.sh | 43 + langtools/make/test/bootstrap/javah.sh | 40 + langtools/make/test/contents.gold.txt | 9 + langtools/make/test/contents.sh | 42 + langtools/make/test/lib/apt.sh | 42 + langtools/make/test/lib/classes.gold.txt | 38 + langtools/make/test/lib/classes.sh | 50 + langtools/make/test/lib/javac.sh | 44 + langtools/make/test/lib/javadoc.sh | 47 + langtools/make/test/lib/javah.sh | 46 + langtools/make/test/lib/javap.sh | 46 + langtools/make/test/lib/src.gold.txt | 53 + langtools/make/test/lib/src.sh | 50 + .../CompileProperties/CompileProperties.java | 403 ++ .../CompilePropertiesTask.java | 96 + langtools/src/share/bin/launcher.sh-template | 50 + .../com/sun/javadoc/AnnotationDesc.java | 79 + .../com/sun/javadoc/AnnotationTypeDoc.java | 44 + .../sun/javadoc/AnnotationTypeElementDoc.java | 44 + .../com/sun/javadoc/AnnotationValue.java | 59 + .../classes/com/sun/javadoc/ClassDoc.java | 340 ++ .../com/sun/javadoc/ConstructorDoc.java | 35 + .../share/classes/com/sun/javadoc/Doc.java | 265 + .../com/sun/javadoc/DocErrorReporter.java | 83 + .../share/classes/com/sun/javadoc/Doclet.java | 111 + .../com/sun/javadoc/ExecutableMemberDoc.java | 140 + .../classes/com/sun/javadoc/FieldDoc.java | 79 + .../com/sun/javadoc/LanguageVersion.java | 47 + .../classes/com/sun/javadoc/MemberDoc.java | 47 + .../classes/com/sun/javadoc/MethodDoc.java | 94 + .../classes/com/sun/javadoc/PackageDoc.java | 129 + .../classes/com/sun/javadoc/ParamTag.java | 67 + .../classes/com/sun/javadoc/Parameter.java | 74 + .../com/sun/javadoc/ParameterizedType.java | 108 + .../com/sun/javadoc/ProgramElementDoc.java | 125 + .../classes/com/sun/javadoc/RootDoc.java | 109 + .../share/classes/com/sun/javadoc/SeeTag.java | 126 + .../com/sun/javadoc/SerialFieldTag.java | 87 + .../com/sun/javadoc/SourcePosition.java | 55 + .../share/classes/com/sun/javadoc/Tag.java | 158 + .../classes/com/sun/javadoc/ThrowsTag.java | 79 + .../share/classes/com/sun/javadoc/Type.java | 153 + .../classes/com/sun/javadoc/TypeVariable.java | 58 + .../classes/com/sun/javadoc/WildcardType.java | 61 + .../classes/com/sun/javadoc/package.html | 152 + .../sun/mirror/apt/AnnotationProcessor.java | 64 + .../apt/AnnotationProcessorEnvironment.java | 177 + .../apt/AnnotationProcessorFactory.java | 103 + .../apt/AnnotationProcessorListener.java | 35 + .../sun/mirror/apt/AnnotationProcessors.java | 117 + .../classes/com/sun/mirror/apt/Filer.java | 150 + .../classes/com/sun/mirror/apt/Messager.java | 88 + .../sun/mirror/apt/RoundCompleteEvent.java | 68 + .../sun/mirror/apt/RoundCompleteListener.java | 42 + .../com/sun/mirror/apt/RoundState.java | 59 + .../classes/com/sun/mirror/apt/package.html | 42 + .../mirror/declaration/AnnotationMirror.java | 81 + .../AnnotationTypeDeclaration.java | 51 + .../AnnotationTypeElementDeclaration.java | 51 + .../mirror/declaration/AnnotationValue.java | 76 + .../mirror/declaration/ClassDeclaration.java | 83 + .../declaration/ConstructorDeclaration.java | 38 + .../sun/mirror/declaration/Declaration.java | 163 + .../declaration/EnumConstantDeclaration.java | 42 + .../mirror/declaration/EnumDeclaration.java | 49 + .../declaration/ExecutableDeclaration.java | 79 + .../mirror/declaration/FieldDeclaration.java | 73 + .../declaration/InterfaceDeclaration.java | 51 + .../mirror/declaration/MemberDeclaration.java | 51 + .../mirror/declaration/MethodDeclaration.java | 53 + .../com/sun/mirror/declaration/Modifier.java | 72 + .../declaration/PackageDeclaration.java | 95 + .../declaration/ParameterDeclaration.java | 48 + .../mirror/declaration/TypeDeclaration.java | 140 + .../declaration/TypeParameterDeclaration.java | 63 + .../com/sun/mirror/declaration/package.html | 44 + .../classes/com/sun/mirror/overview.html | 111 + .../com/sun/mirror/type/AnnotationType.java | 46 + .../com/sun/mirror/type/ArrayType.java | 47 + .../com/sun/mirror/type/ClassType.java | 68 + .../com/sun/mirror/type/DeclaredType.java | 105 + .../classes/com/sun/mirror/type/EnumType.java | 46 + .../com/sun/mirror/type/InterfaceType.java | 53 + .../mirror/type/MirroredTypeException.java | 81 + .../mirror/type/MirroredTypesException.java | 90 + .../com/sun/mirror/type/PrimitiveType.java | 61 + .../com/sun/mirror/type/ReferenceType.java | 39 + .../com/sun/mirror/type/TypeMirror.java | 79 + .../com/sun/mirror/type/TypeVariable.java | 51 + .../classes/com/sun/mirror/type/VoidType.java | 43 + .../com/sun/mirror/type/WildcardType.java | 68 + .../classes/com/sun/mirror/type/package.html | 42 + .../sun/mirror/util/DeclarationFilter.java | 313 ++ .../sun/mirror/util/DeclarationScanner.java | 261 + .../sun/mirror/util/DeclarationVisitor.java | 143 + .../sun/mirror/util/DeclarationVisitors.java | 97 + .../com/sun/mirror/util/Declarations.java | 63 + .../mirror/util/SimpleDeclarationVisitor.java | 210 + .../sun/mirror/util/SimpleTypeVisitor.java | 169 + .../mirror/util/SourceOrderDeclScanner.java | 247 + .../com/sun/mirror/util/SourcePosition.java | 66 + .../com/sun/mirror/util/TypeVisitor.java | 131 + .../classes/com/sun/mirror/util/Types.java | 183 + .../classes/com/sun/mirror/util/package.html | 42 + .../com/sun/source/tree/AnnotationTree.java | 48 + .../com/sun/source/tree/ArrayAccessTree.java | 45 + .../com/sun/source/tree/ArrayTypeTree.java | 44 + .../com/sun/source/tree/AssertTree.java | 47 + .../com/sun/source/tree/AssignmentTree.java | 45 + .../com/sun/source/tree/BinaryTree.java | 46 + .../com/sun/source/tree/BlockTree.java | 51 + .../com/sun/source/tree/BreakTree.java | 48 + .../classes/com/sun/source/tree/CaseTree.java | 54 + .../com/sun/source/tree/CatchTree.java | 46 + .../com/sun/source/tree/ClassTree.java | 59 + .../sun/source/tree/CompilationUnitTree.java | 54 + .../source/tree/CompoundAssignmentTree.java | 46 + .../tree/ConditionalExpressionTree.java | 46 + .../com/sun/source/tree/ContinueTree.java | 47 + .../com/sun/source/tree/DoWhileLoopTree.java | 47 + .../sun/source/tree/EmptyStatementTree.java | 42 + .../sun/source/tree/EnhancedForLoopTree.java | 47 + .../com/sun/source/tree/ErroneousTree.java | 39 + .../source/tree/ExpressionStatementTree.java | 44 + .../com/sun/source/tree/ExpressionTree.java | 38 + .../com/sun/source/tree/ForLoopTree.java | 50 + .../com/sun/source/tree/IdentifierTree.java | 46 + .../classes/com/sun/source/tree/IfTree.java | 55 + .../com/sun/source/tree/ImportTree.java | 51 + .../com/sun/source/tree/InstanceOfTree.java | 45 + .../sun/source/tree/LabeledStatementTree.java | 47 + .../classes/com/sun/source/tree/LineMap.java | 78 + .../com/sun/source/tree/LiteralTree.java | 45 + .../com/sun/source/tree/MemberSelectTree.java | 48 + .../sun/source/tree/MethodInvocationTree.java | 50 + .../com/sun/source/tree/MethodTree.java | 59 + .../com/sun/source/tree/ModifiersTree.java | 52 + .../com/sun/source/tree/NewArrayTree.java | 50 + .../com/sun/source/tree/NewClassTree.java | 57 + .../source/tree/ParameterizedTypeTree.java | 47 + .../sun/source/tree/ParenthesizedTree.java | 45 + .../sun/source/tree/PrimitiveTypeTree.java | 46 + .../com/sun/source/tree/ReturnTree.java | 45 + .../classes/com/sun/source/tree/Scope.java | 73 + .../com/sun/source/tree/StatementTree.java | 38 + .../com/sun/source/tree/SwitchTree.java | 49 + .../com/sun/source/tree/SynchronizedTree.java | 46 + .../com/sun/source/tree/ThrowTree.java | 44 + .../classes/com/sun/source/tree/Tree.java | 585 +++ .../com/sun/source/tree/TreeVisitor.java | 108 + .../classes/com/sun/source/tree/TryTree.java | 52 + .../com/sun/source/tree/TypeCastTree.java | 45 + .../sun/source/tree/TypeParameterTree.java | 50 + .../com/sun/source/tree/UnaryTree.java | 47 + .../com/sun/source/tree/VariableTree.java | 49 + .../com/sun/source/tree/WhileLoopTree.java | 47 + .../com/sun/source/tree/WildcardTree.java | 49 + .../com/sun/source/tree/package-info.java | 34 + .../com/sun/source/util/JavacTask.java | 91 + .../sun/source/util/SimpleTreeVisitor.java | 254 + .../com/sun/source/util/SourcePositions.java | 86 + .../com/sun/source/util/TaskEvent.java | 122 + .../com/sun/source/util/TaskListener.java | 40 + .../classes/com/sun/source/util/TreePath.java | 142 + .../com/sun/source/util/TreePathScanner.java | 82 + .../com/sun/source/util/TreeScanner.java | 381 ++ .../classes/com/sun/source/util/Trees.java | 180 + .../com/sun/source/util/package-info.java | 33 + .../share/classes/com/sun/tools/apt/Main.java | 115 + .../apt/comp/AnnotationProcessingError.java | 32 + .../classes/com/sun/tools/apt/comp/Apt.java | 546 +++ .../com/sun/tools/apt/comp/BootstrapAPF.java | 58 + .../com/sun/tools/apt/comp/PrintAP.java | 466 ++ .../apt/comp/UsageMessageNeededException.java | 29 + .../com/sun/tools/apt/main/CommandLine.java | 90 + .../com/sun/tools/apt/main/JavaCompiler.java | 298 ++ .../classes/com/sun/tools/apt/main/Main.java | 1329 ++++++ .../com/sun/tools/apt/mirror/AptEnv.java | 107 + .../AnnotationProcessorEnvironmentImpl.java | 184 + .../sun/tools/apt/mirror/apt/FilerImpl.java | 354 ++ .../tools/apt/mirror/apt/MessagerImpl.java | 121 + .../mirror/apt/RoundCompleteEventImpl.java | 37 + .../tools/apt/mirror/apt/RoundStateImpl.java | 81 + .../declaration/AnnotationMirrorImpl.java | 136 + .../declaration/AnnotationProxyMaker.java | 347 ++ .../AnnotationTypeDeclarationImpl.java | 63 + .../AnnotationTypeElementDeclarationImpl.java | 68 + .../declaration/AnnotationValueImpl.java | 121 + .../declaration/ClassDeclarationImpl.java | 115 + .../apt/mirror/declaration/Constants.java | 293 ++ .../ConstructorDeclarationImpl.java | 65 + .../mirror/declaration/DeclarationImpl.java | 254 + .../mirror/declaration/DeclarationMaker.java | 270 ++ .../EnumConstantDeclarationImpl.java | 59 + .../declaration/EnumDeclarationImpl.java | 63 + .../ExecutableDeclarationImpl.java | 89 + .../declaration/FieldDeclarationImpl.java | 98 + .../declaration/InterfaceDeclarationImpl.java | 52 + .../declaration/MemberDeclarationImpl.java | 111 + .../declaration/MethodDeclarationImpl.java | 61 + .../declaration/PackageDeclarationImpl.java | 126 + .../declaration/ParameterDeclarationImpl.java | 100 + .../declaration/TypeDeclarationImpl.java | 157 + .../TypeParameterDeclarationImpl.java | 121 + .../apt/mirror/type/AnnotationTypeImpl.java | 61 + .../tools/apt/mirror/type/ArrayTypeImpl.java | 63 + .../tools/apt/mirror/type/ClassTypeImpl.java | 72 + .../apt/mirror/type/DeclaredTypeImpl.java | 112 + .../tools/apt/mirror/type/EnumTypeImpl.java | 60 + .../apt/mirror/type/InterfaceTypeImpl.java | 61 + .../apt/mirror/type/PrimitiveTypeImpl.java | 84 + .../sun/tools/apt/mirror/type/TypeMaker.java | 160 + .../tools/apt/mirror/type/TypeMirrorImpl.java | 76 + .../apt/mirror/type/TypeVariableImpl.java | 77 + .../tools/apt/mirror/type/VoidTypeImpl.java | 50 + .../apt/mirror/type/WildcardTypeImpl.java | 111 + .../apt/mirror/util/DeclarationsImpl.java | 133 + .../apt/mirror/util/SourcePositionImpl.java | 94 + .../sun/tools/apt/mirror/util/TypesImpl.java | 229 + .../sun/tools/apt/resources/apt.properties | 176 + .../sun/tools/apt/resources/apt_ja.properties | 176 + .../tools/apt/resources/apt_zh_CN.properties | 176 + .../classes/com/sun/tools/apt/util/Bark.java | 174 + .../classes/com/sun/tools/doclets/Taglet.java | 157 + .../html/AbstractExecutableMemberWriter.java | 250 + .../formats/html/AbstractIndexWriter.java | 242 + .../formats/html/AbstractMemberWriter.java | 427 ++ .../html/AbstractPackageIndexWriter.java | 156 + .../formats/html/AbstractTreeWriter.java | 200 + .../formats/html/AllClassesFrameWriter.java | 181 + ...nnotationTypeOptionalMemberWriterImpl.java | 108 + ...nnotationTypeRequiredMemberWriterImpl.java | 282 ++ .../html/AnnotationTypeWriterImpl.java | 358 ++ .../doclets/formats/html/ClassUseWriter.java | 456 ++ .../doclets/formats/html/ClassWriterImpl.java | 600 +++ .../formats/html/ConfigurationImpl.java | 487 ++ .../html/ConstantsSummaryWriterImpl.java | 244 + .../formats/html/ConstructorWriterImpl.java | 306 ++ .../formats/html/DeprecatedListWriter.java | 187 + .../formats/html/EnumConstantWriterImpl.java | 259 + .../doclets/formats/html/FieldWriterImpl.java | 304 ++ .../formats/html/FrameOutputWriter.java | 167 + .../doclets/formats/html/HelpWriter.java | 230 + .../doclets/formats/html/HtmlDoclet.java | 267 ++ .../formats/html/HtmlDocletWriter.java | 1848 +++++++ .../formats/html/HtmlSerialFieldWriter.java | 167 + .../formats/html/HtmlSerialMethodWriter.java | 112 + .../doclets/formats/html/LinkFactoryImpl.java | 175 + .../doclets/formats/html/LinkInfoImpl.java | 451 ++ .../doclets/formats/html/LinkOutputImpl.java | 65 + .../formats/html/MethodWriterImpl.java | 405 ++ .../formats/html/NestedClassWriterImpl.java | 240 + .../formats/html/PackageFrameWriter.java | 216 + .../formats/html/PackageIndexFrameWriter.java | 182 + .../formats/html/PackageIndexWriter.java | 213 + .../formats/html/PackageTreeWriter.java | 197 + .../formats/html/PackageUseWriter.java | 266 ++ .../formats/html/PackageWriterImpl.java | 275 ++ .../html/SerializedFormWriterImpl.java | 166 + .../formats/html/SingleIndexWriter.java | 115 + .../formats/html/SplitIndexWriter.java | 164 + .../formats/html/StylesheetWriter.java | 122 + .../formats/html/SubWriterHolderWriter.java | 175 + .../formats/html/TagletOutputImpl.java | 70 + .../formats/html/TagletWriterImpl.java | 304 ++ .../doclets/formats/html/TreeWriter.java | 171 + .../formats/html/WriterFactoryImpl.java | 198 + .../formats/html/markup/HtmlDocWriter.java | 357 ++ .../formats/html/markup/HtmlWriter.java | 1105 +++++ .../doclets/formats/html/markup/package.html | 32 + .../tools/doclets/formats/html/package.html | 39 + .../html/resources/standard.properties | 250 + .../html/resources/standard_ja.properties | 250 + .../html/resources/standard_zh_CN.properties | 250 + .../internal/toolkit/AbstractDoclet.java | 199 + .../AnnotationTypeOptionalMemberWriter.java | 48 + .../AnnotationTypeRequiredMemberWriter.java | 105 + .../toolkit/AnnotationTypeWriter.java | 95 + .../doclets/internal/toolkit/ClassWriter.java | 137 + .../internal/toolkit/Configuration.java | 716 +++ .../toolkit/ConstantsSummaryWriter.java | 114 + .../internal/toolkit/ConstructorWriter.java | 112 + .../internal/toolkit/EnumConstantWriter.java | 105 + .../doclets/internal/toolkit/FieldWriter.java | 105 + .../internal/toolkit/MemberSummaryWriter.java | 99 + .../internal/toolkit/MethodWriter.java | 106 + .../internal/toolkit/NestedClassWriter.java | 95 + .../toolkit/PackageSummaryWriter.java | 97 + .../toolkit/SerializedFormWriter.java | 205 + .../internal/toolkit/WriterFactory.java | 198 + .../toolkit/builders/AbstractBuilder.java | 144 + .../builders/AbstractMemberBuilder.java | 84 + .../builders/AnnotationTypeBuilder.java | 237 + .../AnnotationTypeOptionalMemberBuilder.java | 136 + .../AnnotationTypeRequiredMemberBuilder.java | 245 + .../toolkit/builders/BuilderFactory.java | 235 + .../toolkit/builders/ClassBuilder.java | 350 ++ .../builders/ConstantsSummaryBuilder.java | 414 ++ .../toolkit/builders/ConstructorBuilder.java | 256 + .../toolkit/builders/EnumConstantBuilder.java | 254 + .../toolkit/builders/FieldBuilder.java | 251 + .../toolkit/builders/LayoutParser.java | 139 + .../builders/MemberSummaryBuilder.java | 369 ++ .../toolkit/builders/MethodBuilder.java | 257 + .../builders/PackageSummaryBuilder.java | 285 ++ .../builders/SerializedFormBuilder.java | 504 ++ .../internal/toolkit/builders/package.html | 43 + .../doclets/internal/toolkit/package.html | 55 + .../internal/toolkit/resources/doclet.xml | 204 + .../toolkit/resources/doclets.properties | 151 + .../toolkit/resources/doclets_ja.properties | 147 + .../resources/doclets_zh_CN.properties | 150 + .../internal/toolkit/resources/inherit.gif | Bin 0 -> 57 bytes .../taglets/BaseExecutableMemberTaglet.java | 94 + .../toolkit/taglets/BaseInlineTaglet.java | 48 + .../internal/toolkit/taglets/BaseTaglet.java | 144 + .../internal/toolkit/taglets/CodeTaglet.java | 65 + .../toolkit/taglets/DeprecatedTaglet.java | 60 + .../toolkit/taglets/DocRootTaglet.java | 65 + .../toolkit/taglets/InheritDocTaglet.java | 156 + .../toolkit/taglets/InheritableTaglet.java | 48 + .../toolkit/taglets/LegacyTaglet.java | 133 + .../toolkit/taglets/LiteralTaglet.java | 101 + .../internal/toolkit/taglets/ParamTaglet.java | 321 ++ .../toolkit/taglets/ReturnTaglet.java | 95 + .../internal/toolkit/taglets/SeeTaglet.java | 74 + .../toolkit/taglets/SimpleTaglet.java | 217 + .../internal/toolkit/taglets/Taglet.java | 155 + .../toolkit/taglets/TagletManager.java | 760 +++ .../toolkit/taglets/TagletOutput.java | 55 + .../toolkit/taglets/TagletWriter.java | 280 ++ .../toolkit/taglets/ThrowsTaglet.java | 184 + .../internal/toolkit/taglets/ValueTaglet.java | 179 + .../internal/toolkit/taglets/package.html | 54 + .../toolkit/util/ClassDocCatalog.java | 278 ++ .../internal/toolkit/util/ClassTree.java | 375 ++ .../internal/toolkit/util/ClassUseMapper.java | 474 ++ .../toolkit/util/CommentedMethodFinder.java | 42 + .../util/DeprecatedAPIListBuilder.java | 152 + .../toolkit/util/DirectoryManager.java | 317 ++ .../internal/toolkit/util/DocFinder.java | 224 + .../toolkit/util/DocletAbortException.java | 32 + .../toolkit/util/DocletConstants.java | 85 + .../doclets/internal/toolkit/util/Extern.java | 311 ++ .../doclets/internal/toolkit/util/Group.java | 254 + .../toolkit/util/ImplementedMethods.java | 149 + .../internal/toolkit/util/IndexBuilder.java | 238 + .../toolkit/util/MessageRetriever.java | 455 ++ .../internal/toolkit/util/MetaKeywords.java | 156 + .../internal/toolkit/util/MethodFinder.java | 71 + .../toolkit/util/PackageListWriter.java | 88 + .../internal/toolkit/util/SourcePath.java | 133 + .../toolkit/util/SourceToHTMLConverter.java | 289 ++ .../toolkit/util/TaggedMethodFinder.java | 44 + .../internal/toolkit/util/TextTag.java | 109 + .../doclets/internal/toolkit/util/Util.java | 836 ++++ .../toolkit/util/VisibleMemberMap.java | 515 ++ .../toolkit/util/links/LinkFactory.java | 243 + .../internal/toolkit/util/links/LinkInfo.java | 151 + .../toolkit/util/links/LinkOutput.java | 42 + .../internal/toolkit/util/links/package.html | 33 + .../internal/toolkit/util/package.html | 38 + .../com/sun/tools/doclets/package.html | 34 + .../sun/tools/doclets/standard/Standard.java | 53 + .../classes/com/sun/tools/javac/Launcher.java | 73 + .../classes/com/sun/tools/javac/Main.java | 102 + .../classes/com/sun/tools/javac/Server.java | 199 + .../com/sun/tools/javac/api/JavacScope.java | 140 + .../sun/tools/javac/api/JavacTaskImpl.java | 536 +++ .../com/sun/tools/javac/api/JavacTool.java | 296 ++ .../com/sun/tools/javac/api/JavacTrees.java | 325 ++ .../javac/api/WrappingJavaFileManager.java | 208 + .../com/sun/tools/javac/code/Attribute.java | 284 ++ .../com/sun/tools/javac/code/BoundKind.java | 41 + .../com/sun/tools/javac/code/Flags.java | 274 ++ .../com/sun/tools/javac/code/Kinds.java | 85 + .../com/sun/tools/javac/code/Lint.java | 298 ++ .../com/sun/tools/javac/code/Scope.java | 500 ++ .../com/sun/tools/javac/code/Source.java | 174 + .../com/sun/tools/javac/code/Symbol.java | 1296 +++++ .../com/sun/tools/javac/code/Symtab.java | 577 +++ .../com/sun/tools/javac/code/Type.java | 1248 +++++ .../com/sun/tools/javac/code/TypeTags.java | 136 + .../com/sun/tools/javac/code/Types.java | 3258 +++++++++++++ .../com/sun/tools/javac/comp/Annotate.java | 258 + .../com/sun/tools/javac/comp/Attr.java | 2810 +++++++++++ .../com/sun/tools/javac/comp/AttrContext.java | 98 + .../sun/tools/javac/comp/AttrContextEnv.java | 46 + .../com/sun/tools/javac/comp/Check.java | 2123 ++++++++ .../com/sun/tools/javac/comp/ConstFold.java | 358 ++ .../com/sun/tools/javac/comp/Enter.java | 489 ++ .../classes/com/sun/tools/javac/comp/Env.java | 150 + .../com/sun/tools/javac/comp/Flow.java | 1286 +++++ .../com/sun/tools/javac/comp/Infer.java | 403 ++ .../com/sun/tools/javac/comp/Lower.java | 3314 +++++++++++++ .../com/sun/tools/javac/comp/MemberEnter.java | 1107 +++++ .../com/sun/tools/javac/comp/Resolve.java | 1809 +++++++ .../com/sun/tools/javac/comp/Todo.java | 54 + .../com/sun/tools/javac/comp/TransTypes.java | 794 +++ .../com/sun/tools/javac/jvm/ByteCodes.java | 310 ++ .../com/sun/tools/javac/jvm/CRTFlags.java | 55 + .../com/sun/tools/javac/jvm/CRTable.java | 616 +++ .../com/sun/tools/javac/jvm/ClassFile.java | 160 + .../com/sun/tools/javac/jvm/ClassReader.java | 2280 +++++++++ .../com/sun/tools/javac/jvm/ClassWriter.java | 1620 +++++++ .../classes/com/sun/tools/javac/jvm/Code.java | 2178 +++++++++ .../classes/com/sun/tools/javac/jvm/Gen.java | 2302 +++++++++ .../com/sun/tools/javac/jvm/Items.java | 800 ++++ .../classes/com/sun/tools/javac/jvm/Pool.java | 172 + .../com/sun/tools/javac/jvm/Target.java | 303 ++ .../tools/javac/jvm/UninitializedType.java | 60 + .../com/sun/tools/javac/main/CommandLine.java | 90 + .../sun/tools/javac/main/JavaCompiler.java | 1490 ++++++ .../com/sun/tools/javac/main/JavacOption.java | 185 + .../com/sun/tools/javac/main/Main.java | 504 ++ .../com/sun/tools/javac/main/OptionName.java | 106 + .../tools/javac/main/RecognizedOptions.java | 615 +++ .../javac/model/AnnotationProxyMaker.java | 337 ++ .../tools/javac/model/FilteredMemberList.java | 116 + .../sun/tools/javac/model/JavacElements.java | 644 +++ .../javac/model/JavacSourcePosition.java | 75 + .../com/sun/tools/javac/model/JavacTypes.java | 304 ++ .../tools/javac/parser/DocCommentScanner.java | 454 ++ .../sun/tools/javac/parser/EndPosParser.java | 104 + .../com/sun/tools/javac/parser/Keywords.java | 127 + .../com/sun/tools/javac/parser/Lexer.java | 142 + .../com/sun/tools/javac/parser/Parser.java | 2863 +++++++++++ .../com/sun/tools/javac/parser/Scanner.java | 1122 +++++ .../com/sun/tools/javac/parser/Token.java | 158 + .../processing/AnnotationProcessingError.java | 42 + .../tools/javac/processing/JavacFiler.java | 609 +++ .../tools/javac/processing/JavacMessager.java | 181 + .../JavacProcessingEnvironment.java | 1387 ++++++ .../processing/JavacRoundEnvironment.java | 176 + .../javac/processing/PrintingProcessor.java | 550 +++ .../tools/javac/processing/ServiceProxy.java | 153 + .../tools/javac/resources/compiler.properties | 1142 +++++ .../javac/resources/compiler_ja.properties | 1125 +++++ .../javac/resources/compiler_zh_CN.properties | 1125 +++++ .../tools/javac/resources/javac.properties | 210 + .../tools/javac/resources/javac_ja.properties | 208 + .../javac/resources/javac_zh_CN.properties | 208 + .../tools/javac/resources/legacy.properties | 567 +++ .../resources/version.properties-template | 28 + .../services/javax.tools.JavaCompilerTool | 1 + .../sun/tools/javac/sym/CreateSymbols.java | 495 ++ .../com/sun/tools/javac/tree/JCTree.java | 2183 +++++++++ .../com/sun/tools/javac/tree/Pretty.java | 1224 +++++ .../com/sun/tools/javac/tree/TreeCopier.java | 415 ++ .../com/sun/tools/javac/tree/TreeInfo.java | 863 ++++ .../com/sun/tools/javac/tree/TreeMaker.java | 890 ++++ .../com/sun/tools/javac/tree/TreeScanner.java | 306 ++ .../sun/tools/javac/tree/TreeTranslator.java | 406 ++ .../com/sun/tools/javac/util/Abort.java | 47 + .../sun/tools/javac/util/BaseFileObject.java | 79 + .../com/sun/tools/javac/util/Bits.java | 222 + .../com/sun/tools/javac/util/ByteBuffer.java | 167 + .../tools/javac/util/ClientCodeException.java | 44 + .../com/sun/tools/javac/util/Constants.java | 127 + .../com/sun/tools/javac/util/Context.java | 208 + .../com/sun/tools/javac/util/Convert.java | 320 ++ .../tools/javac/util/DiagnosticFormatter.java | 252 + .../com/sun/tools/javac/util/FatalError.java | 60 + .../sun/tools/javac/util/JCDiagnostic.java | 482 ++ .../tools/javac/util/JavacFileManager.java | 1715 +++++++ .../tools/javac/util/LayoutCharacters.java | 63 + .../com/sun/tools/javac/util/List.java | 484 ++ .../com/sun/tools/javac/util/ListBuffer.java | 239 + .../classes/com/sun/tools/javac/util/Log.java | 723 +++ .../javac/util/MandatoryWarningHandler.java | 227 + .../com/sun/tools/javac/util/Messages.java | 157 + .../com/sun/tools/javac/util/Name.java | 653 +++ .../com/sun/tools/javac/util/Old199.java | 60 + .../com/sun/tools/javac/util/Options.java | 107 + .../com/sun/tools/javac/util/Pair.java | 69 + .../com/sun/tools/javac/util/Paths.java | 574 +++ .../com/sun/tools/javac/util/Position.java | 282 ++ .../tools/javac/util/PropagatedException.java | 50 + .../com/sun/tools/javac/util/Warner.java | 65 + .../com/sun/tools/javac/zip/ZipFileIndex.java | 1211 +++++ .../tools/javac/zip/ZipFileIndexEntry.java | 91 + .../sun/tools/javadoc/AbstractTypeImpl.java | 103 + .../sun/tools/javadoc/AnnotationDescImpl.java | 155 + .../tools/javadoc/AnnotationTypeDocImpl.java | 107 + .../javadoc/AnnotationTypeElementDocImpl.java | 91 + .../tools/javadoc/AnnotationValueImpl.java | 172 + .../com/sun/tools/javadoc/ClassDocImpl.java | 1261 +++++ .../com/sun/tools/javadoc/Comment.java | 430 ++ .../sun/tools/javadoc/ConstructorDocImpl.java | 104 + .../classes/com/sun/tools/javadoc/DocEnv.java | 776 +++ .../com/sun/tools/javadoc/DocImpl.java | 420 ++ .../com/sun/tools/javadoc/DocLocale.java | 239 + .../com/sun/tools/javadoc/DocletInvoker.java | 312 ++ .../javadoc/ExecutableMemberDocImpl.java | 274 ++ .../com/sun/tools/javadoc/FieldDocImpl.java | 267 ++ .../sun/tools/javadoc/JavadocClassReader.java | 111 + .../com/sun/tools/javadoc/JavadocEnter.java | 97 + .../sun/tools/javadoc/JavadocMemberEnter.java | 96 + .../com/sun/tools/javadoc/JavadocTodo.java | 53 + .../com/sun/tools/javadoc/JavadocTool.java | 369 ++ .../classes/com/sun/tools/javadoc/Main.java | 108 + .../com/sun/tools/javadoc/MemberDocImpl.java | 63 + .../com/sun/tools/javadoc/Messager.java | 465 ++ .../com/sun/tools/javadoc/MethodDocImpl.java | 223 + .../com/sun/tools/javadoc/ModifierFilter.java | 119 + .../com/sun/tools/javadoc/PackageDocImpl.java | 415 ++ .../com/sun/tools/javadoc/ParamTagImpl.java | 103 + .../com/sun/tools/javadoc/ParameterImpl.java | 105 + .../tools/javadoc/ParameterizedTypeImpl.java | 143 + .../com/sun/tools/javadoc/PrimitiveType.java | 151 + .../tools/javadoc/ProgramElementDocImpl.java | 224 + .../com/sun/tools/javadoc/RootDocImpl.java | 354 ++ .../com/sun/tools/javadoc/SeeTagImpl.java | 477 ++ .../sun/tools/javadoc/SerialFieldTagImpl.java | 259 + .../com/sun/tools/javadoc/SerializedForm.java | 282 ++ .../sun/tools/javadoc/SourcePositionImpl.java | 94 + .../classes/com/sun/tools/javadoc/Start.java | 470 ++ .../com/sun/tools/javadoc/TagImpl.java | 183 + .../com/sun/tools/javadoc/ThrowsTagImpl.java | 111 + .../com/sun/tools/javadoc/TypeMaker.java | 310 ++ .../sun/tools/javadoc/TypeVariableImpl.java | 122 + .../sun/tools/javadoc/WildcardTypeImpl.java | 131 + .../javadoc/resources/javadoc.properties | 107 + .../javadoc/resources/javadoc_ja.properties | 107 + .../resources/javadoc_zh_CN.properties | 107 + .../classes/com/sun/tools/javah/Gen.java | 347 ++ .../classes/com/sun/tools/javah/JNI.java | 166 + .../classes/com/sun/tools/javah/LLNI.java | 604 +++ .../classes/com/sun/tools/javah/Main.java | 156 + .../com/sun/tools/javah/MainDoclet.java | 218 + .../classes/com/sun/tools/javah/Mangle.java | 166 + .../com/sun/tools/javah/TypeSignature.java | 225 + .../classes/com/sun/tools/javah/Util.java | 192 + .../javah/resources/Linux_ppc.properties | 27 + .../javah/resources/Linux_sparc.properties | 27 + .../javah/resources/SunOS_sparc.properties | 27 + .../javah/resources/SunOS_sparcv9.properties | 27 + .../sun/tools/javah/resources/l10n.properties | 118 + .../tools/javah/resources/l10n_ja.properties | 72 + .../javah/resources/l10n_zh_CN.properties | 118 + .../javah/resources/win32_x86.properties | 28 + .../processing/AbstractProcessor.java | 195 + .../annotation/processing/Completion.java | 51 + .../annotation/processing/Completions.java | 89 + .../javax/annotation/processing/Filer.java | 261 + .../annotation/processing/FilerException.java | 53 + .../javax/annotation/processing/Messager.java | 101 + .../processing/ProcessingEnvironment.java | 136 + .../annotation/processing/Processor.java | 409 ++ .../processing/RoundEnvironment.java | 113 + .../processing/SupportedAnnotationTypes.java | 51 + .../processing/SupportedOptions.java | 50 + .../processing/SupportedSourceVersion.java | 51 + .../annotation/processing/package-info.java | 43 + .../javax/lang/model/SourceVersion.java | 258 + .../lang/model/element/AnnotationMirror.java | 74 + .../lang/model/element/AnnotationValue.java | 77 + .../model/element/AnnotationValueVisitor.java | 202 + .../javax/lang/model/element/Element.java | 258 + .../javax/lang/model/element/ElementKind.java | 123 + .../lang/model/element/ElementVisitor.java | 135 + .../lang/model/element/ExecutableElement.java | 100 + .../javax/lang/model/element/Modifier.java | 76 + .../javax/lang/model/element/Name.java | 89 + .../javax/lang/model/element/NestingKind.java | 99 + .../lang/model/element/PackageElement.java | 61 + .../javax/lang/model/element/TypeElement.java | 119 + .../model/element/TypeParameterElement.java | 65 + .../UnknownAnnotationValueException.java | 85 + .../element/UnknownElementException.java | 83 + .../lang/model/element/VariableElement.java | 67 + .../lang/model/element/package-info.java | 86 + .../classes/javax/lang/model/overview.html | 38 + .../javax/lang/model/package-info.java | 60 + .../javax/lang/model/type/ArrayType.java | 47 + .../javax/lang/model/type/DeclaredType.java | 97 + .../javax/lang/model/type/ErrorType.java | 46 + .../javax/lang/model/type/ExecutableType.java | 89 + .../model/type/MirroredTypeException.java | 70 + .../model/type/MirroredTypesException.java | 75 + .../classes/javax/lang/model/type/NoType.java | 50 + .../javax/lang/model/type/NullType.java | 40 + .../javax/lang/model/type/PrimitiveType.java | 40 + .../javax/lang/model/type/ReferenceType.java | 40 + .../javax/lang/model/type/TypeKind.java | 163 + .../javax/lang/model/type/TypeMirror.java | 108 + .../javax/lang/model/type/TypeVariable.java | 84 + .../javax/lang/model/type/TypeVisitor.java | 165 + .../lang/model/type/UnknownTypeException.java | 83 + .../javax/lang/model/type/WildcardType.java | 65 + .../javax/lang/model/type/package-info.java | 41 + .../util/AbstractAnnotationValueVisitor6.java | 113 + .../model/util/AbstractElementVisitor6.java | 122 + .../lang/model/util/AbstractTypeVisitor6.java | 111 + .../javax/lang/model/util/ElementFilter.java | 214 + .../lang/model/util/ElementKindVisitor6.java | 384 ++ .../lang/model/util/ElementScanner6.java | 204 + .../javax/lang/model/util/Elements.java | 236 + .../util/SimpleAnnotationValueVisitor6.java | 260 + .../model/util/SimpleElementVisitor6.java | 169 + .../lang/model/util/SimpleTypeVisitor6.java | 209 + .../lang/model/util/TypeKindVisitor6.java | 300 ++ .../classes/javax/lang/model/util/Types.java | 301 ++ .../javax/lang/model/util/package-info.java | 43 + .../share/classes/javax/tools/Diagnostic.java | 170 + .../javax/tools/DiagnosticCollector.java | 58 + .../javax/tools/DiagnosticListener.java | 49 + .../share/classes/javax/tools/FileObject.java | 161 + .../javax/tools/ForwardingFileObject.java | 120 + .../tools/ForwardingJavaFileManager.java | 167 + .../javax/tools/ForwardingJavaFileObject.java | 65 + .../classes/javax/tools/JavaCompiler.java | 329 ++ .../classes/javax/tools/JavaFileManager.java | 402 ++ .../classes/javax/tools/JavaFileObject.java | 136 + .../classes/javax/tools/OptionChecker.java | 46 + .../javax/tools/SimpleJavaFileObject.java | 217 + .../javax/tools/StandardJavaFileManager.java | 240 + .../classes/javax/tools/StandardLocation.java | 104 + .../src/share/classes/javax/tools/Tool.java | 72 + .../classes/javax/tools/ToolProvider.java | 175 + .../share/classes/javax/tools/overview.html | 23 + .../classes/javax/tools/package-info.java | 78 + .../classes/sun/tools/javap/AttrData.java | 77 + .../share/classes/sun/tools/javap/CPX.java | 40 + .../share/classes/sun/tools/javap/CPX2.java | 41 + .../classes/sun/tools/javap/ClassData.java | 663 +++ .../classes/sun/tools/javap/Constants.java | 372 ++ .../classes/sun/tools/javap/FieldData.java | 163 + .../sun/tools/javap/InnerClassData.java | 75 + .../sun/tools/javap/JavapEnvironment.java | 355 ++ .../classes/sun/tools/javap/JavapPrinter.java | 910 ++++ .../classes/sun/tools/javap/LineNumData.java | 50 + .../classes/sun/tools/javap/LocVarData.java | 54 + .../share/classes/sun/tools/javap/Main.java | 216 + .../classes/sun/tools/javap/MethodData.java | 416 ++ .../sun/tools/javap/RuntimeConstants.java | 787 +++ .../classes/sun/tools/javap/StackMapData.java | 76 + .../sun/tools/javap/StackMapTableData.java | 168 + .../share/classes/sun/tools/javap/Tables.java | 377 ++ .../classes/sun/tools/javap/TrapData.java | 60 + .../sun/tools/javap/TypeSignature.java | 295 ++ langtools/src/share/opensource/javac/Makefile | 275 ++ .../opensource/javac/README-template.html | 330 ++ .../share/opensource/javac/build.properties | 13 + .../src/share/opensource/javac/build.xml | 163 + .../share/opensource/javac/doc/document.css | 59 + .../javac/doc/javac_lifecycle/Context.html | 107 + .../javac/doc/javac_lifecycle/Enter.html | 90 + .../doc/javac_lifecycle/JavaCompiler.html | 79 + .../javac/doc/javac_lifecycle/Main.html | 69 + .../javac/doc/javac_lifecycle/ToDo.html | 167 + .../javac/doc/javac_lifecycle/contents.html | 43 + .../javac/doc/javac_lifecycle/index.html | 40 + .../javac/doc/javac_lifecycle/packages.html | 91 + .../javac/doc/javac_lifecycle/style.css | 33 + .../opensource/javac/nbproject/project.xml | 88 + .../share/opensource/javac/src/bin/javac.sh | 30 + .../processing/src/CheckNamesProcessor.java | 523 ++ langtools/test/Makefile | 129 + langtools/test/TEST.ROOT | 6 + langtools/test/bootclasspath-exclude.jtx | 7 + .../AccessAsciiArt/AccessAsciiArt.java | 169 + .../com/sun/javadoc/AccessAsciiArt/p1/C.java | 27 + .../com/sun/javadoc/AccessAsciiArt/p1/I.java | 27 + .../com/sun/javadoc/AccessAsciiArt/p1/SC.java | 27 + .../com/sun/javadoc/AccessAsciiArt/p1/SI.java | 27 + .../javadoc/AccessAsciiArt/p1/subpkg/SSC.java | 27 + .../AccessFrameTitle/AccessFrameTitle.java | 168 + .../sun/javadoc/AccessFrameTitle/p1/C1.java | 27 + .../sun/javadoc/AccessFrameTitle/p2/C2.java | 27 + .../com/sun/javadoc/AccessH1/AccessH1.java | 166 + .../test/com/sun/javadoc/AccessH1/p1/C.java | 27 + .../test/com/sun/javadoc/AccessH1/p2/C2.java | 27 + .../javadoc/AccessSkipNav/AccessSkipNav.java | 171 + .../com/sun/javadoc/AccessSkipNav/p1/C1.java | 27 + .../com/sun/javadoc/AccessSkipNav/p2/C2.java | 27 + .../javadoc/AccessSummary/AccessSummary.java | 87 + .../com/sun/javadoc/AccessSummary/p1/C1.java | 30 + .../com/sun/javadoc/AccessSummary/p2/C2.java | 27 + .../com/sun/javadoc/AuthorDD/AuthorDD.java | 165 + .../test/com/sun/javadoc/AuthorDD/p1/C1.java | 42 + .../javadoc/DocRootSlash/DocRootSlash.java | 248 + .../sun/javadoc/DocRootSlash/overview.html | 72 + .../com/sun/javadoc/DocRootSlash/p1/C1.java | 85 + .../sun/javadoc/DocRootSlash/p1/package.html | 73 + .../com/sun/javadoc/DocRootSlash/p2/C2.java | 30 + .../sun/javadoc/DocRootSlash/p2/package.html | 9 + .../JavascriptWinTitle.java | 203 + .../javadoc/JavascriptWinTitle/overview.html | 15 + .../sun/javadoc/JavascriptWinTitle/p1/C.java | 27 + .../sun/javadoc/JavascriptWinTitle/p2/C2.java | 27 + .../javadoc/JavascriptWinTitle/package-list | 135 + .../test/com/sun/javadoc/MetaTag/MetaTag.java | 162 + .../test/com/sun/javadoc/MetaTag/p1/C1.java | 53 + .../test/com/sun/javadoc/MetaTag/p2/C2.java | 27 + .../PackagesHeader/PackagesHeader.java | 130 + .../com/sun/javadoc/PackagesHeader/p1/C1.java | 27 + .../com/sun/javadoc/PackagesHeader/p2/C2.java | 27 + .../com/sun/javadoc/ValidHtml/ValidHtml.java | 208 + .../com/sun/javadoc/ValidHtml/overview.html | 15 + .../test/com/sun/javadoc/ValidHtml/p1/C.java | 35 + .../test/com/sun/javadoc/ValidHtml/p2/C2.java | 27 + .../javadoc/VersionNumber/VersionNumber.java | 159 + .../com/sun/javadoc/VersionNumber/p1/C.java | 35 + .../javadoc/WindowTitles/WindowTitles.java | 221 + .../com/sun/javadoc/WindowTitles/p1/C1.java | 29 + .../com/sun/javadoc/WindowTitles/p2/C2.java | 27 + .../com/sun/javadoc/_template/Template.java | 74 + .../javadoc/_template/TemplateComplete.java | 83 + .../com/sun/javadoc/constantValues/A.java | 36 + .../constantValues/TestConstantValues.java | 37 + .../constantValues/TestConstantValues2.java | 37 + .../TestConstantValuesDriver.java | 82 + .../dupThrowsTags/TestDupThrowsTags.java | 78 + .../com/sun/javadoc/lib/JavadocTester.java | 525 ++ .../testAbsLinkPath/TestAbsLinkPath.java | 74 + .../sun/javadoc/testAbsLinkPath/pkg1/C1.java | 32 + .../sun/javadoc/testAbsLinkPath/pkg2/C2.java | 29 + .../TestAnnotationTypes.java | 77 + .../pkg/AnnotationType.java | 36 + .../sun/javadoc/testBackSlashInLink/C.java | 7 + .../TestBackSlashInLink.java | 70 + .../TestBadPackageFileInJar.java | 75 + .../badPackageFileInJar.jar | Bin 0 -> 488 bytes .../testBadPackageFileInJar/pkg/C.java | 26 + .../com/sun/javadoc/testBadSourceFile/C1.java | 34 + .../com/sun/javadoc/testBadSourceFile/C2.java | 27 + .../testBadSourceFile/TestBadSourceFile.java | 74 + .../com/sun/javadoc/testBaseClass/Bar.java | 30 + .../sun/javadoc/testBaseClass/BaseClass.java | 53 + .../javadoc/testBaseClass/TestBaseClass.java | 71 + .../sun/javadoc/testBaseClass/baz/Foo.java | 26 + .../testBreakIterator/TestBreakIterator.java | 73 + .../pkg/BreakIteratorTest.java | 30 + .../TestCRLineSeparator.java | 75 + .../testCRLineSeparator/pkg/MyClass.java | 24 + .../javadoc/testClassCrossReferences/C.java | 35 + .../TestClassCrossReferences.java | 83 + .../testClassCrossReferences/package-list | 2 + .../javadoc/testClassTree/TestClassTree.java | 102 + .../testClassTree/pkg/AnnotationType.java | 45 + .../javadoc/testClassTree/pkg/ChildClass.java | 26 + .../sun/javadoc/testClassTree/pkg/Coin.java | 37 + .../testClassTree/pkg/ParentClass.java | 26 + .../com/sun/javadoc/testCmndLineClass/C5.java | 33 + .../testCmndLineClass/TestCmndLineClass.java | 91 + .../javadoc/testCmndLineClass/pkg1/C1.java | 34 + .../javadoc/testCmndLineClass/pkg1/C2.java | 34 + .../testCmndLineClass/pkg1/package.html | 7 + .../javadoc/testCmndLineClass/pkg2/C3.java | 34 + .../javadoc/testCmndLineClass/pkg2/C4.java | 34 + .../testCmndLineClass/pkg2/package.html | 7 + .../TestConstantValuesPage.java | 70 + .../sun/javadoc/testConstructorIndent/C.java | 32 + .../TestConstructorIndent.java | 78 + .../TestDeprecatedDocs.java | 125 + .../pkg/DeprecatedClassByAnnotation.java | 37 + .../pkg/TestAnnotationType.java | 42 + .../testDeprecatedDocs/pkg/TestClass.java | 45 + .../testDeprecatedDocs/pkg/TestEnum.java | 35 + .../testDeprecatedDocs/pkg/TestError.java | 45 + .../testDeprecatedDocs/pkg/TestException.java | 45 + .../testDeprecatedDocs/pkg/TestInterface.java | 45 + .../TestDocErrorReporter.java | 78 + .../testDocFileDir/TestDocFileDir.java | 124 + .../com/sun/javadoc/testDocFileDir/pkg/C.java | 30 + .../doc-files/subdir-excluded1/testfile.txt | 2 + .../doc-files/subdir-excluded2/testfile.txt | 2 + .../pkg/doc-files/subdir-used1/testfile.txt | 2 + .../pkg/doc-files/subdir-used2/testfile.txt | 2 + .../testDocFileDir/pkg/doc-files/testfile.txt | 2 + .../TestDocRootInlineTag.java | 85 + .../testDocRootInlineTag/TestDocRootTag.java | 29 + .../javadoc/testDocRootInlineTag/package-list | 1 + .../javadoc/testDocRootInlineTag/pkg/C.java | 30 + .../testDupParamWarn/TestDupParamWarn.java | 67 + .../sun/javadoc/testDupParamWarn/pkg/Bar.java | 34 + .../sun/javadoc/testDupParamWarn/pkg/Foo.java | 34 + .../testEmptyClass/TestEmptyClass.java | 82 + .../sun/javadoc/testEmptyClass/src/Empty.java | 26 + .../TestEnclosingClass.java | 74 + .../testEnclosingClass/pkg/MyClass.java | 28 + .../sun/javadoc/testEncoding/EncodeTest.java | 29 + .../javadoc/testEncoding/TestEncoding.java | 74 + .../TestExternalOverridenMethod.java | 88 + .../testExternalOverridenMethod/package-list | 1 + .../pkg/XReader.java | 43 + .../testGroupOption/TestGroupOption.java | 94 + .../sun/javadoc/testGroupOption/pkg1/C.java | 26 + .../sun/javadoc/testGroupOption/pkg2/C.java | 26 + .../sun/javadoc/testGroupOption/pkg3/C.java | 26 + .../javadoc/testHeadings/TestHeadings.java | 147 + .../com/sun/javadoc/testHeadings/pkg1/C1.java | 46 + .../com/sun/javadoc/testHeadings/pkg2/C2.java | 41 + .../testHelpOption/TestHelpOption.java | 127 + .../testHiddenMembers/TestHiddenMembers.java | 76 + .../testHiddenMembers/pkg/BaseClass.java | 34 + .../testHiddenMembers/pkg/SubClass.java | 34 + .../com/sun/javadoc/testHref/TestHref.java | 111 + .../com/sun/javadoc/testHref/package-list | 1 + .../test/com/sun/javadoc/testHref/pkg/C1.java | 36 + .../test/com/sun/javadoc/testHref/pkg/C2.java | 32 + .../test/com/sun/javadoc/testHref/pkg/C3.java | 29 + .../test/com/sun/javadoc/testHref/pkg/C4.java | 28 + .../TestHrefInDocComment.java | 70 + .../javadoc/testHrefInDocComment/pkg/I1.java | 30 + .../javadoc/testHrefInDocComment/pkg/I2.java | 31 + .../com/sun/javadoc/testHtmlComments/C.java | 24 + .../testHtmlComments/TestHtmlComments.java | 76 + .../com/sun/javadoc/testIndex/NoPackage.java | 24 + .../com/sun/javadoc/testIndex/TestIndex.java | 106 + .../javadoc/testIndex/pkg/AnnotationType.java | 45 + .../test/com/sun/javadoc/testIndex/pkg/C.java | 34 + .../com/sun/javadoc/testIndex/pkg/Coin.java | 37 + .../sun/javadoc/testIndex/pkg/Interface.java | 26 + .../TestInlineLinkLabel.java | 73 + .../javadoc/testInlineLinkLabel/pkg/C1.java | 30 + .../javadoc/testInlineLinkLabel/pkg/C2.java | 29 + .../testInlineLinkLabel/pkg/package.html | 5 + .../javadoc/testInterface/TestInterface.java | 119 + .../sun/javadoc/testInterface/pkg/Child.java | 32 + .../javadoc/testInterface/pkg/Interface.java | 42 + .../sun/javadoc/testInterface/pkg/Parent.java | 32 + .../testJavascript/TestJavascript.java | 96 + .../com/sun/javadoc/testJavascript/pkg/C.java | 26 + .../testLeadingSpaces/LeadingSpaces.java | 96 + .../com/sun/javadoc/testLegacyTaglet/C.java | 29 + .../testLegacyTaglet/TestLegacyTaglet.java | 78 + .../javadoc/testLegacyTaglet/ToDoTaglet.java | 177 + .../testLegacyTaglet/UnderlineTaglet.java | 136 + .../testLinkOption/TestBadLinkOption.java | 75 + .../testLinkOption/TestLinkOption.java | 111 + .../testLinkOption/TestNewLineInLink.java | 73 + .../java/lang/StringBuilderChild.java | 30 + .../sun/javadoc/testLinkOption/package-list | 135 + .../com/sun/javadoc/testLinkOption/pkg/C.java | 39 + .../sun/javadoc/testLinkOption/pkg2/C2.java | 30 + .../testLinkOption/testNewLineInLink/C.java | 26 + .../testNewLineInLink/package.html | 6 + .../testLinkTaglet/TestLinkTaglet.java | 92 + .../javadoc/testLinkTaglet/checkPkg/A.java | 32 + .../javadoc/testLinkTaglet/checkPkg/B.java | 36 + .../com/sun/javadoc/testLinkTaglet/pkg/C.java | 55 + .../TestLinkToSerialForm.java | 71 + .../javadoc/testLinkToSerialForm/pkg/C.java | 26 + .../TestMemberInheritence.java | 116 + .../testMemberInheritence/diamond/A.java | 32 + .../testMemberInheritence/diamond/B.java | 31 + .../testMemberInheritence/diamond/C.java | 31 + .../testMemberInheritence/diamond/X.java | 31 + .../testMemberInheritence/diamond/Z.java | 31 + .../testMemberInheritence/inheritDist/A.java | 32 + .../testMemberInheritence/inheritDist/B.java | 31 + .../testMemberInheritence/inheritDist/C.java | 28 + .../testMemberInheritence/pkg/BaseClass.java | 47 + .../pkg/BaseInterface.java | 33 + .../testMemberInheritence/pkg/SubClass.java | 35 + .../testMemberSummary/TestMemberSummary.java | 93 + .../testMemberSummary/pkg/PrivateParent.java | 35 + .../testMemberSummary/pkg/PublicChild.java | 31 + .../sun/javadoc/testMemberSummary/pkg2/A.java | 29 + .../sun/javadoc/testModifier/Interface.java | 26 + .../testModifier/ModifierAbstract.java | 57 + .../com/sun/javadoc/testModifier/Test.java | 81 + .../javadoc/testModifier/TestModifier.java | 71 + .../testNavagation/TestNavagation.java | 92 + .../com/sun/javadoc/testNavagation/pkg/A.java | 29 + .../com/sun/javadoc/testNavagation/pkg/C.java | 29 + .../com/sun/javadoc/testNavagation/pkg/E.java | 29 + .../com/sun/javadoc/testNavagation/pkg/I.java | 29 + .../TestNestedInlineTag.java | 112 + .../testtaglets/BoldTaglet.java | 65 + .../testtaglets/GreenTaglet.java | 67 + .../testtaglets/UnderlineTaglet.java | 68 + .../TestNewLanguageFeatures.java | 583 +++ .../pkg/AnnotationType.java | 45 + .../pkg/AnnotationTypeUndocumented.java | 46 + .../pkg/AnnotationTypeUsage.java | 54 + .../testNewLanguageFeatures/pkg/Coin.java | 49 + .../pkg/MultiTypeParameters.java | 34 + .../pkg/SubInterface.java | 26 + .../pkg/SuperInterface.java | 26 + .../pkg/TypeParameterSubClass.java | 26 + .../pkg/TypeParameterSuperClass.java | 26 + .../pkg/TypeParameters.java | 70 + .../testNewLanguageFeatures/pkg/VarArgs.java | 52 + .../pkg/Wildcards.java | 40 + .../pkg/package-info.java | 25 + .../testNewLanguageFeatures/pkg1/A.java | 43 + .../testNewLanguageFeatures/pkg1/B.java | 42 + .../pkg2/ClassUseTest1.java | 34 + .../pkg2/ClassUseTest2.java | 34 + .../pkg2/ClassUseTest3.java | 38 + .../testNewLanguageFeatures/pkg2/Foo.java | 32 + .../testNewLanguageFeatures/pkg2/Foo2.java | 26 + .../testNewLanguageFeatures/pkg2/Foo3.java | 26 + .../testNewLanguageFeatures/pkg2/Foo4.java | 26 + .../pkg2/ParamTest.java | 27 + .../pkg2/ParamTest2.java | 27 + .../com/sun/javadoc/testNoPackagesFile/C.java | 24 + .../TestNoPackagesFile.java | 74 + .../testNotifications/TestNotifications.java | 92 + .../sun/javadoc/testNotifications/pkg/C.java | 26 + .../TestMultiInheritence.java | 95 + .../TestOverridenMethodDocCopy.java | 79 + .../TestOverridenPrivateMethods.java | 98 + ...verridenPrivateMethodsWithPackageFlag.java | 98 + ...verridenPrivateMethodsWithPrivateFlag.java | 100 + .../testOverridenMethods/pkg1/BaseClass.java | 53 + .../testOverridenMethods/pkg1/SubClass.java | 51 + .../testOverridenMethods/pkg2/SubClass.java | 52 + .../javadoc/testOverridenMethods/pkg3/I0.java | 26 + .../javadoc/testOverridenMethods/pkg3/I1.java | 26 + .../javadoc/testOverridenMethods/pkg3/I2.java | 30 + .../javadoc/testOverridenMethods/pkg3/I3.java | 30 + .../javadoc/testOverridenMethods/pkg3/I4.java | 30 + .../testPackagePage/TestPackagePage.java | 115 + .../javadoc/testPackagePage/com/pkg/C.java | 26 + .../testPackagePage/com/pkg/package.html | 5 + .../sun/javadoc/testPackagePage/pkg2/C.java | 29 + .../testParamTaglet/TestParamTaglet.java | 93 + .../sun/javadoc/testParamTaglet/pkg/C.java | 41 + .../javadoc/testParamTaglet/pkg/Parent.java | 32 + .../TestPrivateClasses.java | 256 + .../pkg/PrivateInterface.java | 51 + .../testPrivateClasses/pkg/PrivateParent.java | 56 + .../testPrivateClasses/pkg/PublicChild.java | 48 + .../pkg/PublicInterface.java | 29 + .../javadoc/testPrivateClasses/pkg2/C.java | 28 + .../javadoc/testPrivateClasses/pkg2/I.java | 31 + .../TestRecurseSubPackages.java | 75 + .../testRecurseSubPackages/pkg1/C1.java | 26 + .../testRecurseSubPackages/pkg1/C2.java | 26 + .../testRecurseSubPackages/pkg1/pkg2/C3.java | 26 + .../testRecurseSubPackages/pkg1/pkg2/C4.java | 26 + .../pkg2/packageToExclude/DummyClass.java | 26 + .../pkg1/pkg2/pkg3/C5.java | 26 + .../pkg1/pkg2/pkg3/C6.java | 26 + .../testRelativeLinks/TestRelativeLinks.java | 129 + .../sun/javadoc/testRelativeLinks/pkg/C.java | 51 + .../testRelativeLinks/pkg/package.html | 6 + .../javadoc/testRelativeLinks/pkg2/Foo.java | 29 + .../javadoc/testReturnTag/TestReturnTag.java | 82 + .../sun/javadoc/testSerialVersionUID/C.java | 27 + .../TestSerialVersionUID.java | 77 + .../TestSerializedForm.java | 127 + .../test/com/sun/javadoc/testSimpleTag/C.java | 31 + .../javadoc/testSimpleTag/TestSimpleTag.java | 86 + .../testSimpleTagExclude/DummyClass.java | 28 + .../TestSimpleTagExclude.java | 73 + .../javadoc/testSourceTab/DoubleTab/C.java | 37 + .../javadoc/testSourceTab/SingleTab/C.java | 37 + .../javadoc/testSourceTab/TestSourceTab.java | 95 + .../testStylesheet/TestStylesheet.java | 100 + .../com/sun/javadoc/testStylesheet/pkg/A.java | 26 + .../com/sun/javadoc/testSummaryHeading/C.java | 24 + .../TestSummaryHeading.java | 76 + .../TestSuperClassInSerialForm.java | 73 + .../pkg/SubClass.java | 26 + .../pkg/SuperClass.java | 26 + .../com/sun/javadoc/testSupplementary/C.java | 45 + .../testSupplementary/TestSupplementary.java | 77 + .../TestTagHolderMethod.java | 93 + .../javadoc/testTagHolderMethod/pkg/C.java | 52 + .../TestTagInheritence.java | 87 + .../testTagInheritence/firstSentence/A.java | 31 + .../testTagInheritence/firstSentence/B.java | 31 + .../testTagInheritence/firstSentence2/A.java | 31 + .../testTagInheritence/firstSentence2/B.java | 33 + .../testTagInheritence/firstSentence2/C.java | 33 + .../pkg/TestAbstractClass.java | 74 + .../testTagInheritence/pkg/TestInterface.java | 58 + .../pkg/TestInterfaceForAbstractClass.java | 31 + .../pkg/TestSuperSuperClass.java | 52 + .../pkg/TestSuperSuperInterface.java | 32 + .../pkg/TestTagInheritence.java | 110 + .../javadoc/testTagMisuse/TestTagMisuse.java | 86 + .../test/com/sun/javadoc/testTaglets/C.java | 30 + .../com/sun/javadoc/testTaglets/Child.java | 30 + .../com/sun/javadoc/testTaglets/Parent.java | 30 + .../sun/javadoc/testTaglets/TestTaglets.java | 95 + .../sun/javadoc/testTaglets/taglets/Foo.java | 59 + .../com/sun/javadoc/testThrowsHead/C.java | 26 + .../testThrowsHead/TestThrowsHead.java | 71 + .../sun/javadoc/testThrowsInheritence/C.java | 32 + .../javadoc/testThrowsInheritence/Foo.java | 34 + .../sun/javadoc/testThrowsInheritence/I.java | 31 + .../javadoc/testThrowsInheritence/Iface.java | 34 + .../TestThrowsTagInheritence.java | 78 + .../javadoc/testThrowsTag/TestThrowsTag.java | 84 + .../com/sun/javadoc/testThrowsTag/pkg/C.java | 36 + .../com/sun/javadoc/testThrowsTag/pkg/P.java | 36 + .../com/sun/javadoc/testThrowsTag/pkg/T1.java | 26 + .../com/sun/javadoc/testThrowsTag/pkg/T2.java | 26 + .../com/sun/javadoc/testThrowsTag/pkg/T3.java | 26 + .../com/sun/javadoc/testThrowsTag/pkg/T4.java | 26 + .../com/sun/javadoc/testThrowsTag/pkg/T5.java | 28 + .../com/sun/javadoc/testThrowsTag/pkg/T6.java | 28 + .../com/sun/javadoc/testThrowsTag/pkg/T7.java | 28 + .../com/sun/javadoc/testThrowsTag/pkg/T8.java | 28 + .../testTitleInHref/TestTitleInHref.java | 81 + .../sun/javadoc/testTitleInHref/package-list | 1 + .../javadoc/testTitleInHref/pkg/Class.java | 26 + .../testTitleInHref/pkg/Interface.java | 26 + .../javadoc/testTitleInHref/pkg/Links.java | 32 + .../javadoc/testTopOption/TestTopOption.java | 97 + .../sun/javadoc/testTopOption/overview.html | 5 + .../testTopOption/pkg/AnnotationType.java | 29 + .../com/sun/javadoc/testTopOption/pkg/Cl.java | 28 + .../testTypeParams/TestTypeParameters.java | 90 + .../com/sun/javadoc/testTypeParams/pkg/C.java | 43 + .../javadoc/testTypeParams/pkg/Parent.java | 26 + .../javadoc/testUnnamedPackage/BadSource.java | 24 + .../com/sun/javadoc/testUnnamedPackage/C.java | 27 + .../TestUnnamedPackage.java | 92 + .../javadoc/testUnnamedPackage/package.html | 5 + .../javadoc/testUseOption/TestUseOption.java | 111 + .../sun/javadoc/testUseOption/pkg1/C1.java | 43 + .../sun/javadoc/testUseOption/pkg1/C2.java | 56 + .../sun/javadoc/testUseOption/pkg1/C4.java | 40 + .../sun/javadoc/testUseOption/pkg1/C5.java | 40 + .../sun/javadoc/testUseOption/pkg1/C6.java | 40 + .../sun/javadoc/testUseOption/pkg1/C7.java | 40 + .../sun/javadoc/testUseOption/pkg1/C8.java | 40 + .../javadoc/testUseOption/pkg1/UsedClass.java | 28 + .../javadoc/testUseOption/pkg1/package.html | 5 + .../sun/javadoc/testUseOption/pkg2/C3.java | 46 + .../javadoc/testUseOption/pkg2/package.html | 5 + .../javadoc/testValueTag/TestValueTag.java | 127 + .../sun/javadoc/testValueTag/pkg1/Class1.java | 66 + .../sun/javadoc/testValueTag/pkg1/Class2.java | 65 + .../testValueTag/pkg1/CustomTagUsage.java | 43 + .../sun/javadoc/testValueTag/pkg2/Class3.java | 34 + .../javadoc/testValueTag/pkg2/package.html | 5 + .../sun/javadoc/testWarnBadParamNames/C.java | 33 + .../TestWarnBadParamNames.java | 72 + .../javadoc/testWarnings/TestWarnings.java | 100 + .../com/sun/javadoc/testWarnings/pkg/X.java | 29 + .../sun/javadoc/testWarnings/pkg/package.html | 3 + langtools/test/jprt.config | 159 + langtools/test/req.flg | 1 + .../test/tools/apt/Basics/Aggregate.java | 42 + .../tools/apt/Basics/ClassAnnotations.java | 47 + .../test/tools/apt/Basics/FreshnessApf.java | 90 + langtools/test/tools/apt/Basics/GenClass.java | 30 + langtools/test/tools/apt/Basics/Indirect.java | 31 + langtools/test/tools/apt/Basics/Lacuna.java | 25 + .../tools/apt/Basics/MethodAnnotations.java | 47 + langtools/test/tools/apt/Basics/Milk.java | 34 + langtools/test/tools/apt/Basics/MisMatch.java | 67 + langtools/test/tools/apt/Basics/Misc.java | 49 + langtools/test/tools/apt/Basics/MyMarker.java | 27 + langtools/test/tools/apt/Basics/MySimple.java | 28 + .../apt/Basics/NestedClassAnnotations.java | 50 + langtools/test/tools/apt/Basics/NullAPF.java | 72 + .../apt/Basics/ParameterAnnotations.java | 47 + .../apt/Basics/StaticFieldAnnotations.java | 47 + .../apt/Basics/StaticMethodAnnotations.java | 50 + .../tools/apt/Basics/TestGetPackageApf.java | 118 + .../apt/Basics/TestGetTypeDeclarationApf.java | 140 + .../tools/apt/Basics/annot/AnnotMarker.java | 28 + .../apt/Basics/annot/AnnotShangri_la.java | 34 + .../tools/apt/Basics/annot/AnnotSimple.java | 29 + .../apt/Basics/annot/annot2/AnnotMarker2.java | 28 + .../apt/Basics/annot/annot2/AnnotSimple2.java | 29 + langtools/test/tools/apt/Basics/apt.sh | 176 + ....sun.mirror.apt.AnnotationProcessorFactory | 1 + .../test/tools/apt/Basics/foo/bar/Baz.java | 33 + .../test/tools/apt/Basics/foo/bar/Quux.java | 33 + langtools/test/tools/apt/Basics/golden.txt | 1 + .../test/tools/apt/Basics/goldenAggregate.txt | 14 + langtools/test/tools/apt/Basics/p1/p2.java | 29 + langtools/test/tools/apt/Basics/p1/p2/C1.java | 28 + langtools/test/tools/apt/Basics/print.sh | 98 + .../test/tools/apt/Compile/ClassDeclApf.java | 120 + .../test/tools/apt/Compile/ClassDeclApf2.java | 123 + langtools/test/tools/apt/Compile/Dummy1.java | 25 + .../test/tools/apt/Compile/ErrorAPF.java | 82 + .../tools/apt/Compile/HelloAnnotation.java | 8 + .../test/tools/apt/Compile/HelloWorld.java | 6 + .../test/tools/apt/Compile/Round1Apf.java | 121 + .../test/tools/apt/Compile/Round2Apf.java | 126 + .../test/tools/apt/Compile/Round3Apf.java | 85 + .../test/tools/apt/Compile/Round4Apf.java | 98 + langtools/test/tools/apt/Compile/Rounds.java | 33 + .../test/tools/apt/Compile/StaticApf.java | 104 + langtools/test/tools/apt/Compile/WarnAPF.java | 101 + .../tools/apt/Compile/WrappedStaticApf.java | 36 + langtools/test/tools/apt/Compile/compile.sh | 525 ++ langtools/test/tools/apt/Compile/golden.txt | 6 + .../test/tools/apt/Compile/goldenFactory.txt | 29 + .../test/tools/apt/Compile/goldenWarn.txt | 14 + .../test/tools/apt/Compile/servicesRound1 | 1 + .../test/tools/apt/Compile/servicesRound2 | 1 + .../test/tools/apt/Compile/servicesRound3 | 1 + .../test/tools/apt/Compile/servicesRound4 | 1 + .../test/tools/apt/Compile/servicesStaticApf | 1 + .../tools/apt/Compile/src/AhOneClass.java | 25 + .../tools/apt/Compile/src/AndAhTwoClass.java | 25 + .../tools/apt/Compile/src/Round1Class.java | 25 + langtools/test/tools/apt/Discovery/Dee.java | 72 + langtools/test/tools/apt/Discovery/Dum.java | 72 + langtools/test/tools/apt/Discovery/Empty.java | 26 + .../tools/apt/Discovery/PhantomTouch.java | 93 + .../tools/apt/Discovery/PhantomUpdate.java | 84 + langtools/test/tools/apt/Discovery/Touch.java | 116 + .../test/tools/apt/Discovery/discovery.sh | 409 ++ .../test/tools/apt/Discovery/servicesBadTouch | 1 + .../tools/apt/Discovery/servicesPhantomTouch | 1 + .../test/tools/apt/Discovery/servicesTouch | 1 + .../test/tools/apt/Discovery/servicesTweedle | 2 + langtools/test/tools/apt/Misc/Marked.java | 51 + langtools/test/tools/apt/Misc/Marker.java | 25 + langtools/test/tools/apt/Misc/Misc.java | 84 + langtools/test/tools/apt/Misc/misc.sh | 100 + langtools/test/tools/apt/Misc/servicesMisc | 2 + langtools/test/tools/apt/Options/Marked.java | 27 + langtools/test/tools/apt/Options/Marker.java | 25 + .../test/tools/apt/Options/OptionChecker.java | 117 + langtools/test/tools/apt/Options/options.sh | 116 + .../test/tools/apt/Options/servicesOptions | 1 + .../test/tools/apt/Scanners/Counter.java | 108 + .../tools/apt/Scanners/MemberOrderApf.java | 86 + langtools/test/tools/apt/Scanners/Order.java | 54 + .../test/tools/apt/Scanners/Scanner.java | 123 + .../test/tools/apt/Scanners/TestEnum.java | 31 + .../test/tools/apt/Scanners/VisitOrder.java | 32 + langtools/test/tools/apt/Scanners/scanner.sh | 146 + .../test/tools/apt/Scanners/servicesScanner | 1 + langtools/test/tools/apt/lib/Ignore.java | 41 + langtools/test/tools/apt/lib/Test.java | 49 + .../test/tools/apt/lib/TestProcessor.java | 132 + .../tools/apt/lib/TestProcessorFactory.java | 80 + langtools/test/tools/apt/lib/Tester.java | 160 + .../apt/mirror/declaration/AnnoMirror.java | 124 + .../apt/mirror/declaration/AnnoTypeDecl.java | 93 + .../mirror/declaration/AnnoTypeElemDecl.java | 194 + .../tools/apt/mirror/declaration/AnnoVal.java | 200 + .../apt/mirror/declaration/ClassDecl.java | 250 + .../apt/mirror/declaration/ConstExpr.java | 116 + .../mirror/declaration/ConstructorDecl.java | 199 + .../apt/mirror/declaration/EnumDecl.java | 127 + .../apt/mirror/declaration/FieldDecl.java | 161 + .../tools/apt/mirror/declaration/GetAnno.java | 167 + .../apt/mirror/declaration/InterfaceDecl.java | 243 + .../apt/mirror/declaration/MethodDecl.java | 244 + .../apt/mirror/declaration/PackageDecl.java | 167 + .../apt/mirror/declaration/ParameterDecl.java | 136 + .../apt/mirror/declaration/pkg1/AClass.java | 28 + .../mirror/declaration/pkg1/AnAnnoType.java | 29 + .../apt/mirror/declaration/pkg1/AnEnum.java | 28 + .../mirror/declaration/pkg1/AnInterface.java | 29 + .../mirror/declaration/pkg1/package-info.java | 30 + .../declaration/pkg1/pkg2/AnInterface.java | 27 + .../mirror/declaration/pkg1/pkg2/package.html | 37 + .../test/tools/apt/mirror/type/AnnoTyp.java | 92 + .../test/tools/apt/mirror/type/ArrayTyp.java | 105 + .../test/tools/apt/mirror/type/ClassTyp.java | 239 + .../test/tools/apt/mirror/type/EnumTyp.java | 98 + .../tools/apt/mirror/type/InterfaceTyp.java | 201 + .../tools/apt/mirror/type/PrimitiveTyp.java | 92 + .../test/tools/apt/mirror/type/TypeVar.java | 100 + .../tools/apt/mirror/type/WildcardTyp.java | 170 + .../test/tools/apt/mirror/util/Overrides.java | 151 + .../tools/apt/mirror/util/TypeCreation.java | 120 + langtools/test/tools/apt/verifyVariables.sh | 45 + langtools/test/tools/javac/4846262/Test.java | 6 + langtools/test/tools/javac/4846262/Test.out | 7 + langtools/test/tools/javac/4846262/Test.sh | 80 + .../test/tools/javac/4980495/static/Test.java | 17 + .../test/tools/javac/4980495/static/Test.out | 2 + .../tools/javac/4980495/static/p1/A1.java | 28 + .../tools/javac/4980495/static/p2/A2.java | 28 + .../test/tools/javac/4980495/std/Test.java | 18 + .../test/tools/javac/4980495/std/Test.out | 2 + .../test/tools/javac/4980495/std/p1/A1.java | 28 + .../test/tools/javac/4980495/std/p2/A2.java | 28 + langtools/test/tools/javac/5005368.java | 44 + langtools/test/tools/javac/5045412/Bar.java | 13 + langtools/test/tools/javac/5045412/Foo.java | 36 + langtools/test/tools/javac/5045412/out | 2 + langtools/test/tools/javac/6199662/Tree.java | 62 + .../test/tools/javac/6199662/TreeInfo.java | 38 + .../test/tools/javac/6199662/TreeScanner.java | 35 + .../test/tools/javac/6257443/T6257443.java | 72 + .../tools/javac/6257443/package-info.java | 25 + .../test/tools/javac/6302184/T6302184.java | 30 + .../test/tools/javac/6302184/T6302184.out | 8 + .../test/tools/javac/6302184/T6302184.sh | 71 + .../test/tools/javac/6304921/T6304921.java | 42 + .../test/tools/javac/6304921/T6304921.out | 21 + .../test/tools/javac/6304921/TestLog.java | 140 + .../test/tools/javac/6330920/T6330920.java | 12 + .../test/tools/javac/6330920/T6330920.out | 2 + langtools/test/tools/javac/6330997/T1.java | 25 + langtools/test/tools/javac/6330997/T2.java | 25 + .../test/tools/javac/6330997/T6330997.java | 86 + langtools/test/tools/javac/6341866/A.java | 26 + langtools/test/tools/javac/6341866/Anno.java | 38 + langtools/test/tools/javac/6341866/B.java | 24 + .../test/tools/javac/6341866/T6341866.java | 200 + .../test/tools/javac/6342411/T6342411.java | 41 + .../test/tools/javac/6342411/a/Base.java | 30 + langtools/test/tools/javac/6342411/a/Pub.java | 26 + langtools/test/tools/javac/6394683/A.java | 26 + langtools/test/tools/javac/6394683/B.java | 24 + .../test/tools/javac/6394683/T6394683.java | 144 + .../test/tools/javac/6400383/T6400383.java | 81 + langtools/test/tools/javac/6400872/A.java | 28 + langtools/test/tools/javac/6400872/B.java | 28 + langtools/test/tools/javac/6400872/C.java | 29 + .../test/tools/javac/6400872/T6400872.java | 152 + langtools/test/tools/javac/6402516/A.java | 29 + .../test/tools/javac/6402516/CheckClass.java | 61 + .../javac/6402516/CheckIsAccessible.java | 104 + .../javac/6402516/CheckLocalElements.java | 111 + .../test/tools/javac/6402516/CheckMethod.java | 61 + .../test/tools/javac/6402516/Checker.java | 169 + .../test/tools/javac/6402516/TestClass.java | 57 + .../tools/javac/6402516/TestIsAccessible.java | 54 + .../javac/6402516/TestLocalElements.java | 55 + .../test/tools/javac/6402516/TestMethod.java | 56 + langtools/test/tools/javac/6403424/A.java | 24 + langtools/test/tools/javac/6403424/B.java | 24 + .../test/tools/javac/6403424/T6403424.java | 64 + .../test/tools/javac/6410653/T6410653.java | 56 + langtools/test/tools/javac/6440583/A.java | 28 + .../test/tools/javac/6440583/T6440583.java | 70 + .../test/tools/javac/6457284/T6457284.java | 80 + .../test/tools/javac/6464451/BigFinally.java | 245 + .../javac/6464451/DeepNestedFinally.java | 76 + .../tools/javac/6464451/ManyExitsInTry.java | 2051 ++++++++ .../test/tools/javac/6491592/T6491592.java | 14 + .../test/tools/javac/6491592/T6491592.out | 2 + langtools/test/tools/javac/6520152/T.java | 15 + .../test/tools/javac/6520152/T6520152.java | 19 + langtools/test/tools/javac/6547131/T.java | 21 + .../test/tools/javac/6547131/p/Outer$I.class | Bin 0 -> 145 bytes .../test/tools/javac/6547131/p/Outer$I.jasm | 10 + .../test/tools/javac/6547131/p/Outer.class | Bin 0 -> 206 bytes .../test/tools/javac/6547131/p/Outer.jasm | 18 + .../test/tools/javac/6589361/T6589361.java | 46 + .../test/tools/javac/AbstractOverride.java | 48 + .../javac/AccessMethods/AccessMethodsLHS.java | 706 +++ .../AccessMethods/BitwiseAssignment.java | 67 + .../AccessMethods/ChainedAssignment.java | 91 + .../AccessMethods/ConstructorAccess.java | 124 + .../AccessMethods/InternalHandshake.java | 49 + .../javac/AccessMethods/LateAddition.java | 48 + .../UplevelPrivateConstants.java | 56 + .../test/tools/javac/AddReferenceThis.java | 40 + langtools/test/tools/javac/Ambig3.java | 50 + langtools/test/tools/javac/AnonClsInIntf.java | 41 + .../tools/javac/AnonInnerException_1.java | 62 + .../tools/javac/AnonInnerException_2.java | 58 + .../tools/javac/AnonInnerException_3.java | 46 + .../test/tools/javac/AnonStaticMember_1.java | 37 + .../test/tools/javac/AnonStaticMember_2.java | 37 + .../test/tools/javac/AnonStaticMember_3.java | 37 + .../javac/AnonymousConstructorExceptions.java | 60 + langtools/test/tools/javac/AnonymousNull.java | 48 + .../AnonymousProtect/AnonymousProtect.java | 37 + .../tools/javac/AnonymousProtect/P1/priv.java | 28 + .../tools/javac/AnonymousProtect/P1/pub.java | 27 + .../AnonymousProtect/P1/pubExposePriv.java | 30 + .../javac/AnonymousProtect/P2/usePub.java | 40 + langtools/test/tools/javac/AnonymousType.java | 44 + langtools/test/tools/javac/ArrayCast.java | 39 + .../test/tools/javac/ArrayCloneCodeGen.java | 43 + langtools/test/tools/javac/BadAnnotation.java | 35 + langtools/test/tools/javac/BadBreak.java | 43 + langtools/test/tools/javac/BadCovar.java | 45 + .../test/tools/javac/BadHexConstant.java | 36 + .../javac/BadOptimization/DeadCode1.java | 56 + .../javac/BadOptimization/DeadCode2.java | 66 + .../javac/BadOptimization/DeadCode3.java | 58 + .../javac/BadOptimization/DeadCode4.java | 67 + .../javac/BadOptimization/DeadCode5.java | 54 + .../javac/BadOptimization/DeadCode6.java | 60 + .../tools/javac/BadOptimization/Switch1.java | 64 + .../tools/javac/BadOptimization/Switch2.java | 55 + langtools/test/tools/javac/BoolArray.java | 38 + .../test/tools/javac/BoundClassError.java | 32 + .../test/tools/javac/BreakAcrossClass.java | 46 + langtools/test/tools/javac/Capture.java | 46 + .../test/tools/javac/CaptureInSubtype.java | 73 + .../tools/javac/CascadedInnerNewInstance.java | 59 + .../test/tools/javac/CastInterface2Array.java | 48 + .../tools/javac/ClassCycle/ClassCycle1a.java | 34 + .../tools/javac/ClassCycle/ClassCycle1b.java | 28 + .../tools/javac/ClassCycle/ClassCycle2a.java | 34 + .../tools/javac/ClassCycle/ClassCycle2b.java | 28 + .../tools/javac/ClassCycle/ClassCycle3a.java | 34 + .../tools/javac/ClassCycle/ClassCycle3b.java | 30 + .../ClassFileModifiers/ClassModifiers.java | 133 + .../ClassFileModifiers/ClassModifiers.out | 426 ++ .../ClassFileModifiers/MemberModifiers.java | 60 + .../ClassFileModifiers/MemberModifiers.out | 42 + .../test/tools/javac/ClassIsAbstract.java | 41 + langtools/test/tools/javac/ClassLit.java | 42 + .../ClassLiteralHelperContext.java | 51 + .../javac/ClassLiterals/InitializeOuter.java | 49 + .../javac/ClassLiterals/InitializeTarget.java | 44 + .../ClassLiterals/InnerClassLiterals.java | 52 + .../ClassLiterals/LiteralInterfaceImpl.java | 62 + .../ClassLiterals/LiteralInterface_1.java | 31 + .../ClassLiterals/LiteralInterface_2.java | 39 + .../ClassLiterals/LiteralInterface_3.java | 38 + .../evalinit/ClassLiteralEvalInit.java | 36 + .../evalinit/java/lang/Integer.java | 30 + .../test/tools/javac/ClassLiterals/p1/C.java | 31 + .../javac/ClassLiterals/p1/SuperClass.java | 33 + .../InterfaceAndInnerClsCtor.java | 52 + .../javac/ClassPathTest/ClassPathTest.sh | 138 + .../javac/ClassPathTest/ClassPathTest1.java | 29 + .../javac/ClassPathTest/ClassPathTest2.java | 29 + .../javac/ClassPathTest/ClassPathTest3.java | 29 + .../bar/pkg/ClassPathTestAux2.java | 26 + .../foo/pkg/ClassPathTestAux1.java | 26 + .../ClassPathTest/pkg/ClassPathTestAux3.java | 26 + .../test/tools/javac/ClassToTypeParm.java | 37 + .../test/tools/javac/CloneableProblem.java | 80 + langtools/test/tools/javac/Closure1.java | 51 + langtools/test/tools/javac/Closure2.java | 60 + langtools/test/tools/javac/Closure3.java | 65 + langtools/test/tools/javac/Closure4.java | 64 + langtools/test/tools/javac/Closure5.java | 54 + langtools/test/tools/javac/Closure6.java | 49 + langtools/test/tools/javac/CompoundBox.java | 37 + .../tools/javac/ConditionalArgTypes_1.java | 41 + .../tools/javac/ConditionalArgTypes_2.java | 41 + .../test/tools/javac/ConditionalClass.java | 49 + .../test/tools/javac/ConditionalInline.java | 38 + .../test/tools/javac/ConditionalWithVoid.java | 37 + .../test/tools/javac/ConstBoolAppend.java | 42 + .../test/tools/javac/ConstCharAppend.java | 42 + .../javac/ConstantValues/ConstValInit.java | 62 + .../ConstantValues/ConstValInlining.java | 64 + .../tools/javac/ConstantValues/test_ff1.java | 27 + .../tools/javac/ConstantValues/test_ff2.java | 27 + .../test/tools/javac/CyclicInheritance.java | 57 + .../test/tools/javac/CyclicInheritance.out | 25 + .../test/tools/javac/CyclicInheritance.sh | 86 + .../test/tools/javac/CyclicInheritance2.java | 44 + .../test/tools/javac/CyclicInheritance4.java | 56 + .../tools/javac/CyclicInheritance6/Main.java | 47 + .../tools/javac/CyclicInheritance6/p1/A.java | 25 + .../tools/javac/CyclicInheritance6/p1/B.java | 25 + .../tools/javac/CyclicInheritance6/p1/C.java | 26 + .../javac/CyclicScoping/CyclicScoping_1.java | 36 + .../javac/CyclicScoping/CyclicScoping_2.java | 44 + .../test/tools/javac/DeadInnerClass.java | 49 + .../javac/DeclarationStatementInline.java | 56 + .../test/tools/javac/DeepStringConcat.java | 1960 ++++++++ .../ConstantInfiniteWhile.java | 67 + .../javac/DefiniteAssignment/DABlock.java | 42 + .../javac/DefiniteAssignment/DALoop1.java | 49 + .../javac/DefiniteAssignment/DASwitch.java | 48 + .../javac/DefiniteAssignment/DUAssert.java | 49 + .../DefiniteAssignment/DUBeforeDefined1.java | 40 + .../DefiniteAssignment/DUBeforeDefined2.java | 43 + .../javac/DefiniteAssignment/DUParam1.java | 38 + .../javac/DefiniteAssignment/DUParam2.java | 41 + .../javac/DefiniteAssignment/DUSwitch.java | 52 + .../javac/DefiniteAssignment/DUSwitch2.java | 44 + .../tools/javac/DefiniteAssignment/DUTry.java | 51 + .../DefAssignAfterIf_1.java | 39 + .../DefAssignAfterIf_2.java | 39 + .../DefAssignAfterThis_1.java | 45 + .../DefAssignAfterThis_2.java | 49 + .../DefAssignAfterTry1.java | 54 + .../DefAssignAfterTry2.java | 58 + .../DefAssignAfterTry3.java | 58 + .../DefAssignBoolean/DefAssignBoolean_1.java | 45 + .../DefAssignBoolean/DefAssignBoolean_10.java | 45 + .../DefAssignBoolean/DefAssignBoolean_11.java | 45 + .../DefAssignBoolean/DefAssignBoolean_12.java | 46 + .../DefAssignBoolean/DefAssignBoolean_13.java | 47 + .../DefAssignBoolean/DefAssignBoolean_14.java | 47 + .../DefAssignBoolean/DefAssignBoolean_15.java | 44 + .../DefAssignBoolean/DefAssignBoolean_16.java | 45 + .../DefAssignBoolean/DefAssignBoolean_2.java | 44 + .../DefAssignBoolean/DefAssignBoolean_3.java | 46 + .../DefAssignBoolean/DefAssignBoolean_4.java | 45 + .../DefAssignBoolean/DefAssignBoolean_5.java | 44 + .../DefAssignBoolean/DefAssignBoolean_6.java | 45 + .../DefAssignBoolean/DefAssignBoolean_7.java | 45 + .../DefAssignBoolean/DefAssignBoolean_8.java | 45 + .../DefAssignBoolean/DefAssignBoolean_9.java | 44 + .../DefAssignBoolean/DefAssignCond.java | 43 + .../DefAssignConstantBoolean.java | 46 + .../DefAssignNestedArg.java | 41 + .../javac/DefiniteAssignment/T4704365.java | 43 + .../javac/DefiniteAssignment/T4717164.java | 46 + .../javac/DefiniteAssignment/T4717165.java | 43 + .../javac/DefiniteAssignment/T4718134.java | 47 + .../javac/DefiniteAssignment/T4718142.java | 50 + .../javac/DefiniteAssignment/T4718142a.java | 48 + .../javac/DefiniteAssignment/T4718708.java | 41 + .../javac/DefiniteAssignment/T4720379.java | 37 + .../javac/DefiniteAssignment/T4720751.java | 40 + .../javac/DefiniteAssignment/T4721062a.java | 40 + .../javac/DefiniteAssignment/T4721062b.java | 40 + .../javac/DefiniteAssignment/T4721076.java | 38 + .../javac/DefiniteAssignment/T4721998.java | 45 + .../javac/DefiniteAssignment/T4725725.java | 41 + .../ThrowBeforeTryFinally.java | 48 + .../DefiniteAssignment/UncaughtException.java | 51 + langtools/test/tools/javac/DepParam.java | 36 + langtools/test/tools/javac/Digits.java | 12 + langtools/test/tools/javac/Digits.out | 2 + langtools/test/tools/javac/DivByZero.java | 42 + .../test/tools/javac/DuplicateClass.java | 44 + .../test/tools/javac/DuplicateClass2.java | 34 + .../test/tools/javac/DuplicateImport.java | 38 + langtools/test/tools/javac/EOI.java | 34 + langtools/test/tools/javac/EarlyAssert.java | 60 + langtools/test/tools/javac/EmptyArray.java | 36 + langtools/test/tools/javac/EmptyBreak.java | 52 + .../test/tools/javac/EmptyDocComments.java | 143 + langtools/test/tools/javac/EmptySwitch.java | 45 + .../tools/javac/EnclosingAccessCheck.java | 41 + langtools/test/tools/javac/Enum1.java | 44 + .../test/tools/javac/ExceptionalFinally.java | 47 + .../test/tools/javac/ExceptionalFinally2.java | 48 + .../test/tools/javac/ExprQualifiedType.java | 44 + .../tools/javac/ExtDirs/ExtDirTest_1.java | 28 + .../tools/javac/ExtDirs/ExtDirTest_2.java | 30 + .../tools/javac/ExtDirs/ExtDirTest_3.java | 30 + langtools/test/tools/javac/ExtDirs/ExtDirs.sh | 98 + .../test/tools/javac/ExtDirs/ext1/pkg1.jar | Bin 0 -> 957 bytes .../test/tools/javac/ExtDirs/ext2/pkg2.jar | Bin 0 -> 955 bytes .../test/tools/javac/ExtDirs/ext3/pkg1.jar | Bin 0 -> 957 bytes .../test/tools/javac/ExtDirs/ext3/pkg2.jar | Bin 0 -> 955 bytes langtools/test/tools/javac/ExtendArray.java | 11 + langtools/test/tools/javac/ExtendArray.out | 6 + .../javac/ExtendsAccess/ExtendsAccess.java | 253 + .../javac/ExtendsAccess/ExtendsAccess.out | 151 + .../javac/ExtendsAccess/ExtendsAccess.sh | 83 + .../javac/ExtendsAccess/p/ExtendsAccess.java | 47 + langtools/test/tools/javac/ExtendsScope.java | 39 + .../test/tools/javac/ExtraneousEquals.java | 34 + .../test/tools/javac/FaultySignature.java | 60 + .../test/tools/javac/FinalInitializer.java | 41 + .../test/tools/javac/FinalInitializer_2.java | 54 + .../tools/javac/FinalIntConcatenation.java | 45 + .../test/tools/javac/FinalThisReference.java | 42 + langtools/test/tools/javac/FinallyWarn.java | 41 + langtools/test/tools/javac/FlatnameClash.java | 38 + .../test/tools/javac/FlatnameClash2.java | 61 + .../BadConstructorModifiers.java | 14 + .../BadConstructorModifiers.out | 4 + .../BadConstructorModifiers.sh | 82 + .../javac/FloatingPointChanges/Test.java | 80 + .../test/tools/javac/FoldConditional.java | 50 + .../ForwardReference/ForwardReference_2.java | 41 + .../ForwardReference/ForwardReference_4.java | 41 + .../ForwardReference/ForwardReference_5.java | 41 + .../UseBeforeDeclaration.java | 63 + langtools/test/tools/javac/GoodCovar.java | 47 + .../test/tools/javac/HexFloatLiterals.java | 1998 ++++++++ langtools/test/tools/javac/HexThree.java | 4247 +++++++++++++++++ .../tools/javac/HiddenAbstractMethod/Test | 12 + .../HiddenAbstractMethod/one/Parent.java | 28 + .../javac/HiddenAbstractMethod/two/Child.java | 28 + .../tools/javac/IllDefinedOrderOfInit.java | 47 + .../test/tools/javac/IllegalAnnotation.java | 13 + .../test/tools/javac/IllegalAnnotation.out | 2 + .../javac/IllegallyOptimizedException.java | 46 + .../test/tools/javac/ImplicitToString.java | 46 + .../test/tools/javac/ImportCycle/Dummy.java | 34 + .../tools/javac/ImportCycle/foo/Bottom.java | 28 + .../tools/javac/ImportCycle/foo/Bottom2.java | 28 + .../tools/javac/ImportCycle/foo/Middle.java | 26 + .../tools/javac/ImportCycle/foo/Middle2.java | 26 + .../test/tools/javac/ImportCycle/foo/Top.java | 26 + .../tools/javac/ImportCycle/foo/Top2.java | 26 + .../ImportPackagePrivateInner/Dummy.java | 35 + .../foo/Accessee.java | 28 + .../foo/Accessor.java | 28 + .../test/tools/javac/ImportUnnamed/Dummy.java | 33 + .../test/tools/javac/ImportUnnamed/foo/A.java | 28 + .../javac/InconsistentInheritedSignature.java | 40 + .../test/tools/javac/InconsistentStack.java | 47 + langtools/test/tools/javac/Increment.java | 38 + .../tools/javac/InheritedPrivateImpl.java | 45 + .../tools/javac/InitializerCompletion_1.java | 37 + .../tools/javac/InitializerCompletion_2.java | 40 + .../tools/javac/InitializerCompletion_3.java | 37 + .../tools/javac/InitializerCompletion_4.java | 40 + .../Outside$1$Inside.class | Bin 0 -> 296 bytes .../javac/InnerClassesAttribute/Outside.class | Bin 0 -> 344 bytes .../InnerClassesAttribute/Outside.java.back | 11 + .../javac/InnerClassesAttribute/Test.java | 36 + .../tools/javac/InnerMemberRegression.java | 57 + langtools/test/tools/javac/InnerMethSig.java | 40 + .../tools/javac/InnerNamedConstant_1.java | 54 + .../tools/javac/InnerNamedConstant_2.java | 37 + .../test/tools/javac/InnerNamedConstant_2.out | 13 + .../test/tools/javac/InnerNamedConstant_2.sh | 82 + langtools/test/tools/javac/InnerTruth.java | 61 + .../tools/javac/InstanceInitException_1.java | 77 + .../tools/javac/InstanceInitException_2.java | 53 + .../test/tools/javac/InterfaceAssert.java | 52 + .../tools/javac/InterfaceFieldParsing_1.java | 37 + .../test/tools/javac/InterfaceInInner.java | 39 + .../javac/InterfaceMemberClassModifiers.java | 40 + .../javac/InterfaceMemberClassModifiers.out | 7 + .../javac/InterfaceObjectIncompatibility.java | 38 + .../javac/InterfaceObjectInheritance.java | 45 + .../tools/javac/InterfaceOverrideCheck.java | 45 + .../tools/javac/InterfaceOverrideFinal.java | 31 + .../tools/javac/InterfaceOverrideObject.java | 40 + .../test/tools/javac/InvalidIntfCast.java | 46 + langtools/test/tools/javac/JsrRet.java | 70 + langtools/test/tools/javac/LabelHiding_1.java | 43 + .../test/tools/javac/LabeledDeclaration.java | 37 + .../test/tools/javac/LocalClasses_1.java | 75 + .../test/tools/javac/LocalClasses_2.java | 39 + langtools/test/tools/javac/LocalClasses_2.out | 4 + langtools/test/tools/javac/LocalClasses_2.sh | 82 + langtools/test/tools/javac/ManyMembers2.java | 4130 ++++++++++++++++ .../tools/javac/MemberTypeInheritance.java | 109 + .../test/tools/javac/MissingInclude.java | 33 + langtools/test/tools/javac/MissingInclude.sh | 81 + langtools/test/tools/javac/NameClash/One.java | 38 + .../test/tools/javac/NameClash/a/One.java | 27 + .../test/tools/javac/NameClash/b/One.java | 27 + langtools/test/tools/javac/NameCollision.java | 14 + langtools/test/tools/javac/NameCollision.out | 4 + langtools/test/tools/javac/NameCollision.sh | 83 + .../test/tools/javac/NameCollision2.java | 53 + .../tools/javac/NestedDuplicateLabels.java | 37 + .../test/tools/javac/NestedFinallyReturn.java | 46 + .../tools/javac/NestedInnerClassNames.java | 111 + .../tools/javac/NestedInnerClassNames.out | 52 + .../test/tools/javac/NestedInnerClassNames.sh | 82 + langtools/test/tools/javac/NewGeneric.java | 38 + langtools/test/tools/javac/NoClass.java | 35 + .../javac/NoNoClassDefFoundErrorError.java | 36 + .../test/tools/javac/NonAmbiguousField/Test | 10 + .../javac/NonAmbiguousField/one/Parent.java | 28 + .../javac/NonAmbiguousField/one/Parent2.java | 28 + .../javac/NonAmbiguousField/two/Child.java | 34 + .../javac/NonAmbiguousField/two/Child2.java | 36 + .../test/tools/javac/NonStaticFieldExpr1.java | 11 + .../test/tools/javac/NonStaticFieldExpr1.out | 4 + .../test/tools/javac/NonStaticFieldExpr1.sh | 85 + .../test/tools/javac/NonStaticFieldExpr2.java | 16 + .../test/tools/javac/NonStaticFieldExpr2.out | 4 + .../test/tools/javac/NonStaticFieldExpr2.sh | 82 + .../test/tools/javac/NonStaticFieldExpr3.java | 15 + .../test/tools/javac/NonStaticFieldExpr3.out | 4 + .../test/tools/javac/NonStaticFieldExpr3.sh | 82 + .../tools/javac/NonStaticFieldExpr4c.java | 40 + .../tools/javac/NonStaticFieldExpr4d.java | 28 + .../test/tools/javac/NonStaticFinalVar.java | 65 + langtools/test/tools/javac/Null2DArray.java | 44 + .../test/tools/javac/NullQualifiedNew.java | 47 + .../test/tools/javac/NullQualifiedNew2.java | 48 + .../test/tools/javac/NullQualifiedSuper1.java | 45 + .../test/tools/javac/NullQualifiedSuper2.java | 46 + .../test/tools/javac/NullStaticQualifier.java | 52 + langtools/test/tools/javac/Object1.java | 46 + langtools/test/tools/javac/Object2.java | 46 + .../javac/ObjectIncompatibleInterface.java | 38 + .../javac/ObjectMethodRefFromInterface.java | 56 + .../test/tools/javac/OuterParameter_1.java | 50 + .../OverrideChecks/InconsistentReturn.java | 40 + .../OverrideChecks/InterfaceImplements.java | 39 + .../OverrideChecks/InterfaceOverride.java | 39 + .../tools/javac/OverrideChecks/Private.java | 39 + .../javac/OverrideChecks/StaticOverride.java | 43 + .../tools/javac/OverrideChecks/T4720356a.java | 40 + .../tools/javac/OverrideChecks/T4720356b.java | 27 + .../tools/javac/OverrideChecks/T4720359a.java | 40 + .../tools/javac/OverrideChecks/T4720359b.java | 27 + .../tools/javac/OverrideChecks/T4721069.java | 48 + .../tools/javac/OverrideChecks/T6326485.java | 35 + .../tools/javac/OverrideChecks/T6399361.java | 42 + .../javac/OverrideChecks/ThrowsConflict.java | 44 + .../test/tools/javac/OverridePosition.java | 25 + .../test/tools/javac/OverridePosition.out | 7 + .../javac/PackageClassAmbiguity/Bad.java | 39 + .../javac/PackageClassAmbiguity/util.java | 30 + .../PackageClassClash/PackageClassClash.java | 41 + langtools/test/tools/javac/Parens1.java | 37 + langtools/test/tools/javac/Parens2.java | 38 + langtools/test/tools/javac/Parens3.java | 37 + langtools/test/tools/javac/Parens4.java | 37 + .../test/tools/javac/ParseConditional.java | 43 + .../test/tools/javac/Paths/Class-Path.sh | 198 + .../test/tools/javac/Paths/CompileClose.java | 77 + .../test/tools/javac/Paths/Diagnostics.sh | 201 + langtools/test/tools/javac/Paths/Help.sh | 69 + langtools/test/tools/javac/Paths/MineField.sh | 384 ++ langtools/test/tools/javac/Paths/SameJVM.java | 66 + langtools/test/tools/javac/Paths/Util.sh | 129 + .../test/tools/javac/Paths/wcMineField.sh | 296 ++ .../tools/javac/PrivateLocalConstructor.java | 55 + .../tools/javac/PrivateUplevelConstant.java | 48 + .../ProtectedInnerClass.sh | 82 + .../ProtectedInnerClass_2.java | 33 + .../p1/ProtectedInnerClass1.java | 37 + .../p2/ProtectedInnerClass2.java | 45 + .../p2/ProtectedInnerClass3.java | 36 + .../QualifiedAccess/QualifiedAccess_1.java | 75 + .../QualifiedAccess/QualifiedAccess_1.out | 55 + .../QualifiedAccess/QualifiedAccess_1.sh | 85 + .../QualifiedAccess/QualifiedAccess_2.java | 55 + .../QualifiedAccess/QualifiedAccess_2.out | 19 + .../QualifiedAccess/QualifiedAccess_2.sh | 85 + .../QualifiedAccess/QualifiedAccess_3.java | 47 + .../QualifiedAccess/QualifiedAccess_3.out | 13 + .../QualifiedAccess/QualifiedAccess_3.sh | 83 + .../QualifiedAccess/QualifiedAccess_4.java | 45 + .../tools/javac/QualifiedAccess/pack1/P1.java | 63 + .../tools/javac/QualifiedAccess/pack1/P2.java | 32 + .../test/tools/javac/QualifiedConstant.java | 42 + langtools/test/tools/javac/QualifiedNew.java | 40 + .../test/tools/javac/QualifiedNewScope.java | 41 + .../test/tools/javac/QualifiedOuterThis.java | 63 + .../test/tools/javac/QualifiedOuterThis2.java | 46 + .../tools/javac/QualifiedThisAndSuper_1.java | 283 ++ .../tools/javac/QualifiedThisAndSuper_2.java | 194 + .../tools/javac/QualifiedThisAndSuper_3.java | 318 ++ .../tools/javac/QualifiedThisExactMatch.java | 81 + langtools/test/tools/javac/RawCrash.java | 43 + .../tools/javac/ReturnAfterIfThenElse.java | 46 + langtools/test/tools/javac/SerialWarn.java | 34 + .../test/tools/javac/ShiftExpressionTest.java | 45 + langtools/test/tools/javac/Source5.java | 39 + .../tools/javac/StandaloneQualifiedSuper.java | 54 + .../test/tools/javac/StaticBlockScope.java | 46 + langtools/test/tools/javac/StoreClass.java | 38 + .../test/tools/javac/StrictAbstract.java | 59 + .../javac/StringAppendAccessMethodOnLHS.java | 60 + .../test/tools/javac/StringConversion.java | 108 + langtools/test/tools/javac/SuperField.java | 66 + langtools/test/tools/javac/SuperMeth.java | 46 + .../test/tools/javac/SuperMethodResolve.java | 43 + langtools/test/tools/javac/SuperNew.java | 53 + langtools/test/tools/javac/SuperNew2.java | 50 + langtools/test/tools/javac/SuperNew3.java | 46 + langtools/test/tools/javac/SuperNew4.java | 44 + .../javac/SuperclassConstructorException.java | 48 + langtools/test/tools/javac/SwitchFence.java | 52 + langtools/test/tools/javac/SwitchScope.java | 48 + .../test/tools/javac/SynchronizedClass.java | 9 + .../test/tools/javac/SynchronizedClass.out | 4 + .../test/tools/javac/SynchronizedClass.sh | 82 + langtools/test/tools/javac/SynthName1.java | 71 + langtools/test/tools/javac/SynthName2.java | 70 + .../test/tools/javac/T4093617/T4093617.java | 13 + .../test/tools/javac/T4093617/T4093617.out | 4 + .../test/tools/javac/T4848619/T4848619a.java | 35 + .../test/tools/javac/T4848619/T4848619b.java | 35 + langtools/test/tools/javac/T4906100.java | 25 + langtools/test/tools/javac/T4906100.out | 2 + .../tools/javac/T4994049/DeprecatedNOT.java | 47 + .../tools/javac/T4994049/DeprecatedYES.java | 43 + .../test/tools/javac/T4994049/T4994049.java | 14 + .../test/tools/javac/T4994049/T4994049.out | 2 + .../test/tools/javac/T5003235/T5003235a.java | 26 + .../test/tools/javac/T5003235/T5003235a.out | 13 + .../test/tools/javac/T5003235/T5003235b.java | 33 + .../test/tools/javac/T5003235/T5003235b.out | 13 + .../test/tools/javac/T5003235/T5003235c.java | 15 + .../test/tools/javac/T5003235/T5003235c.out | 4 + .../test/tools/javac/T5024091/T5024091.java | 14 + .../test/tools/javac/T5024091/T5024091.out | 2 + langtools/test/tools/javac/T5048776.java | 21 + langtools/test/tools/javac/T5048776a.out | 0 langtools/test/tools/javac/T5048776b.out | 3 + .../test/tools/javac/T5090006/T5090006.java | 47 + .../test/tools/javac/T5090006/broken.jar | Bin 0 -> 24053 bytes .../test/tools/javac/T5090006/compiler.sh | 76 + langtools/test/tools/javac/T5092545.java | 46 + langtools/test/tools/javac/T5105890.java | 42 + .../tools/javac/T6180021/AbstractSub.java | 33 + langtools/test/tools/javac/T6180021/Sub.java | 33 + .../test/tools/javac/T6180021/Super.java | 34 + langtools/test/tools/javac/T6214885.java | 13 + langtools/test/tools/javac/T6214885a.out | 6 + langtools/test/tools/javac/T6214885b.out | 6 + langtools/test/tools/javac/T6224167.java | 12 + langtools/test/tools/javac/T6224167.out | 2 + langtools/test/tools/javac/T6227617.java | 37 + langtools/test/tools/javac/T6227617.out | 6 + langtools/test/tools/javac/T6230128.java | 12 + langtools/test/tools/javac/T6230128.out | 2 + .../test/tools/javac/T6231246/T6231246.java | 36 + langtools/test/tools/javac/T6231847.java | 20 + langtools/test/tools/javac/T6231847.out | 9 + langtools/test/tools/javac/T6232928.java | 49 + .../tools/javac/T6232928/package-info.java | 25 + langtools/test/tools/javac/T6234077.java | 30 + langtools/test/tools/javac/T6238612.java | 101 + langtools/test/tools/javac/T6241723.java | 41 + langtools/test/tools/javac/T6241723.out | 5 + langtools/test/tools/javac/T6245591.java | 19 + langtools/test/tools/javac/T6245591.out | 3 + langtools/test/tools/javac/T6247324.java | 30 + langtools/test/tools/javac/T6247324.out | 2 + langtools/test/tools/javac/T6265400.java | 64 + langtools/test/tools/javac/T6266772.java | 58 + langtools/test/tools/javac/T6294589.java | 44 + langtools/test/tools/javac/T6304128.java | 47 + langtools/test/tools/javac/T6306967.java | 43 + langtools/test/tools/javac/T6341023.java | 125 + langtools/test/tools/javac/T6351767.java | 92 + .../test/tools/javac/T6356217/T6356217.java | 45 + langtools/test/tools/javac/T6358024.java | 118 + langtools/test/tools/javac/T6358166.java | 80 + langtools/test/tools/javac/T6358168.java | 113 + langtools/test/tools/javac/T6361619.java | 94 + langtools/test/tools/javac/T6366196.java | 61 + langtools/test/tools/javac/T6370653.java | 44 + langtools/test/tools/javac/T6379327.java | 46 + langtools/test/tools/javac/T6394563.empty.out | 0 langtools/test/tools/javac/T6394563.java | 23 + langtools/test/tools/javac/T6394563.note.out | 2 + langtools/test/tools/javac/T6394563.warn.out | 2 + langtools/test/tools/javac/T6395974.java | 78 + langtools/test/tools/javac/T6397044.java | 111 + langtools/test/tools/javac/T6397286.java | 77 + .../test/tools/javac/T6403466.byfile.out | 38 + langtools/test/tools/javac/T6403466.java | 146 + langtools/test/tools/javac/T6403466.out | 38 + langtools/test/tools/javac/T6404756.java | 40 + langtools/test/tools/javac/T6405099.java | 44 + langtools/test/tools/javac/T6406771.java | 98 + langtools/test/tools/javac/T6407066.java | 56 + langtools/test/tools/javac/T6407257.java | 38 + langtools/test/tools/javac/T6410706.java | 78 + langtools/test/tools/javac/T6411379.java | 65 + langtools/test/tools/javac/T6413876.java | 47 + langtools/test/tools/javac/T6423583.java | 93 + langtools/test/tools/javac/T6435291/T.class | Bin 0 -> 1310 bytes langtools/test/tools/javac/T6435291/T.jcod | 320 ++ .../test/tools/javac/T6435291/T6435291.java | 52 + langtools/test/tools/javac/T6534287.java | 44 + langtools/test/tools/javac/T6557865.java | 45 + langtools/test/tools/javac/ThrowNull.java | 51 + .../tools/javac/ThrowsIntersection_1.java | 58 + .../tools/javac/ThrowsIntersection_2.java | 59 + .../tools/javac/ThrowsIntersection_3.java | 52 + .../tools/javac/ThrowsIntersection_4.java | 54 + .../test/tools/javac/TryInInstanceInit.java | 45 + .../test/tools/javac/UncaughtOverflow.java | 36 + .../test/tools/javac/UncaughtOverflow2.java | 36 + .../test/tools/javac/UnreachableVar.java | 49 + .../tools/javac/UnterminatedLineComment.java | 35 + .../javac/UplevelFromAnonInSuperCall.java | 45 + langtools/test/tools/javac/UseEnum.java | 46 + .../javac/VarDeclarationWithAssignment.java | 45 + langtools/test/tools/javac/Verify.java | 49 + langtools/test/tools/javac/VerifyDA.java | 51 + langtools/test/tools/javac/VoidArray.java | 40 + langtools/test/tools/javac/abstract/T1.java | 37 + langtools/test/tools/javac/abstract/T2.java | 28 + langtools/test/tools/javac/abstract/T3.java | 28 + .../test/tools/javac/abstract/T4717181a.java | 41 + .../test/tools/javac/abstract/T4717181b.java | 51 + langtools/test/tools/javac/abstract/U1.java | 37 + langtools/test/tools/javac/abstract/U2.java | 28 + langtools/test/tools/javac/abstract/U3.java | 25 + .../tools/javac/accessVirtualInner/Main.java | 42 + .../tools/javac/accessVirtualInner/a/A.java | 32 + .../tools/javac/accessVirtualInner/b/B.java | 44 + .../tools/javac/accessVirtualInner/c/C.java | 32 + .../6214965/CompilerAnnotationTest.java | 28 + .../6214965/CompilerAnnotationTest2.java | 29 + .../6214965/CompilerAnnotationTest2bad.java | 29 + .../javac/annotations/6214965/T6214965.java | 31 + .../javac/annotations/6214965/T6214965.out | 2 + .../javac/annotations/6359949/T6359949.java | 43 + .../javac/annotations/6359949/T6359949a.java | 42 + .../javac/annotations/6365854/T6365854.java | 51 + .../annotations/6365854/TestAnnotation.java | 30 + .../javac/annotations/6365854/TestCore.java | 37 + .../6365854/evolve/TestAnnotation.java | 29 + .../tools/javac/annotations/6365854/test1.out | 2 + .../tools/javac/annotations/6365854/test2.out | 2 + .../tools/javac/annotations/default/A.java | 40 + .../tools/javac/annotations/default/B.java | 26 + .../tools/javac/annotations/default/C.java | 26 + .../tools/javac/annotations/default/Derr.java | 26 + .../tools/javac/annotations/default/Eerr.java | 26 + .../tools/javac/annotations/neg/AnnComma.java | 45 + .../tools/javac/annotations/neg/ArrayLit.java | 36 + .../tools/javac/annotations/neg/Constant.java | 42 + .../tools/javac/annotations/neg/Cycle1.java | 37 + .../tools/javac/annotations/neg/Cycle2.java | 41 + .../tools/javac/annotations/neg/Cycle3.java | 49 + .../test/tools/javac/annotations/neg/Dep.java | 37 + .../test/tools/javac/annotations/neg/Dup.java | 35 + .../javac/annotations/neg/DupTarget.java | 35 + .../javac/annotations/neg/MemberOver.java | 37 + .../javac/annotations/neg/MixedSource.java | 35 + .../annotations/neg/NoAnnotationMethods.java | 34 + .../tools/javac/annotations/neg/NoClone.java | 34 + .../annotations/neg/NoObjectMethods.java | 34 + .../javac/annotations/neg/ObjectMembers.java | 34 + .../javac/annotations/neg/OverrideNo.java | 40 + .../tools/javac/annotations/neg/Package.java | 34 + .../tools/javac/annotations/neg/Recovery.java | 36 + .../javac/annotations/neg/Recovery1.java | 43 + .../tools/javac/annotations/neg/Scope.java | 42 + .../tools/javac/annotations/neg/Syntax1.java | 44 + .../javac/annotations/neg/WrongTarget.java | 39 + .../javac/annotations/neg/WrongTarget2.java | 36 + .../javac/annotations/neg/WrongValue.java | 50 + .../test/tools/javac/annotations/neg/Z1.java | 41 + .../test/tools/javac/annotations/neg/Z10.java | 37 + .../test/tools/javac/annotations/neg/Z11.java | 39 + .../test/tools/javac/annotations/neg/Z12.java | 37 + .../test/tools/javac/annotations/neg/Z13.java | 35 + .../test/tools/javac/annotations/neg/Z14.java | 35 + .../test/tools/javac/annotations/neg/Z15.java | 35 + .../test/tools/javac/annotations/neg/Z16.java | 37 + .../test/tools/javac/annotations/neg/Z2.java | 37 + .../test/tools/javac/annotations/neg/Z3.java | 37 + .../test/tools/javac/annotations/neg/Z4.java | 37 + .../test/tools/javac/annotations/neg/Z5.java | 36 + .../test/tools/javac/annotations/neg/Z8.java | 35 + .../test/tools/javac/annotations/neg/Z9.java | 35 + .../annotations/pos/AnnotationMethods.java | 34 + .../annotations/pos/AnnoteElideBraces.java | 49 + .../tools/javac/annotations/pos/ClassA.java | 36 + .../tools/javac/annotations/pos/ClassB.java | 27 + .../test/tools/javac/annotations/pos/Dep.java | 36 + .../tools/javac/annotations/pos/Enum1.java | 40 + .../tools/javac/annotations/pos/Local.java | 37 + .../tools/javac/annotations/pos/Members.java | 38 + .../tools/javac/annotations/pos/NType.java | 51 + .../javac/annotations/pos/OverrideCheck.java | 42 + .../javac/annotations/pos/OverrideOK.java | 43 + .../javac/annotations/pos/Parameter.java | 45 + .../javac/annotations/pos/Primitives.java | 78 + .../javac/annotations/pos/RightTarget.java | 90 + .../test/tools/javac/annotations/pos/Z1.java | 41 + .../test/tools/javac/annotations/pos/Z2.java | 37 + .../test/tools/javac/annotations/pos/Z3.java | 52 + .../test/tools/javac/annotations/pos/Z4.java | 42 + .../javac/annotations/pos/package-info.java | 34 + .../tools/javac/api/6400303/T6400303.java | 53 + .../test/tools/javac/api/6400303/Test1.java | 32 + .../test/tools/javac/api/6400303/Test2.java | 24 + .../tools/javac/api/6410643/T6410643.java | 68 + .../tools/javac/api/6411310/T6411310.java | 55 + .../tools/javac/api/6411333/T6411333.java | 87 + .../tools/javac/api/6412656/T6412656.java | 69 + .../tools/javac/api/6415780/T6415780.java | 44 + .../tools/javac/api/6418694/T6418694.java | 57 + .../tools/javac/api/6420409/T6420409.java | 74 + .../tools/javac/api/6420464/T6420464.java | 52 + .../tools/javac/api/6421111/T6421111.java | 106 + .../tools/javac/api/6421756/T6421756.java | 49 + .../tools/javac/api/6422215/T6422215.java | 50 + .../tools/javac/api/6422327/T6422327.java | 47 + .../tools/javac/api/6422327/T6422327.other | 2 + .../tools/javac/api/6423003/T6423003.java | 49 + .../tools/javac/api/6431257/T6431257.java | 71 + .../tools/javac/api/6431257/package-info.java | 25 + langtools/test/tools/javac/api/6431435/A.java | 33 + .../tools/javac/api/6431435/T6431435.java | 67 + .../test/tools/javac/api/6431435/p/B.java | 25 + .../tools/javac/api/6437349/T6437349.java | 55 + .../tools/javac/api/6437999/T6437999.java | 73 + .../test/tools/javac/api/6437999/Utf8.java | 27 + .../tools/javac/api/6440333/T6440333.java | 53 + .../tools/javac/api/6440528/T6440528.java | 70 + .../tools/javac/api/6440528/package-info.java | 24 + .../tools/javac/api/6452876/T6452876.java | 45 + .../tools/javac/api/6468404/T6468404.java | 148 + .../test/tools/javac/api/6471599/Main.java | 79 + langtools/test/tools/javac/api/Sibling.java | 56 + langtools/test/tools/javac/api/T6257235.java | 42 + langtools/test/tools/javac/api/T6258271.java | 51 + langtools/test/tools/javac/api/T6265137.java | 54 + langtools/test/tools/javac/api/T6265137a.java | 24 + langtools/test/tools/javac/api/T6306137.java | 84 + langtools/test/tools/javac/api/T6345974.java | 78 + langtools/test/tools/javac/api/T6357331.java | 70 + langtools/test/tools/javac/api/T6358786.java | 59 + langtools/test/tools/javac/api/T6358955.java | 70 + langtools/test/tools/javac/api/T6392782.java | 100 + langtools/test/tools/javac/api/T6395981.java | 59 + langtools/test/tools/javac/api/T6397104.java | 97 + langtools/test/tools/javac/api/T6400205.java | 49 + langtools/test/tools/javac/api/T6400207.java | 88 + langtools/test/tools/javac/api/T6407011.java | 42 + langtools/test/tools/javac/api/T6412669.java | 75 + langtools/test/tools/javac/api/T6431879.java | 62 + .../tools/javac/api/TestEvalExpression.java | 78 + .../test/tools/javac/api/TestGetTree.java | 54 + .../test/tools/javac/api/TestJavacTask.java | 60 + .../tools/javac/api/TestJavacTaskScanner.java | 142 + .../test/tools/javac/api/TestOperators.java | 347 ++ .../tools/javac/api/TestResolveIdent.java | 54 + langtools/test/tools/javac/api/TestTrees.java | 216 + .../api/evalexpr/ByteArrayClassLoader.java | 60 + .../javac/api/evalexpr/CompileFromString.java | 127 + .../javac/api/evalexpr/MemoryFileManager.java | 165 + .../test/tools/javac/api/guide/Test.java | 85 + .../test/tools/javac/api/guide/TestMe.java | 25 + .../test/tools/javac/api/lib/ToolTester.java | 53 + langtools/test/tools/javac/apt.sh | 68 + langtools/test/tools/javac/assert/Attach.java | 53 + langtools/test/tools/javac/assert/DU1.java | 42 + langtools/test/tools/javac/assert/DU2.java | 40 + .../test/tools/javac/assert/Position.java | 28 + .../test/tools/javac/binaryCompat/T1.java | 41 + .../test/tools/javac/binaryCompat/T2.java | 27 + .../test/tools/javac/binaryCompat/T3.java | 29 + .../test/tools/javac/boxing/BoxedForeach.java | 123 + .../test/tools/javac/boxing/Boxing1.java | 159 + .../test/tools/javac/boxing/Boxing2.java | 38 + .../test/tools/javac/boxing/Boxing4.java | 42 + .../tools/javac/boxing/BoxingCaching.java | 221 + .../test/tools/javac/boxing/NoBoxingBool.java | 34 + .../test/tools/javac/boxing/NoBoxingByte.java | 34 + .../test/tools/javac/boxing/NoBoxingChar.java | 34 + .../tools/javac/boxing/NoBoxingDouble.java | 34 + .../tools/javac/boxing/NoBoxingFloat.java | 34 + .../test/tools/javac/boxing/NoBoxingInt.java | 34 + .../test/tools/javac/boxing/NoBoxingLong.java | 34 + .../tools/javac/boxing/NoBoxingShort.java | 34 + .../test/tools/javac/boxing/T5082929.java | 36 + .../test/tools/javac/boxing/T6348760.java | 374 ++ .../test/tools/javac/boxing/T6369051.java | 42 + .../test/tools/javac/capture/Capture1.java | 53 + .../test/tools/javac/capture/Capture2.java | 42 + .../test/tools/javac/capture/Capture3.java | 46 + .../test/tools/javac/capture/Capture4.java | 44 + .../test/tools/javac/capture/Capture5.java | 51 + .../test/tools/javac/capture/Martin.java | 40 + .../tools/javac/cast/4916620/T4916620.java | 42 + .../tools/javac/cast/5034609/T5034609.java | 37 + .../tools/javac/cast/5043020/T5043020.java | 36 + .../tools/javac/cast/5064736/T5064736.java | 40 + .../tools/javac/cast/5065215/T5065215.java | 33 + .../tools/javac/cast/6211853/T6211853.java | 41 + .../tools/javac/cast/6219964/T6219964.java | 40 + .../tools/javac/cast/6256789/T6256789.java | 44 + .../tools/javac/cast/6286112/T6286112.java | 37 + .../tools/javac/cast/6295056/T6295056.java | 40 + .../tools/javac/cast/6302214/T6302214.java | 48 + .../tools/javac/cast/6302214/T6302214a.java | 39 + .../tools/javac/cast/6302956/T6302956.java | 37 + .../tools/javac/cast/6358534/T6358534.java | 36 + .../test/tools/javac/cast/BoxedArray.java | 38 + .../test/tools/javac/cast/forum/T654170.java | 46 + .../test/tools/javac/code/ArrayClone.java | 40 + langtools/test/tools/javac/code/ArrayClone.sh | 86 + langtools/test/tools/javac/completion/C.java | 41 + langtools/test/tools/javac/completion/C.out | 5 + .../tools/javac/completion/example/B.class | Bin 0 -> 327 bytes .../tools/javac/conditional/Conditional.java | 41 + .../tools/javac/constDebug/ConstDebug.java | 35 + .../test/tools/javac/constDebug/ConstDebug.sh | 78 + .../crossPackageImpl/CrossPackageImplA.java | 46 + .../crossPackageImpl/CrossPackageImplB.java | 27 + .../test/tools/javac/danglingDep/DepX.java | 39 + .../test/tools/javac/danglingDep/DepX.out | 2 + .../test/tools/javac/danglingDep/NoDepX.java | 39 + .../test/tools/javac/danglingDep/NoDepX.out | 0 .../test/tools/javac/danglingDep/RefX.java | 30 + .../test/tools/javac/danglingDep/Test1.java | 42 + .../test/tools/javac/danglingDep/Test1.out | 0 .../depDocComment/DeprecatedDocComment.java | 36 + .../depDocComment/DeprecatedDocComment.out | 10 + .../depDocComment/DeprecatedDocComment.sh | 84 + .../depDocComment/DeprecatedDocComment2.java | 98 + .../depDocComment/SuppressDeprecation.java | 134 + .../depDocComment/SuppressDeprecation.out | 8 + .../javac/depOverrides/annotation/A.java | 26 + .../javac/depOverrides/annotation/B.java | 26 + .../javac/depOverrides/annotation/B2.java | 26 + .../javac/depOverrides/annotation/B3.java | 50 + .../javac/depOverrides/annotation/I.java | 48 + .../javac/depOverrides/annotation/P.java | 48 + .../javac/depOverrides/annotation/Q.java | 26 + .../javac/depOverrides/annotation/R.java | 26 + .../javac/depOverrides/annotation/Test1.java | 41 + .../javac/depOverrides/annotation/Test1A.out | 4 + .../javac/depOverrides/annotation/Test1B.out | 4 + .../javac/depOverrides/annotation/Test1B2.out | 7 + .../javac/depOverrides/annotation/Test2.java | 39 + .../javac/depOverrides/annotation/Test2Q.out | 4 + .../javac/depOverrides/annotation/Test2R.out | 4 + .../javac/depOverrides/annotation/Test3.java | 19 + .../javac/depOverrides/annotation/Test3.out | 2 + .../tools/javac/depOverrides/annotation/empty | 0 .../javac/depOverrides/doccomment/A.java | 26 + .../javac/depOverrides/doccomment/B.java | 26 + .../javac/depOverrides/doccomment/B2.java | 26 + .../javac/depOverrides/doccomment/B3.java | 50 + .../javac/depOverrides/doccomment/I.java | 48 + .../javac/depOverrides/doccomment/P.java | 48 + .../javac/depOverrides/doccomment/Q.java | 26 + .../javac/depOverrides/doccomment/R.java | 26 + .../javac/depOverrides/doccomment/Test1.java | 41 + .../javac/depOverrides/doccomment/Test1A.out | 4 + .../javac/depOverrides/doccomment/Test1B.out | 4 + .../javac/depOverrides/doccomment/Test1B2.out | 7 + .../javac/depOverrides/doccomment/Test2.java | 39 + .../javac/depOverrides/doccomment/Test2Q.out | 4 + .../javac/depOverrides/doccomment/Test2R.out | 4 + .../javac/depOverrides/doccomment/Test3.java | 19 + .../javac/depOverrides/doccomment/Test3.out | 2 + .../tools/javac/depOverrides/doccomment/empty | 0 .../tools/javac/enum/6350057/T6350057.java | 85 + .../tools/javac/enum/6350057/TestEnum.java | 27 + .../tools/javac/enum/6384542/T6384542.java | 24 + .../tools/javac/enum/6384542/T6384542.out | 9 + .../tools/javac/enum/6384542/T6384542a.java | 14 + .../javac/enum/6384542/T6384542a_1_4.out | 2 + .../tools/javac/enum/6384542/T6384542a_5.out | 2 + .../tools/javac/enum/6424358/T6424358.java | 69 + .../tools/javac/enum/AbstractEmptyEnum.java | 36 + .../test/tools/javac/enum/AbstractEnum1.java | 50 + langtools/test/tools/javac/enum/DA1.java | 39 + langtools/test/tools/javac/enum/DA2.java | 41 + langtools/test/tools/javac/enum/DA3.java | 41 + langtools/test/tools/javac/enum/Def.java | 52 + langtools/test/tools/javac/enum/Enum1.java | 43 + langtools/test/tools/javac/enum/Enum2.java | 35 + langtools/test/tools/javac/enum/Enum3.java | 56 + .../enum/EnumImplicitPrivateConstructor.java | 214 + langtools/test/tools/javac/enum/EnumInit.java | 49 + .../javac/enum/EnumPrivateConstructor.java | 44 + .../javac/enum/EnumProtectedConstructor.java | 44 + .../javac/enum/EnumPublicConstructor.java | 44 + .../test/tools/javac/enum/EnumSwitch1.java | 46 + .../test/tools/javac/enum/EnumSwitch2.java | 46 + .../test/tools/javac/enum/EnumSwitch3.java | 51 + .../test/tools/javac/enum/EnumSwitch4.java | 48 + .../javac/enum/ExplicitlyAbstractEnum1.java | 38 + .../javac/enum/ExplicitlyAbstractEnum2.java | 39 + .../javac/enum/ExplicitlyFinalEnum1.java | 38 + .../javac/enum/ExplicitlyFinalEnum2.java | 39 + .../test/tools/javac/enum/FauxEnum1.java | 37 + .../test/tools/javac/enum/FauxEnum2.java | 37 + .../test/tools/javac/enum/FauxEnum3.java | 43 + .../tools/javac/enum/FauxSpecialEnum1.java | 41 + .../tools/javac/enum/FauxSpecialEnum2.java | 38 + .../test/tools/javac/enum/LocalEnum.java | 37 + .../test/tools/javac/enum/NestedEnum.java | 37 + langtools/test/tools/javac/enum/NoFinal.java | 38 + langtools/test/tools/javac/enum/NoFinal2.java | 37 + langtools/test/tools/javac/enum/NoFinal3.java | 37 + langtools/test/tools/javac/enum/NoFinal4.java | 37 + langtools/test/tools/javac/enum/NoFinal5.java | 37 + langtools/test/tools/javac/enum/OkFinal.java | 43 + .../test/tools/javac/enum/SynthValues.java | 42 + langtools/test/tools/javac/enum/T5075242.java | 35 + langtools/test/tools/javac/enum/T5081785.java | 43 + .../test/tools/javac/enum/T5081785a.java | 28 + .../test/tools/javac/enum/T5081785b.java | 26 + .../test/tools/javac/enum/T5081785c.java | 28 + .../test/tools/javac/enum/TrailingComma.java | 38 + .../test/tools/javac/enum/UserValue.java | 46 + langtools/test/tools/javac/enum/ValueOf.java | 47 + .../tools/javac/enum/enumSwitch/Color2.java | 26 + .../javac/enum/enumSwitch/EnumSwitch.java | 55 + .../tools/javac/enum/forwardRef/T6425594.java | 13 + .../tools/javac/enum/forwardRef/T6425594.out | 4 + .../javac/enum/forwardRef/TestEnum1.java | 38 + .../javac/enum/forwardRef/TestEnum2.java | 39 + .../javac/enum/forwardRef/TestEnum3.java | 39 + .../javac/enum/forwardRef/TestEnum4.java | 38 + .../javac/enum/forwardRef/TestEnum5.java | 40 + .../javac/enum/forwardRef/TestEnum6.java | 36 + .../tools/javac/expression/NullAppend.java | 35 + .../tools/javac/expression/NullAppend2.java | 35 + .../tools/javac/expression/ObjectAppend.java | 36 + .../tools/javac/falseCycle/FalseCycle.java | 32 + .../javac/falseCycle/FalseCycleBase.java | 30 + .../tools/javac/fatalErrors/NoJavaLang.java | 40 + .../tools/javac/fatalErrors/NoJavaLang.out | 1 + .../tools/javac/fatalErrors/NoJavaLang.sh | 114 + .../test/tools/javac/foreach/Foreach.java | 80 + .../tools/javac/foreach/GenericIterator.java | 41 + .../javac/foreach/IntersectIterator.java | 74 + .../tools/javac/foreach/ListOfListTest.java | 83 + .../tools/javac/foreach/SpecIterable.java | 55 + .../test/tools/javac/foreach/StaticBlock.java | 42 + .../javac/foreach/SuperfluousAbstract.java | 63 + .../javac/generics/5066774/T5066774.java | 35 + .../javac/generics/5086027/T5086027.java | 34 + .../javac/generics/5086027/T5086027pos.java | 34 + .../tools/javac/generics/6192945/Method.java | 37 + .../javac/generics/6192945/MethodNeg.java | 29 + .../javac/generics/6192945/MethodNeg.out | 2 + .../tools/javac/generics/6192945/Neg.java | 25 + .../test/tools/javac/generics/6192945/Neg.out | 2 + .../tools/javac/generics/6192945/Neg2.java | 25 + .../tools/javac/generics/6192945/Neg2.out | 2 + .../tools/javac/generics/6192945/Neg3.java | 25 + .../tools/javac/generics/6192945/Neg3.out | 2 + .../javac/generics/6192945/T6192945.java | 31 + .../javac/generics/6207386/T6207386.java | 16 + .../tools/javac/generics/6207386/T6207386.out | 2 + .../tools/javac/generics/6207386/Test.java | 39 + .../javac/generics/6213818/T6213818.java | 36 + .../javac/generics/6218229/T6218229.java | 36 + .../tools/javac/generics/6227936/Orig.java | 60 + .../javac/generics/6227936/T6227936.java | 53 + .../javac/generics/6245699/T6245699.java | 46 + .../javac/generics/6245699/T6245699a.java | 45 + .../javac/generics/6245699/T6245699b.java | 50 + .../javac/generics/6245699/T6245699c.java | 46 + .../javac/generics/6268476/T6268476.java | 37 + .../javac/generics/6292765/T6292765.java | 38 + .../javac/generics/6332204/T6332204.java | 38 + .../javac/generics/6332204/T6346876.java | 39 + .../javac/generics/6356636/T6356636.java | 38 + .../javac/generics/6356636/a/AbstractFoo.java | 28 + .../tools/javac/generics/6356636/a/Bar.java | 30 + .../javac/generics/6359951/T6359951.java | 17 + .../tools/javac/generics/6359951/T6359951.out | 4 + .../generics/6372782/AbstractElement.java | 36 + .../6372782/AbstractPlanarVector.java | 35 + .../generics/6372782/AbstractVector.java | 33 + .../generics/6372782/AdditionDefined.java | 25 + .../generics/6372782/AdditiveClosure.java | 27 + .../tools/javac/generics/6372782/Element.java | 28 + .../6372782/MultiplicationDefined.java | 25 + .../javac/generics/6372782/PlainForm.java | 29 + .../generics/6372782/PlainPlanarVector.java | 37 + .../javac/generics/6372782/PlanarVector.java | 32 + .../6372782/PlanarVectorVariable.java | 32 + .../tools/javac/generics/6372782/Ring.java | 28 + .../tools/javac/generics/6372782/Scalar.java | 29 + .../tools/javac/generics/6372782/State.java | 24 + .../javac/generics/6372782/T6372782.java | 46 + .../tools/javac/generics/6372782/Value.java | 29 + .../javac/generics/6372782/VariableForm.java | 29 + .../tools/javac/generics/6372782/Vector.java | 32 + .../javac/generics/6413682/T6413682.java | 36 + .../tools/javac/generics/6413682/TestPos.java | 128 + .../test/tools/javac/generics/6495506/A.java | 36 + .../javac/generics/6495506/T6495506.java | 37 + .../test/tools/javac/generics/ArrayClone.java | 50 + .../tools/javac/generics/ArrayTypearg.java | 41 + .../tools/javac/generics/BridgeClash.java | 41 + .../tools/javac/generics/BridgeOrder.java | 69 + .../tools/javac/generics/BridgeRestype.java | 42 + .../test/tools/javac/generics/CastCrash.java | 44 + .../test/tools/javac/generics/Casting.java | 61 + .../test/tools/javac/generics/Casting2.java | 41 + .../test/tools/javac/generics/Casting3.java | 39 + .../test/tools/javac/generics/Casting4.java | 42 + .../tools/javac/generics/CatchTyparam.java | 41 + .../tools/javac/generics/Conditional.java | 92 + .../test/tools/javac/generics/Covar2.java | 63 + .../test/tools/javac/generics/Covar3.java | 44 + .../test/tools/javac/generics/Covar4.java | 40 + .../test/tools/javac/generics/Crash01.java | 41 + .../test/tools/javac/generics/Crash02.java | 47 + .../javac/generics/CyclicInheritance3.java | 36 + .../javac/generics/CyclicInheritance5.java | 39 + .../javac/generics/ErasureClashCrash.java | 40 + .../tools/javac/generics/ExtendedRaw1.java | 45 + .../tools/javac/generics/ExtendedRaw2.java | 58 + .../tools/javac/generics/ExtendedRaw3.java | 43 + .../tools/javac/generics/ExtendedRaw4.java | 33 + .../tools/javac/generics/FinalBridge.java | 44 + .../test/tools/javac/generics/GenLit1.java | 41 + .../test/tools/javac/generics/GenLit2.java | 37 + .../tools/javac/generics/GenericAnonCtor.java | 51 + .../tools/javac/generics/GenericMerge.java | 46 + .../tools/javac/generics/GenericOverride.java | 43 + .../javac/generics/GenericThrowable.java | 34 + .../test/tools/javac/generics/GetClass.java | 37 + .../test/tools/javac/generics/GetClass2.java | 38 + .../javac/generics/InheritanceConflict.java | 41 + .../javac/generics/InheritanceConflict2.java | 42 + .../javac/generics/InheritanceConflict3.java | 41 + .../tools/javac/generics/InnerInterface1.java | 54 + .../tools/javac/generics/InnerInterface2.java | 52 + .../tools/javac/generics/InstanceOf1.java | 37 + .../tools/javac/generics/InstanceOf2.java | 37 + .../tools/javac/generics/InstanceOf3.java | 37 + .../tools/javac/generics/InterfaceCast1.java | 55 + .../test/tools/javac/generics/LoadOrder.java | 37 + .../tools/javac/generics/MissingBridge.java | 60 + .../tools/javac/generics/MissingCast.java | 44 + .../tools/javac/generics/Multibound1.java | 39 + .../javac/generics/MultipleInheritance.java | 44 + .../test/tools/javac/generics/NameOrder.java | 48 + .../test/tools/javac/generics/Nonlinear.java | 125 + .../javac/generics/ParametricException.java | 103 + .../tools/javac/generics/ParenVerify.java | 56 + .../tools/javac/generics/PermuteBound.java | 58 + .../tools/javac/generics/PrimitiveClass.java | 37 + .../javac/generics/PrimitiveVariant.java | 45 + .../test/tools/javac/generics/RawClient.java | 47 + .../test/tools/javac/generics/RefEqual.java | 39 + .../tools/javac/generics/RelaxedArrays.java | 49 + .../tools/javac/generics/ReverseOrder.java | 42 + .../tools/javac/generics/SelfImplement.java | 42 + .../tools/javac/generics/SilentUnchecked.java | 41 + .../tools/javac/generics/SuperTypeargs.java | 168 + .../test/tools/javac/generics/T4661029.java | 36 + .../test/tools/javac/generics/T4683314.java | 41 + .../test/tools/javac/generics/T4684378.java | 47 + .../test/tools/javac/generics/T4695348.java | 35 + .../test/tools/javac/generics/T4695415.java | 37 + .../test/tools/javac/generics/T4695847.java | 44 + .../test/tools/javac/generics/T4711570.java | 70 + .../test/tools/javac/generics/T4711572.java | 50 + .../test/tools/javac/generics/T4711694.java | 58 + .../test/tools/javac/generics/T4738171.java | 35 + .../test/tools/javac/generics/T4739399.java | 43 + .../test/tools/javac/generics/T4757416.java | 40 + .../test/tools/javac/generics/T4784207a.java | 41 + .../test/tools/javac/generics/T4784207b.java | 25 + .../test/tools/javac/generics/T4784219.java | 37 + .../test/tools/javac/generics/T5011073.java | 40 + .../test/tools/javac/generics/T5094318.java | 52 + .../test/tools/javac/generics/T6391995.java | 37 + .../test/tools/javac/generics/TyparamLit.java | 35 + .../javac/generics/TyparamStaticScope.java | 44 + .../javac/generics/TyparamStaticScope2.java | 39 + .../tools/javac/generics/UncheckedArray.java | 39 + .../javac/generics/UncheckedConstructor.java | 47 + .../javac/generics/UncheckedCovariance.java | 42 + .../javac/generics/UnsoundInference.java | 48 + .../test/tools/javac/generics/Varargs.java | 41 + .../test/tools/javac/generics/Varargs2.java | 52 + .../test/tools/javac/generics/WrongNew.java | 48 + .../javac/generics/abstract/T4717181c.java | 39 + .../test/tools/javac/generics/bridge1/A.java | 26 + .../test/tools/javac/generics/bridge1/C.java | 26 + .../test/tools/javac/generics/bridge1/D.java | 51 + .../test/tools/javac/generics/bridge1/E.java | 26 + .../generics/classreader/HArrayMethod.java | 37 + .../javac/generics/classreader/HMember.java | 26 + .../javac/generics/classreader/HMethod.java | 25 + .../generics/classreader/HMethodImpl.java | 28 + .../generics/compat/CovariantCompat1.java | 41 + .../generics/compat/CovariantCompat2.java | 29 + .../generics/compat/OverrideBridge1.java | 50 + .../generics/compat/OverrideBridge2.java | 28 + .../generics/compat/OverrideBridge3.java | 27 + .../javac/generics/compat/VisibleBridge.java | 41 + .../ForwardSeparateBound1.java | 30 + .../ForwardSeparateBound2.java | 38 + .../javac/generics/genericAbstract/A.java | 35 + .../javac/generics/genericAbstract/B.java | 27 + .../generics/inference/4941882/T4941882.java | 38 + .../generics/inference/4942040/T4942040.java | 38 + .../generics/inference/4954546/T4954546.java | 52 + .../generics/inference/4972073/T4972073.java | 53 + .../generics/inference/4972073/T4972073a.java | 46 + .../generics/inference/4972073/T4972073b.java | 43 + .../generics/inference/5003431/T5003431.java | 39 + .../generics/inference/5021635/T5021635.java | 38 + .../generics/inference/5021635/T6299211.java | 35 + .../generics/inference/5034571/T5034571.java | 53 + .../generics/inference/5042462/T5042462.java | 36 + .../generics/inference/5044646/T5044646.java | 30 + .../generics/inference/5044646/p1/A1.java | 28 + .../generics/inference/5044646/p1/B.java | 28 + .../generics/inference/5044646/p1/C.java | 28 + .../generics/inference/5044646/p2/A2.java | 26 + .../generics/inference/5049523/T5049523.java | 40 + .../generics/inference/5070671/T5070671.java | 53 + .../5073060/GenericsAndPackages.java | 49 + .../javac/generics/inference/5073060/Neg.java | 34 + .../generics/inference/5073060/NegHelper.java | 28 + .../generics/inference/5073060/T5073060.java | 59 + .../generics/inference/5073060/T5073060a.java | 55 + .../generics/inference/5080917/T5080917.java | 40 + .../javac/generics/inference/5081782/Neg.java | 37 + .../javac/generics/inference/5081782/Pos.java | 43 + .../generics/inference/6215213/T6215213.java | 61 + .../generics/inference/6222762/T6222762.java | 40 + .../generics/inference/6240565/T6240565.java | 45 + .../generics/inference/6273455/T6273455.java | 51 + .../generics/inference/6278587/T6278587.java | 45 + .../inference/6278587/T6278587Neg.java | 42 + .../generics/inference/6302954/T6456971.java | 44 + .../generics/inference/6302954/T6476073.java | 38 + .../javac/generics/inference/6302954/X.java | 34 + .../generics/inference/6356673/Test.java | 46 + .../generics/inference/6359106/Orig.java | 49 + .../generics/inference/6359106/T6359106.java | 48 + .../generics/inference/6365166/NewTest.java | 76 + .../generics/inference/6468384/T6468384.java | 61 + .../tools/javac/generics/odersky/BadTest.java | 54 + .../javac/generics/odersky/BadTest2.java | 55 + .../javac/generics/odersky/BadTest3.java | 62 + .../javac/generics/odersky/BadTest4.java | 65 + .../tools/javac/generics/odersky/Cell.java | 29 + .../tools/javac/generics/odersky/List.java | 232 + .../tools/javac/generics/odersky/Test.java | 66 + .../tools/javac/generics/odersky/Test2.java | 53 + .../tools/javac/generics/odersky/Test3.java | 57 + .../tools/javac/generics/odersky/Test4.java | 60 + .../javac/generics/parametricException/J.java | 36 + .../javac/generics/parametricException/K.java | 28 + .../test/tools/javac/generics/rare/Rare1.java | 47 + .../tools/javac/generics/rare/Rare10.java | 46 + .../tools/javac/generics/rare/Rare11.java | 44 + .../test/tools/javac/generics/rare/Rare2.java | 44 + .../test/tools/javac/generics/rare/Rare3.java | 44 + .../test/tools/javac/generics/rare/Rare4.java | 44 + .../test/tools/javac/generics/rare/Rare5.java | 44 + .../test/tools/javac/generics/rare/Rare6.java | 46 + .../test/tools/javac/generics/rare/Rare7.java | 45 + .../test/tools/javac/generics/rare/Rare8.java | 45 + .../test/tools/javac/generics/rare/Rare9.java | 48 + .../generics/rawOverride/AttributeSet.java | 92 + .../javac/generics/rawOverride/Fail1.java | 44 + .../javac/generics/rawOverride/T6178365.java | 48 + .../javac/generics/rawOverride/Warn1.java | 43 + .../javac/generics/rawOverride/Warn2.java | 41 + .../generics/rawSeparate/CharScanner.java | 29 + .../javac/generics/rawSeparate/Hashtable.java | 29 + .../generics/rawSeparate/RetroLexer.java | 44 + .../javac/generics/syntax/6318240/Bar.java | 37 + .../generics/syntax/6318240/BarNeg1.java | 37 + .../generics/syntax/6318240/BarNeg1a.java | 37 + .../generics/syntax/6318240/BarNeg2.java | 37 + .../generics/syntax/6318240/BarNeg2a.java | 37 + .../javac/generics/syntax/6318240/Foo.java | 40 + .../tools/javac/generics/typeargs/Basic.java | 64 + .../javac/generics/typeargs/Metharg1.java | 64 + .../javac/generics/typeargs/Metharg2.java | 64 + .../javac/generics/typeargs/Newarg1.java | 43 + .../javac/generics/typeargs/Newarg2.java | 44 + .../javac/generics/typeargs/Superarg1.java | 64 + .../javac/generics/typeargs/Superarg2.java | 64 + .../javac/generics/typeargs/ThisArg.java | 64 + .../generics/typevars/4856983/T4856983.java | 42 + .../generics/typevars/4856983/T4856983a.java | 37 + .../generics/typevars/4856983/T4856983b.java | 35 + .../typevars/5060485/Compatibility.java | 37 + .../generics/typevars/5060485/Method.java | 41 + .../javac/generics/typevars/5060485/Neg1.java | 34 + .../javac/generics/typevars/5060485/Neg2.java | 33 + .../javac/generics/typevars/5060485/Pos.java | 33 + .../generics/typevars/5060485/T5060485.java | 35 + .../javac/generics/typevars/5061359/Base.java | 28 + .../javac/generics/typevars/5061359/Intf.java | 28 + .../generics/typevars/5061359/T5061359.java | 45 + .../generics/typevars/5061359/T5061359a.java | 40 + .../generics/typevars/5061359/T5061359b.java | 43 + .../generics/typevars/6182630/T6182630.java | 53 + .../generics/typevars/6182630/T6182630a.java | 33 + .../generics/typevars/6182630/T6182630b.java | 33 + .../generics/typevars/6182630/T6182630c.java | 33 + .../generics/typevars/6182630/T6182630d.java | 33 + .../generics/typevars/6182630/T6182630e.java | 33 + .../generics/typevars/6182630/T6182630f.java | 33 + .../generics/typevars/6199146/T6199146.java | 41 + .../generics/typevars/6486430/T6486430.java | 38 + .../generics/typevars/6486430/T6486430a.java | 38 + .../generics/wildcards/6320612/T6320612.java | 37 + .../generics/wildcards/6330931/T6330931.java | 42 + .../javac/generics/wildcards/6437894/A.java | 27 + .../javac/generics/wildcards/6437894/B.java | 28 + .../generics/wildcards/6437894/T6437894.java | 18 + .../generics/wildcards/6437894/T6437894.out | 2 + .../wildcards/AssignmentDifferentTypes1.java | 50 + .../wildcards/AssignmentDifferentTypes2.java | 47 + .../wildcards/AssignmentDifferentTypes3.java | 47 + .../wildcards/AssignmentDifferentTypes4.java | 47 + .../wildcards/AssignmentDifferentTypes5.java | 47 + .../wildcards/AssignmentDifferentTypes6.java | 47 + .../wildcards/AssignmentDifferentTypes7.java | 47 + .../wildcards/AssignmentDifferentTypes8.java | 47 + .../wildcards/AssignmentDifferentTypes9.java | 47 + .../wildcards/AssignmentSameType1.java | 55 + .../wildcards/AssignmentSameType2.java | 44 + .../wildcards/AssignmentSameType3.java | 44 + .../wildcards/AssignmentSameType4.java | 44 + .../wildcards/AssignmentSameType5.java | 44 + .../wildcards/AssignmentSameType6.java | 44 + .../wildcards/AssignmentSameType7.java | 44 + .../wildcards/AssignmentSameType8.java | 44 + .../javac/generics/wildcards/BoundBug.java | 53 + .../javac/generics/wildcards/ContraArg.java | 37 + .../javac/generics/wildcards/T5097548.java | 40 + .../javac/generics/wildcards/T5097548b.java | 44 + .../generics/wildcards/UnboundArray.java | 38 + .../generics/wildcards/neg/AmbiguousCast.java | 55 + .../javac/generics/wildcards/neg/Capture.java | 41 + .../generics/wildcards/neg/CastFail1.java | 54 + .../generics/wildcards/neg/CastFail10.java | 51 + .../generics/wildcards/neg/CastFail11.java | 58 + .../generics/wildcards/neg/CastFail12.java | 58 + .../generics/wildcards/neg/CastFail13.java | 58 + .../generics/wildcards/neg/CastFail14.java | 50 + .../generics/wildcards/neg/CastFail15.java | 49 + .../generics/wildcards/neg/CastFail16.java | 49 + .../generics/wildcards/neg/CastFail17.java | 49 + .../generics/wildcards/neg/CastFail18.java | 49 + .../generics/wildcards/neg/CastFail19.java | 49 + .../generics/wildcards/neg/CastFail2.java | 54 + .../generics/wildcards/neg/CastFail20.java | 49 + .../generics/wildcards/neg/CastFail21.java | 49 + .../generics/wildcards/neg/CastFail3.java | 54 + .../generics/wildcards/neg/CastFail4.java | 54 + .../generics/wildcards/neg/CastFail5.java | 54 + .../generics/wildcards/neg/CastFail6.java | 54 + .../generics/wildcards/neg/CastFail7.java | 54 + .../generics/wildcards/neg/CastFail8.java | 51 + .../generics/wildcards/neg/CastFail9.java | 51 + .../generics/wildcards/neg/CastWarn10.java | 49 + .../generics/wildcards/neg/CastWarn11.java | 49 + .../generics/wildcards/neg/CastWarn12.java | 49 + .../generics/wildcards/neg/CastWarn13.java | 49 + .../generics/wildcards/neg/CastWarn14.java | 184 + .../generics/wildcards/neg/CastWarn2.java | 49 + .../generics/wildcards/neg/CastWarn3.java | 49 + .../generics/wildcards/neg/CastWarn4.java | 49 + .../generics/wildcards/neg/CastWarn5.java | 49 + .../generics/wildcards/neg/CastWarn6.java | 49 + .../generics/wildcards/neg/CastWarn7.java | 49 + .../generics/wildcards/neg/CastWarn8.java | 49 + .../generics/wildcards/neg/CastWarn9.java | 49 + .../generics/wildcards/neg/ParamCast.java | 40 + .../generics/wildcards/neg/Readonly.java | 40 + .../generics/wildcards/neg/Unbounded.java | 39 + .../wildcards/pos/AmbiguousCast2.java | 45 + .../wildcards/pos/BoundsCollision.java | 45 + .../javac/generics/wildcards/pos/Capture.java | 43 + .../generics/wildcards/pos/CastTest.java | 149 + .../generics/wildcards/pos/InstanceOf.java | 50 + .../generics/wildcards/pos/ParamCast.java | 40 + .../wildcards/pos/RvalConversion.java | 48 + .../wildcards/pos/UncheckedCast1.java | 37 + langtools/test/tools/javac/ignored.jtx | 3 + .../NewBeforeOuterConstructed.java | 52 + .../NewBeforeOuterConstructed2.java | 55 + .../NewBeforeOuterConstructed3.java | 46 + .../implicitThis/WhichImplicitThis1.java | 49 + .../implicitThis/WhichImplicitThis10.java | 46 + .../implicitThis/WhichImplicitThis11.java | 44 + .../implicitThis/WhichImplicitThis2.java | 51 + .../implicitThis/WhichImplicitThis3.java | 52 + .../implicitThis/WhichImplicitThis4.java | 58 + .../implicitThis/WhichImplicitThis5.java | 53 + .../implicitThis/WhichImplicitThis6.java | 40 + .../implicitThis/WhichImplicitThis7.java | 54 + .../implicitThis/WhichImplicitThis9.java | 61 + .../javac/importChecks/ImportCanonical1.java | 35 + .../javac/importChecks/ImportCanonical2.java | 27 + .../importChecks/ImportIsFullyQualified.java | 38 + .../javac/importChecks/ImportOfOwnClass.java | 39 + .../importChecks/InvalidImportsNoClasses.java | 33 + .../javac/importContext/anonPackage/Foo.java | 41 + .../importContext/anonPackage/bar/Baz.java | 28 + .../importContext/namedPackage/Dummy.java | 33 + .../importContext/namedPackage/bar/Baz.java | 28 + .../importContext/namedPackage/foo/Foo.java | 34 + langtools/test/tools/javac/importscope/A.java | 37 + langtools/test/tools/javac/importscope/B.java | 34 + .../javac/incompatibleNoninherited/A.java | 36 + .../javac/incompatibleNoninherited/B.java | 31 + .../inheritAccess/PvtMbrsNotInherit1.java | 42 + .../MethodReferenceQualification_1.java | 56 + .../tools/javac/inheritedAccess/P1/priv.java | 29 + .../tools/javac/inheritedAccess/P1/pub.java | 27 + .../tools/javac/innerClassFile/Driver.java | 33 + .../test/tools/javac/innerClassFile/Driver.sh | 71 + .../test/tools/javac/innerClassFile/x/B.java | 30 + .../test/tools/javac/innerClassFile/x/C.java | 28 + .../tools/javac/innerClassFile/y/Main.java | 30 + .../test/tools/javac/innerClassFile/y/R1.java | 30 + .../test/tools/javac/innerClassFile/y/R2.java | 29 + .../test/tools/javac/innerClassFile/y/R3.java | 30 + langtools/test/tools/javac/javazip/A.java | 27 + langtools/test/tools/javac/javazip/Test.sh | 109 + langtools/test/tools/javac/javazip/bad/B.java | 25 + .../test/tools/javac/javazip/good/B.java | 26 + .../tools/javac/jvm/6397652/T6397652.java | 38 + .../jvm/6397652/com/test/Test$Test$Test.java | 8 + .../javac/jvm/6397652/com/test/Test$Test.java | 8 + .../javac/jvm/6397652/com/test/Test.java | 31 + .../test/tools/javac/limits/ArrayDims1.java | 63 + .../test/tools/javac/limits/ArrayDims2.java | 63 + .../test/tools/javac/limits/ArrayDims3.java | 63 + .../test/tools/javac/limits/ArrayDims4.java | 63 + .../test/tools/javac/limits/ArrayDims5.java | 52 + .../test/tools/javac/limits/CodeSize.java | 656 +++ .../tools/javac/limits/FinallyNesting.java | 68 + .../test/tools/javac/limits/LongName.java | 39 + .../test/tools/javac/limits/NumArgs1.java | 552 +++ .../test/tools/javac/limits/NumArgs2.java | 550 +++ .../test/tools/javac/limits/NumArgs3.java | 292 ++ .../test/tools/javac/limits/NumArgs4.java | 291 ++ .../test/tools/javac/limits/PoolSize1.java | 3356 +++++++++++++ .../test/tools/javac/limits/PoolSize2.java | 3359 +++++++++++++ .../test/tools/javac/limits/StringLength.java | 49 + langtools/test/tools/javac/links/T.java | 32 + langtools/test/tools/javac/links/b/B.java | 26 + langtools/test/tools/javac/links/links.sh | 65 + .../test/tools/javac/lint/Deprecation.java | 38 + .../test/tools/javac/lint/FallThrough.java | 47 + langtools/test/tools/javac/lint/NoWarn.java | 15 + langtools/test/tools/javac/lint/NoWarn1.out | 2 + langtools/test/tools/javac/lint/NoWarn2.out | 0 .../test/tools/javac/lint/Unchecked.java | 37 + .../javac/mandatoryWarnings/deprecated/A.java | 16 + .../javac/mandatoryWarnings/deprecated/B.java | 19 + .../javac/mandatoryWarnings/deprecated/P.java | 12 + .../javac/mandatoryWarnings/deprecated/Q.java | 18 + .../mandatoryWarnings/deprecated/Test.java | 137 + .../mandatoryWarnings/deprecated/Test1.out | 2 + .../mandatoryWarnings/deprecated/Test2.out | 2 + .../mandatoryWarnings/deprecated/Test3.out | 3 + .../mandatoryWarnings/deprecated/Test3b.out | 3 + .../mandatoryWarnings/deprecated/Test4.out | 7 + .../mandatoryWarnings/deprecated/Test4b.out | 3 + .../mandatoryWarnings/deprecated/Test4c.out | 4 + .../mandatoryWarnings/deprecated/Test4d.out | 5 + .../mandatoryWarnings/deprecated/Test5.out | 4 + .../mandatoryWarnings/deprecated/Test5b.out | 4 + .../javac/mandatoryWarnings/unchecked/A.java | 17 + .../javac/mandatoryWarnings/unchecked/B.java | 18 + .../mandatoryWarnings/unchecked/Test.java | 123 + .../mandatoryWarnings/unchecked/Test1.out | 2 + .../mandatoryWarnings/unchecked/Test2.out | 2 + .../mandatoryWarnings/unchecked/Test3.out | 3 + .../mandatoryWarnings/unchecked/Test3b.out | 3 + .../mandatoryWarnings/unchecked/Test4.out | 6 + .../mandatoryWarnings/unchecked/Test4b.out | 3 + .../mandatoryWarnings/unchecked/Test4c.out | 4 + .../mandatoryWarnings/unchecked/Test4d.out | 5 + .../javac/miranda/4686148/AbstractTest.java | 28 + .../javac/miranda/4686148/ConcreteTest.java | 32 + .../tools/javac/miranda/4686148/Test.java | 39 + .../tools/javac/miranda/4686811/Tryit.java | 31 + .../tools/javac/miranda/4686811/p1/A.java | 28 + .../tools/javac/miranda/4686811/p1/C.java | 28 + .../tools/javac/miranda/4686811/p2/B.java | 30 + .../test/tools/javac/miranda/4711056/T1.java | 38 + .../test/tools/javac/miranda/4711056/T2.java | 26 + .../test/tools/javac/miranda/4711056/T3.java | 26 + .../test/tools/javac/miranda/4711056/T4.java | 26 + .../test/tools/javac/miranda/T4279316a.java | 45 + .../test/tools/javac/miranda/T4279316b.java | 45 + .../test/tools/javac/miranda/T4279316c.java | 45 + .../test/tools/javac/miranda/T4279316d.java | 45 + .../test/tools/javac/miranda/T4528315.java | 53 + .../test/tools/javac/miranda/T4666866.java | 10 + .../test/tools/javac/miranda/T4666866.out | 4 + .../test/tools/javac/miranda/T4711325.java | 41 + .../test/tools/javac/missingClass/A.java | 34 + .../test/tools/javac/missingClass/B.java | 24 + .../MissingSuperRecovery.java | 17 + .../MissingSuperRecovery.out | 5 + .../javac/missingSuperRecovery/impl.class | Bin 0 -> 239 bytes .../mixedTarget/CompatibleAbstracts1.java | 55 + .../mixedTarget/CompatibleAbstracts2.java | 32 + .../mixedTarget/CompatibleAbstracts3.java | 27 + .../mixedTarget/CompatibleAbstracts4.java | 29 + .../mixedTarget/CompatibleAbstracts5.java | 29 + .../javac/mixedTarget/ExtendCovariant1.java | 47 + .../javac/mixedTarget/ExtendCovariant2.java | 51 + .../tools/javac/nested/4903103/T4903103.java | 35 + .../test/tools/javac/nested/5009484/X.java | 52 + .../test/tools/javac/nested/5009484/Y.java | 37 + .../test/tools/javac/newlines/Newlines.sh | 80 + .../test/tools/javac/overload/T4494762.java | 59 + .../test/tools/javac/overload/T4723909.java | 49 + .../test/tools/javac/overload/T4743490.java | 48 + .../test/tools/javac/overload/T5090220.java | 41 + .../test/tools/javac/overrridecrash/A.java | 26 + .../test/tools/javac/overrridecrash/B.java | 36 + langtools/test/tools/javac/p1/AS.java | 33 + langtools/test/tools/javac/p1/BS.java | 33 + langtools/test/tools/javac/p1/CS.java | 33 + .../test/tools/javac/packone/Mediator.java | 34 + .../test/tools/javac/packone/Secret.java | 34 + langtools/test/tools/javac/policy/A.java | 41 + langtools/test/tools/javac/policy/B.java | 20 + langtools/test/tools/javac/policy/C.java | 20 + langtools/test/tools/javac/policy/D.java | 40 + langtools/test/tools/javac/policy/Test.java | 91 + .../test/tools/javac/policy/byfile.ABD.out | 11 + .../test/tools/javac/policy/byfile.ACD.out | 16 + .../test/tools/javac/policy/bytodo.ABD.out | 23 + .../test/tools/javac/policy/bytodo.ACD.out | 24 + .../test/tools/javac/policy/simple.ABD.out | 11 + .../test/tools/javac/policy/simple.ACD.out | 16 + .../test/tools/javac/positions/T6253161.java | 36 + .../test/tools/javac/positions/T6253161.out | 2 + .../test/tools/javac/positions/T6253161a.java | 28 + .../test/tools/javac/positions/T6253161a.out | 2 + .../test/tools/javac/positions/T6264029.java | 18 + .../test/tools/javac/positions/T6264029.out | 3 + .../test/tools/javac/positions/T6402077.java | 76 + .../test/tools/javac/positions/T6404194.java | 86 + .../javac/processing/6348193/T6348193.java | 187 + .../tools/javac/processing/6348499/A.java | 43 + .../javac/processing/6348499/T6348499.java | 83 + .../processing/6350124/HelloWorldAP.java | 87 + .../javac/processing/6350124/Marked.java | 26 + .../javac/processing/6350124/Marker.java | 24 + .../javac/processing/6350124/T6350124.java | 104 + .../tools/javac/processing/6359313/Foo.java | 25 + .../javac/processing/6359313/T6359313.java | 45 + .../processing/6359313/package-info.java | 25 + .../javac/processing/6365040/ProcBar.java | 43 + .../javac/processing/6365040/ProcFoo.java | 43 + .../javac/processing/6365040/T6365040.java | 55 + .../javac/processing/6378728/T6378728.java | 84 + .../javac/processing/6413690/T6413690.java | 65 + .../javac/processing/6413690/TestMe.java | 24 + .../javac/processing/6413690/src/Super.java | 24 + .../tools/javac/processing/6414633/A.java | 45 + .../javac/processing/6414633/T6414633.java | 76 + .../javac/processing/6430209/T6430209.java | 86 + .../javac/processing/6430209/b6341534.java | 65 + .../tools/javac/processing/6430209/test0.java | 24 + .../tools/javac/processing/6430209/test1.java | 25 + .../test/tools/javac/processing/T6439826.java | 98 + .../test/tools/javac/processing/Xprint.java | 42 + .../completion/TestCompletions.java | 48 + .../processing/environment/HelloWorld.java | 31 + .../environment/TestSourceVersion.java | 74 + .../round/AnnotatedElementInfo.java | 36 + .../environment/round/BuriedAnnotations.java | 47 + .../processing/environment/round/C1.java | 25 + .../processing/environment/round/C2.java | 27 + .../round/InheritedAnnotation.java | 29 + .../processing/environment/round/Part1.java | 33 + .../processing/environment/round/Part2.java | 33 + .../environment/round/SurfaceAnnotations.java | 36 + .../round/TestElementsAnnotatedWith.java | 168 + .../tools/javac/processing/errors/Foo.java | 24 + .../errors/TestFatalityOfParseErrors.java | 100 + .../errors/TestOptionSyntaxErrors.java | 59 + .../processing/errors/TestReturnCode.java | 113 + .../filer/TestFilerConstraints.java | 276 ++ .../processing/filer/TestGetResource.java | 106 + .../processing/filer/TestPackageInfo.java | 142 + .../tools/javac/processing/filer/foo/Foo.java | 25 + .../javac/processing/filer/foo/bar/FuBar.java | 27 + .../filer/foo/bar/package-info.java | 28 + .../processing/messager/6362067/T6362067.java | 40 + .../processing/messager/6362067/T6362067.out | 5 + .../processing/messager/MessagerBasics.java | 58 + .../processing/model/6194785/T6194785.java | 61 + .../processing/model/6194785/T6194785a.java | 27 + .../processing/model/6341534/T6341534.java | 62 + .../processing/model/6341534/dir/Foo.java | 25 + .../model/6341534/dir/package-info.java | 24 + .../processing/model/element/TestElement.java | 74 + .../processing/model/element/TestNames.java | 150 + .../model/element/TestPackageElement.java | 85 + .../model/element/TypeParamBounds.java | 109 + .../model/testgetallmembers/Main.java | 126 + .../model/type/MirroredTypeEx/OverEager.java | 89 + .../javac/processing/model/type/NoTypes.java | 135 + .../processing/model/type/TestTypeKind.java | 66 + .../processing/model/util/BinaryName.java | 82 + .../model/util/GetTypeElemBadArg.java | 73 + .../javac/processing/model/util/NoSupers.java | 58 + .../model/util/OverridesSpecEx.java | 123 + .../processing/model/util/Superless.java | 27 + .../processing/model/util/TypesBadArg.java | 112 + .../model/util/deprecation/Dep1.java | 72 + .../util/deprecation/ExpectedDeprecation.java | 32 + .../util/deprecation/TestDeprecation.java | 106 + .../model/util/directSupersOfErr/C1.java | 25 + .../directSupersOfErr/DirectSupersOfErr.java | 63 + .../model/util/elements/TestGetPackageOf.java | 81 + .../util/filter/ExpectedElementCounts.java | 36 + .../processing/model/util/filter/Foo1.java | 43 + .../model/util/filter/TestIterables.java | 127 + .../javac/processing/warnings/HelloWorld.java | 32 + .../warnings/TestSourceVersionWarnings.java | 75 + .../javac/processing/warnings/gold_0.out | 1 + .../processing/warnings/gold_sv_none.out | 0 .../processing/warnings/gold_sv_warn_0_2.out | 1 + .../processing/warnings/gold_sv_warn_2_3.out | 1 + .../processing/warnings/gold_sv_warn_5_6.out | 1 + .../processing/warnings/gold_unsp_warn.out | 1 + .../tools/javac/proprietary/WarnClass.java | 36 + .../tools/javac/proprietary/WarnImport.java | 38 + .../tools/javac/proprietary/WarnMethod.java | 40 + .../javac/proprietary/WarnStaticImport.java | 38 + .../tools/javac/proprietary/WarnVariable.java | 40 + .../tools/javac/proprietary/WarnWildcard.java | 38 + .../protectedAccess/ProtectedAccess_1.java | 49 + .../protectedAccess/ProtectedAccess_2.java | 37 + .../protectedAccess/ProtectedAccess_3.java | 46 + .../ProtectedMemberAccess1.java | 648 +++ .../ProtectedMemberAccess2.java | 149 + .../ProtectedMemberAccess2.out | 214 + .../ProtectedMemberAccess3.java | 114 + .../ProtectedMemberAccess3.out | 139 + .../ProtectedMemberAccess4.java | 246 + .../ProtectedMemberAccess4.out | 100 + .../ProtectedMemberAccess5/Main.java | 36 + .../ProtectedMemberAccess5/z1/Z1.java | 31 + .../ProtectedMemberAccess5/z2/Z2.java | 33 + .../javac/protectedAccess/p/SuperClass.java | 28 + .../javac/protectedAccess/pkg/SuperClass.java | 44 + .../javac/protectedInner/AnonInnerClass.java | 49 + .../javac/protectedInner/InnerClass.java | 36 + .../javac/protectedInner/Outerclass.java | 51 + .../protectedInner/mypackage/Superclass.java | 30 + .../tools/javac/protectedInner/pkg1/Base.java | 31 + .../tools/javac/protectedInner/pkg2/Sub.java | 35 + .../test/tools/javac/rawDiags/Error.java | 9 + langtools/test/tools/javac/rawDiags/Error.out | 2 + langtools/test/tools/javac/rawDiags/Note.java | 35 + langtools/test/tools/javac/rawDiags/Note.out | 2 + .../test/tools/javac/rawDiags/Warning.java | 17 + .../test/tools/javac/rawDiags/Warning.out | 2 + .../test/tools/javac/scope/6225935/Bar.java | 28 + .../test/tools/javac/scope/6225935/Baz.java | 26 + .../tools/javac/scope/6225935/Estatico4.java | 42 + .../scope/6225935/StaticImportAccess.java | 36 + .../tools/javac/scope/6225935/T6214959.java | 39 + .../tools/javac/scope/6225935/T6225935.java | 46 + .../tools/javac/scope/6225935/T6381787.java | 38 + .../test/tools/javac/scope/6225935/Test.java | 37 + .../javac/scope/6225935/a/Ambiguous.java | 28 + .../tools/javac/scope/6225935/a/Named.java | 26 + .../tools/javac/scope/6225935/a/Private.java | 33 + .../tools/javac/scope/6225935/a/Star.java | 26 + .../tools/javac/scope/6392998/T6392998.java | 49 + .../tools/javac/sourcePath/SourcePath.java | 40 + .../tools/javac/sourcePath/SourcePathA.java | 28 + .../tools/javac/sourcePath2/SourcePath2.java | 35 + .../javac/sourcePath2/p/SourcePath2A.java | 31 + .../test/tools/javac/stackmap/T4955930.java | 47 + .../test/tools/javac/stackmap/T4955930.sh | 76 + .../test/tools/javac/stackmap/UninitThis.java | 45 + .../test/tools/javac/staticImport/Ambig1.java | 49 + .../javac/staticImport/ImportInherit.java | 46 + .../javac/staticImport/ImportPrivate.java | 47 + .../staticImport/PrivateStaticImport.java | 42 + .../test/tools/javac/staticImport/Shadow.java | 50 + .../javac/staticImport/StaticImport.java | 47 + .../javac/staticImport/StaticImport2.java | 49 + .../StaticQualifiedNew.java | 39 + .../tools/javac/staticQualifiedNew/p2/X.java | 32 + .../test/tools/javac/unicode/FirstChar.java | 31 + .../test/tools/javac/unicode/FirstChar2.java | 28 + .../tools/javac/unicode/NonasciiDigit.java | 37 + .../tools/javac/unicode/NonasciiDigit2.java | 37 + .../test/tools/javac/unicode/SubChar.java | 48 + .../javac/unicode/SupplementaryJavaID1.java | 53 + .../javac/unicode/SupplementaryJavaID2.java | 36 + .../javac/unicode/SupplementaryJavaID3.java | 36 + .../javac/unicode/SupplementaryJavaID4.java | 38 + .../javac/unicode/SupplementaryJavaID5.java | 38 + .../javac/unicode/SupplementaryJavaID6.java | 43 + .../javac/unicode/SupplementaryJavaID6.sh | 109 + .../test/tools/javac/unicode/TripleQuote.java | 36 + .../tools/javac/unicode/UnicodeAtEOL.java | 40 + .../unicode/UnicodeCommentDelimiter.java | 49 + .../tools/javac/unicode/UnicodeNewline.java | 12 + .../tools/javac/unicode/UnicodeNewline.out | 6 + .../tools/javac/unicode/UnicodeUnicode.java | 37 + .../test/tools/javac/unicode/Unmappable.java | 38 + langtools/test/tools/javac/unit/T6198196.java | 62 + .../util/convert/EnclosingCandidates.java | 69 + .../javac/unit/util/list/AbstractList.java | 74 + .../tools/javac/unit/util/list/FromArray.java | 59 + .../javac/util/filemanager/TestName.java | 49 + .../test/tools/javac/util/list/TList.java | 555 +++ langtools/test/tools/javac/varargs/Anon.java | 55 + .../test/tools/javac/varargs/BadSyntax2.java | 42 + .../test/tools/javac/varargs/Varargs1.java | 64 + .../tools/javac/varargs/VarargsOverride.java | 42 + langtools/test/tools/javac/varargs/Warn1.java | 43 + langtools/test/tools/javac/varargs/Warn2.java | 43 + .../tools/javac/varargs/warning/Warn1.java | 42 + .../tools/javac/varargs/warning/Warn2.java | 40 + .../tools/javac/varargs/warning/Warn3.java | 40 + langtools/test/tools/javac/versionOpt.sh | 87 + .../javac/versions/CheckClassFileVersion.java | 60 + langtools/test/tools/javac/versions/check.sh | 108 + .../test/tools/javac/warnings/DepAnn.java | 89 + .../tools/javac/warnings/Deprecation.java | 57 + .../javac/warnings/Deprecation.lintAll.out | 3 + .../warnings/Deprecation.lintDeprecation.out | 3 + .../javac/warnings/Deprecation.noLint.out | 2 + .../test/tools/javac/warnings/DivZero.java | 147 + .../tools/javac/warnings/DivZero.lint.out | 29 + .../tools/javac/warnings/DivZero.noLint.out | 0 .../tools/javac/warnings/FallThrough.java | 62 + .../javac/warnings/FallThrough.lintAll.out | 2 + .../warnings/FallThrough.lintFallThrough.out | 2 + .../javac/warnings/FallThrough.noLint.out | 0 .../test/tools/javac/warnings/Finally.java | 99 + .../test/tools/javac/warnings/Serial.java | 82 + .../test/tools/javac/warnings/Unchecked.java | 60 + .../javac/warnings/Unchecked.lintAll.out | 3 + .../warnings/Unchecked.lintUnchecked.out | 3 + .../tools/javac/warnings/Unchecked.noLint.out | 2 + .../test/tools/javadoc/BooleanConst.java | 70 + .../tools/javadoc/BreakIteratorWarning.java | 64 + .../test/tools/javadoc/FlagsTooEarly.java | 61 + .../tools/javadoc/InlineTagsWithBraces.java | 80 + langtools/test/tools/javadoc/LangVers.java | 74 + langtools/test/tools/javadoc/MethodLinks.java | 68 + langtools/test/tools/javadoc/NoStar.java | 61 + .../tools/javadoc/T4994049/FileWithTabs.java | 26 + .../test/tools/javadoc/T4994049/T4994049.java | 63 + langtools/test/tools/javadoc/XWerror.java | 51 + .../annotateMethodsFields/Main.java | 79 + .../annotateMethodsFields/expected.out | 22 + .../annotateMethodsFields/pkg1/A.java | 32 + .../annotateMethodsFields/pkg1/B.java | 33 + .../annotateMethodsFields/pkg1/E.java | 29 + .../annotations/annotatePackage/Main.java | 66 + .../annotations/annotatePackage/expected.out | 21 + .../annotations/annotatePackage/pkg1/A.java | 31 + .../annotatePackage/pkg1/package-info.java | 35 + .../annotatePackage/pkg1/package.html | 19 + .../annotations/annotatePackage/pkg2/B.java | 30 + .../annotatePackage/pkg2/package.html | 11 + .../annotations/annotateParams/Main.java | 73 + .../annotations/annotateParams/expected.out | 17 + .../annotations/annotateParams/pkg1/A.java | 28 + .../annotations/annotateParams/pkg1/C.java | 35 + .../javadoc/annotations/badVals/Main.java | 53 + .../javadoc/annotations/badVals/pkg1/A.java | 46 + .../javadoc/annotations/defaults/Main.java | 68 + .../javadoc/annotations/defaults/expected.out | 55 + .../javadoc/annotations/defaults/pkg1/A.java | 36 + .../javadoc/annotations/defaults/pkg1/B.java | 34 + .../annotations/elementTypes/Main.java | 62 + .../annotations/elementTypes/expected.out | 17 + .../annotations/elementTypes/pkg1/A.java | 36 + .../annotations/elementTypes/pkg1/B.java | 36 + .../javadoc/annotations/shortcuts/Main.java | 58 + .../annotations/shortcuts/expected.out | 6 + .../javadoc/annotations/shortcuts/pkg1/A.java | 30 + .../annotations/shortcuts/pkg1/Array.java | 28 + .../annotations/shortcuts/pkg1/Marker.java | 27 + .../annotations/shortcuts/pkg1/Value.java | 28 + .../test/tools/javadoc/badSuper/BadSuper.java | 39 + .../test/tools/javadoc/badSuper/p/A.java | 27 + .../test/tools/javadoc/badSuper/p/B.java | 30 + .../completionFailure/CompletionFailure.java | 50 + .../javadoc/completionFailure/pkg/A.java | 27 + .../javadoc/completionFailure/pkg/B.java | 27 + langtools/test/tools/javadoc/dupOk/DupOk.java | 61 + .../test/tools/javadoc/dupOk/sp1/p/A.java | 28 + .../test/tools/javadoc/dupOk/sp2/p/A.java | 26 + .../test/tools/javadoc/dupOk/sp2/p/B.java | 28 + .../tools/javadoc/enum/docComments/Main.java | 77 + .../enum/docComments/pkg1/Operation.java | 53 + .../tools/javadoc/enum/enumType/Main.java | 56 + .../tools/javadoc/enum/enumType/expected.out | 18 + .../enum/enumType/pkg1/QuotablePerson.java | 77 + .../javadoc/generics/genericClass/Main.java | 56 + .../generics/genericClass/expected.out | 16 + .../javadoc/generics/genericClass/pkg1/A.java | 34 + .../generics/genericInnerAndOuter/Main.java | 61 + .../genericInnerAndOuter/expected.out | 53 + .../generics/genericInnerAndOuter/pkg1/O.java | 30 + .../generics/genericInnerAndOuter/pkg1/X.java | 32 + .../generics/genericInterface/Main.java | 56 + .../generics/genericInterface/expected.out | 6 + .../generics/genericInterface/pkg1/A.java | 28 + .../javadoc/generics/genericMethod/Main.java | 59 + .../generics/genericMethod/expected.out | 20 + .../generics/genericMethod/pkg1/A.java | 30 + .../javadoc/generics/genericSuper/Main.java | 61 + .../generics/genericSuper/expected.out | 27 + .../javadoc/generics/genericSuper/pkg1/A.java | 33 + .../javadoc/generics/supertypes/Main.java | 79 + .../javadoc/generics/supertypes/expected.out | 16 + .../javadoc/generics/supertypes/pkg1/A.java | 29 + .../javadoc/generics/supertypes/pkg1/B.java | 29 + .../javadoc/generics/throwsGeneric/Main.java | 57 + .../generics/throwsGeneric/expected.out | 16 + .../generics/throwsGeneric/pkg1/A.java | 29 + .../javadoc/generics/tparamCycle/Main.java | 62 + .../generics/tparamCycle/pkg1/LikeEnum.java | 27 + .../generics/tparamTagOnMethod/Main.java | 58 + .../generics/tparamTagOnMethod/expected.out | 12 + .../generics/tparamTagOnMethod/pkg1/A.java | 34 + .../generics/tparamTagOnType/Main.java | 56 + .../generics/tparamTagOnType/expected.out | 5 + .../generics/tparamTagOnType/pkg1/A.java | 30 + .../javadoc/generics/wildcards/Main.java | 56 + .../javadoc/generics/wildcards/expected.out | 16 + .../javadoc/generics/wildcards/pkg1/A.java | 34 + langtools/test/tools/javadoc/imports/I.java | 29 + .../tools/javadoc/imports/MissingImport.java | 60 + langtools/test/tools/javadoc/lib/Tester.java | 337 ++ .../javadoc/nestedClass/NestedClass.java | 59 + .../javadoc/nestedClass/NestedClassB.java | 26 + .../tools/javadoc/outputRedirect/Test.java | 32 + .../outputRedirect/p/OutputRedirect.java | 68 + .../test/tools/javadoc/sourceOnly/Test.java | 38 + .../javadoc/sourceOnly/p/NonSource.class | Bin 0 -> 194 bytes .../javadoc/sourceOnly/p/SourceOnly.java | 44 + .../subpackageIgnore/SubpackageIgnore.java | 53 + .../pkg1/not-subpkg/SomeJavaFile.java | 22 + .../test/tools/javadoc/varArgs/Main.java | 64 + .../test/tools/javadoc/varArgs/expected.out | 4 + .../test/tools/javadoc/varArgs/pkg1/A.java | 34 + langtools/test/tools/javah/6257087/foo.java | 29 + langtools/test/tools/javah/6257087/foo.sh | 71 + langtools/test/tools/javah/6257087/foo_bar.h | 21 + langtools/test/tools/javah/ConstMacroTest.sh | 98 + .../javah/MissingParamClassException.java | 35 + .../test/tools/javah/MissingParamClassTest.sh | 126 + .../test/tools/javah/ParamClassTest.java | 41 + langtools/test/tools/javah/ReadOldClass.sh | 79 + .../test/tools/javah/SubClassConsts.java | 40 + langtools/test/tools/javah/SubClassConsts.out | 31 + langtools/test/tools/javah/SubClassConsts.win | 31 + .../test/tools/javah/SuperClassConsts.java | 66 + langtools/test/tools/javah/T5070898.java | 103 + langtools/test/tools/javap/ExtPath.java | 40 + .../javap/NotPackagePrivateInterface.java | 34 + .../test/tools/javap/PublicInterfaceTest.sh | 62 + langtools/test/tools/javap/pathsep.sh | 63 + .../test/tools/javap/stackmap/T6271292.java | 49 + .../test/tools/javap/stackmap/T6271292.out | 14 + .../test/tools/javap/stackmap/T6271292.sh | 88 + 2973 files changed, 295817 insertions(+) create mode 100644 langtools/.hgignore create mode 100644 langtools/ASSEMBLY_EXCEPTION create mode 100644 langtools/LICENSE create mode 100644 langtools/README create mode 100644 langtools/THIRD_PARTY_README create mode 100644 langtools/make/Makefile create mode 100644 langtools/make/Makefile-classic create mode 100644 langtools/make/README create mode 100644 langtools/make/build.properties create mode 100644 langtools/make/build.xml create mode 100644 langtools/make/jprt.config create mode 100644 langtools/make/jprt.properties create mode 100644 langtools/make/netbeans/README create mode 100644 langtools/make/netbeans/apt/README create mode 100644 langtools/make/netbeans/apt/build.xml create mode 100644 langtools/make/netbeans/apt/nbproject/project.xml create mode 100644 langtools/make/netbeans/common/shared.xml create mode 100644 langtools/make/netbeans/common/standard-context-menu-items-no-javadoc.ent create mode 100644 langtools/make/netbeans/common/standard-context-menu-items.ent create mode 100644 langtools/make/netbeans/common/standard-ide-actions-no-javadoc.ent create mode 100644 langtools/make/netbeans/common/standard-ide-actions.ent create mode 100644 langtools/make/netbeans/compiler/README create mode 100644 langtools/make/netbeans/compiler/build.xml create mode 100644 langtools/make/netbeans/compiler/nbproject/project.xml create mode 100644 langtools/make/netbeans/doclets/README create mode 100644 langtools/make/netbeans/doclets/build.xml create mode 100644 langtools/make/netbeans/doclets/nbproject/project.xml create mode 100644 langtools/make/netbeans/javadoc/README create mode 100644 langtools/make/netbeans/javadoc/build.xml create mode 100644 langtools/make/netbeans/javadoc/nbproject/project.xml create mode 100644 langtools/make/netbeans/javah/README create mode 100644 langtools/make/netbeans/javah/build.xml create mode 100644 langtools/make/netbeans/javah/nbproject/project.xml create mode 100644 langtools/make/netbeans/javap/README create mode 100644 langtools/make/netbeans/javap/build.xml create mode 100644 langtools/make/netbeans/javap/nbproject/project.xml create mode 100644 langtools/make/test/HelloWorld.apt.gold.txt create mode 100644 langtools/make/test/HelloWorld.gold.h create mode 100644 langtools/make/test/HelloWorld.java create mode 100644 langtools/make/test/HelloWorld.javadoc.gold.txt create mode 100644 langtools/make/test/HelloWorld.javap.gold.txt create mode 100644 langtools/make/test/README create mode 100644 langtools/make/test/TEST.ROOT create mode 100644 langtools/make/test/bootstrap/javac.sh create mode 100644 langtools/make/test/bootstrap/javadoc.sh create mode 100644 langtools/make/test/bootstrap/javah.sh create mode 100644 langtools/make/test/contents.gold.txt create mode 100644 langtools/make/test/contents.sh create mode 100644 langtools/make/test/lib/apt.sh create mode 100644 langtools/make/test/lib/classes.gold.txt create mode 100644 langtools/make/test/lib/classes.sh create mode 100644 langtools/make/test/lib/javac.sh create mode 100644 langtools/make/test/lib/javadoc.sh create mode 100644 langtools/make/test/lib/javah.sh create mode 100644 langtools/make/test/lib/javap.sh create mode 100644 langtools/make/test/lib/src.gold.txt create mode 100644 langtools/make/test/lib/src.sh create mode 100644 langtools/make/tools/CompileProperties/CompileProperties.java create mode 100644 langtools/make/tools/CompileProperties/CompilePropertiesTask.java create mode 100644 langtools/src/share/bin/launcher.sh-template create mode 100644 langtools/src/share/classes/com/sun/javadoc/AnnotationDesc.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/AnnotationTypeDoc.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/AnnotationTypeElementDoc.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/AnnotationValue.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/ClassDoc.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/ConstructorDoc.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/Doc.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/DocErrorReporter.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/Doclet.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/ExecutableMemberDoc.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/FieldDoc.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/LanguageVersion.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/MemberDoc.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/MethodDoc.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/PackageDoc.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/ParamTag.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/Parameter.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/ParameterizedType.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/ProgramElementDoc.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/RootDoc.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/SeeTag.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/SerialFieldTag.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/SourcePosition.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/Tag.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/ThrowsTag.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/Type.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/TypeVariable.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/WildcardType.java create mode 100644 langtools/src/share/classes/com/sun/javadoc/package.html create mode 100644 langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessor.java create mode 100644 langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorEnvironment.java create mode 100644 langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorFactory.java create mode 100644 langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorListener.java create mode 100644 langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessors.java create mode 100644 langtools/src/share/classes/com/sun/mirror/apt/Filer.java create mode 100644 langtools/src/share/classes/com/sun/mirror/apt/Messager.java create mode 100644 langtools/src/share/classes/com/sun/mirror/apt/RoundCompleteEvent.java create mode 100644 langtools/src/share/classes/com/sun/mirror/apt/RoundCompleteListener.java create mode 100644 langtools/src/share/classes/com/sun/mirror/apt/RoundState.java create mode 100644 langtools/src/share/classes/com/sun/mirror/apt/package.html create mode 100644 langtools/src/share/classes/com/sun/mirror/declaration/AnnotationMirror.java create mode 100644 langtools/src/share/classes/com/sun/mirror/declaration/AnnotationTypeDeclaration.java create mode 100644 langtools/src/share/classes/com/sun/mirror/declaration/AnnotationTypeElementDeclaration.java create mode 100644 langtools/src/share/classes/com/sun/mirror/declaration/AnnotationValue.java create mode 100644 langtools/src/share/classes/com/sun/mirror/declaration/ClassDeclaration.java create mode 100644 langtools/src/share/classes/com/sun/mirror/declaration/ConstructorDeclaration.java create mode 100644 langtools/src/share/classes/com/sun/mirror/declaration/Declaration.java create mode 100644 langtools/src/share/classes/com/sun/mirror/declaration/EnumConstantDeclaration.java create mode 100644 langtools/src/share/classes/com/sun/mirror/declaration/EnumDeclaration.java create mode 100644 langtools/src/share/classes/com/sun/mirror/declaration/ExecutableDeclaration.java create mode 100644 langtools/src/share/classes/com/sun/mirror/declaration/FieldDeclaration.java create mode 100644 langtools/src/share/classes/com/sun/mirror/declaration/InterfaceDeclaration.java create mode 100644 langtools/src/share/classes/com/sun/mirror/declaration/MemberDeclaration.java create mode 100644 langtools/src/share/classes/com/sun/mirror/declaration/MethodDeclaration.java create mode 100644 langtools/src/share/classes/com/sun/mirror/declaration/Modifier.java create mode 100644 langtools/src/share/classes/com/sun/mirror/declaration/PackageDeclaration.java create mode 100644 langtools/src/share/classes/com/sun/mirror/declaration/ParameterDeclaration.java create mode 100644 langtools/src/share/classes/com/sun/mirror/declaration/TypeDeclaration.java create mode 100644 langtools/src/share/classes/com/sun/mirror/declaration/TypeParameterDeclaration.java create mode 100644 langtools/src/share/classes/com/sun/mirror/declaration/package.html create mode 100644 langtools/src/share/classes/com/sun/mirror/overview.html create mode 100644 langtools/src/share/classes/com/sun/mirror/type/AnnotationType.java create mode 100644 langtools/src/share/classes/com/sun/mirror/type/ArrayType.java create mode 100644 langtools/src/share/classes/com/sun/mirror/type/ClassType.java create mode 100644 langtools/src/share/classes/com/sun/mirror/type/DeclaredType.java create mode 100644 langtools/src/share/classes/com/sun/mirror/type/EnumType.java create mode 100644 langtools/src/share/classes/com/sun/mirror/type/InterfaceType.java create mode 100644 langtools/src/share/classes/com/sun/mirror/type/MirroredTypeException.java create mode 100644 langtools/src/share/classes/com/sun/mirror/type/MirroredTypesException.java create mode 100644 langtools/src/share/classes/com/sun/mirror/type/PrimitiveType.java create mode 100644 langtools/src/share/classes/com/sun/mirror/type/ReferenceType.java create mode 100644 langtools/src/share/classes/com/sun/mirror/type/TypeMirror.java create mode 100644 langtools/src/share/classes/com/sun/mirror/type/TypeVariable.java create mode 100644 langtools/src/share/classes/com/sun/mirror/type/VoidType.java create mode 100644 langtools/src/share/classes/com/sun/mirror/type/WildcardType.java create mode 100644 langtools/src/share/classes/com/sun/mirror/type/package.html create mode 100644 langtools/src/share/classes/com/sun/mirror/util/DeclarationFilter.java create mode 100644 langtools/src/share/classes/com/sun/mirror/util/DeclarationScanner.java create mode 100644 langtools/src/share/classes/com/sun/mirror/util/DeclarationVisitor.java create mode 100644 langtools/src/share/classes/com/sun/mirror/util/DeclarationVisitors.java create mode 100644 langtools/src/share/classes/com/sun/mirror/util/Declarations.java create mode 100644 langtools/src/share/classes/com/sun/mirror/util/SimpleDeclarationVisitor.java create mode 100644 langtools/src/share/classes/com/sun/mirror/util/SimpleTypeVisitor.java create mode 100644 langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java create mode 100644 langtools/src/share/classes/com/sun/mirror/util/SourcePosition.java create mode 100644 langtools/src/share/classes/com/sun/mirror/util/TypeVisitor.java create mode 100644 langtools/src/share/classes/com/sun/mirror/util/Types.java create mode 100644 langtools/src/share/classes/com/sun/mirror/util/package.html create mode 100644 langtools/src/share/classes/com/sun/source/tree/AnnotationTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/ArrayAccessTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/ArrayTypeTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/AssertTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/AssignmentTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/BinaryTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/BlockTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/BreakTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/CaseTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/CatchTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/ClassTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/CompilationUnitTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/CompoundAssignmentTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/ConditionalExpressionTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/ContinueTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/DoWhileLoopTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/EmptyStatementTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/EnhancedForLoopTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/ErroneousTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/ExpressionStatementTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/ExpressionTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/ForLoopTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/IdentifierTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/IfTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/ImportTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/InstanceOfTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/LabeledStatementTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/LineMap.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/LiteralTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/MemberSelectTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/MethodInvocationTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/MethodTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/ModifiersTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/NewArrayTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/NewClassTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/ParameterizedTypeTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/ParenthesizedTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/PrimitiveTypeTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/ReturnTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/Scope.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/StatementTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/SwitchTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/SynchronizedTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/ThrowTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/Tree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/TreeVisitor.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/TryTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/TypeCastTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/TypeParameterTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/UnaryTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/VariableTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/WhileLoopTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/WildcardTree.java create mode 100644 langtools/src/share/classes/com/sun/source/tree/package-info.java create mode 100644 langtools/src/share/classes/com/sun/source/util/JavacTask.java create mode 100644 langtools/src/share/classes/com/sun/source/util/SimpleTreeVisitor.java create mode 100644 langtools/src/share/classes/com/sun/source/util/SourcePositions.java create mode 100644 langtools/src/share/classes/com/sun/source/util/TaskEvent.java create mode 100644 langtools/src/share/classes/com/sun/source/util/TaskListener.java create mode 100644 langtools/src/share/classes/com/sun/source/util/TreePath.java create mode 100644 langtools/src/share/classes/com/sun/source/util/TreePathScanner.java create mode 100644 langtools/src/share/classes/com/sun/source/util/TreeScanner.java create mode 100644 langtools/src/share/classes/com/sun/source/util/Trees.java create mode 100644 langtools/src/share/classes/com/sun/source/util/package-info.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/Main.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/comp/AnnotationProcessingError.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/comp/Apt.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/comp/BootstrapAPF.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/comp/PrintAP.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/comp/UsageMessageNeededException.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/main/CommandLine.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/main/Main.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/AptEnv.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/apt/AnnotationProcessorEnvironmentImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/apt/FilerImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/apt/MessagerImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/apt/RoundCompleteEventImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/apt/RoundStateImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationMirrorImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationTypeDeclarationImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationTypeElementDeclarationImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationValueImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ClassDeclarationImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/Constants.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ConstructorDeclarationImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationMaker.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/EnumConstantDeclarationImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/EnumDeclarationImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ExecutableDeclarationImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/FieldDeclarationImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/InterfaceDeclarationImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/MemberDeclarationImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/MethodDeclarationImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/PackageDeclarationImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ParameterDeclarationImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/TypeDeclarationImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/TypeParameterDeclarationImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/type/AnnotationTypeImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/type/ArrayTypeImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/type/ClassTypeImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/type/DeclaredTypeImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/type/EnumTypeImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/type/InterfaceTypeImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/type/PrimitiveTypeImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMaker.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeVariableImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/type/VoidTypeImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/type/WildcardTypeImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/util/DeclarationsImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/util/SourcePositionImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/mirror/util/TypesImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/apt/resources/apt.properties create mode 100644 langtools/src/share/classes/com/sun/tools/apt/resources/apt_ja.properties create mode 100644 langtools/src/share/classes/com/sun/tools/apt/resources/apt_zh_CN.properties create mode 100644 langtools/src/share/classes/com/sun/tools/apt/util/Bark.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/Taglet.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkOutputImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/SingleIndexWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/SplitIndexWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/StylesheetWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletOutputImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/WriterFactoryImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/package.html create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/package.html create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_ja.properties create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeOptionalMemberWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeRequiredMemberWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstructorWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/EnumConstantWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/FieldWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/MemberSummaryWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/MethodWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/NestedClassWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/PackageSummaryWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/WriterFactory.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractMemberBuilder.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/BuilderFactory.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/package.html create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/package.html create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclet.xml create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets.properties create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_ja.properties create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/doclets_zh_CN.properties create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/inherit.gif create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/BaseExecutableMemberTaglet.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/BaseInlineTaglet.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/BaseTaglet.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/CodeTaglet.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/DeprecatedTaglet.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/DocRootTaglet.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/InheritDocTaglet.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/InheritableTaglet.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/LegacyTaglet.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/LiteralTaglet.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ParamTaglet.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ReturnTaglet.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/SeeTaglet.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/SimpleTaglet.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/Taglet.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletManager.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletOutput.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/TagletWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ThrowsTaglet.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/ValueTaglet.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/taglets/package.html create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassDocCatalog.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassTree.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ClassUseMapper.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/CommentedMethodFinder.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DeprecatedAPIListBuilder.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DirectoryManager.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocFinder.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocletAbortException.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/DocletConstants.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Extern.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Group.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/ImplementedMethods.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/IndexBuilder.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MessageRetriever.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MetaKeywords.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/MethodFinder.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/PackageListWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/SourcePath.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/SourceToHTMLConverter.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/TaggedMethodFinder.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/TextTag.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/Util.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/VisibleMemberMap.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkFactory.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkInfo.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/LinkOutput.java create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/links/package.html create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/util/package.html create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/package.html create mode 100644 langtools/src/share/classes/com/sun/tools/doclets/standard/Standard.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/Launcher.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/Main.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/Server.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/api/JavacScope.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/api/JavacTaskImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/api/JavacTool.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/api/JavacTrees.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/api/WrappingJavaFileManager.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/code/Attribute.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/code/BoundKind.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/code/Flags.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/code/Kinds.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/code/Lint.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/code/Scope.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/code/Source.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/code/Symbol.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/code/Symtab.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/code/Type.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/code/TypeTags.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/code/Types.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/comp/Annotate.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/comp/Attr.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/comp/AttrContext.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/comp/AttrContextEnv.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/comp/Check.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/comp/ConstFold.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/comp/Enter.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/comp/Env.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/comp/Flow.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/comp/Infer.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/comp/Lower.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/comp/MemberEnter.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/comp/Resolve.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/comp/Todo.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/comp/TransTypes.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/jvm/ByteCodes.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/jvm/CRTFlags.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/jvm/CRTable.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/jvm/ClassFile.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/jvm/ClassReader.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/jvm/ClassWriter.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/jvm/Code.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/jvm/Gen.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/jvm/Items.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/jvm/Pool.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/jvm/Target.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/jvm/UninitializedType.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/main/CommandLine.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/main/JavaCompiler.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/main/JavacOption.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/main/Main.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/main/OptionName.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/main/RecognizedOptions.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/model/AnnotationProxyMaker.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/model/FilteredMemberList.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/model/JavacElements.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/model/JavacSourcePosition.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/model/JavacTypes.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/parser/DocCommentScanner.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/parser/EndPosParser.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/parser/Keywords.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/parser/Lexer.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/parser/Parser.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/parser/Scanner.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/parser/Token.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/processing/AnnotationProcessingError.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/processing/JavacFiler.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/processing/JavacMessager.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/processing/JavacProcessingEnvironment.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/processing/JavacRoundEnvironment.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/processing/PrintingProcessor.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/processing/ServiceProxy.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/resources/compiler.properties create mode 100644 langtools/src/share/classes/com/sun/tools/javac/resources/compiler_ja.properties create mode 100644 langtools/src/share/classes/com/sun/tools/javac/resources/compiler_zh_CN.properties create mode 100644 langtools/src/share/classes/com/sun/tools/javac/resources/javac.properties create mode 100644 langtools/src/share/classes/com/sun/tools/javac/resources/javac_ja.properties create mode 100644 langtools/src/share/classes/com/sun/tools/javac/resources/javac_zh_CN.properties create mode 100644 langtools/src/share/classes/com/sun/tools/javac/resources/legacy.properties create mode 100644 langtools/src/share/classes/com/sun/tools/javac/resources/version.properties-template create mode 100644 langtools/src/share/classes/com/sun/tools/javac/services/javax.tools.JavaCompilerTool create mode 100644 langtools/src/share/classes/com/sun/tools/javac/sym/CreateSymbols.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/tree/JCTree.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/tree/Pretty.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/tree/TreeCopier.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/tree/TreeInfo.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/tree/TreeMaker.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/tree/TreeScanner.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/tree/TreeTranslator.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/Abort.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/BaseFileObject.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/Bits.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/ByteBuffer.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/ClientCodeException.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/Constants.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/Context.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/Convert.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/DiagnosticFormatter.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/FatalError.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/JCDiagnostic.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/JavacFileManager.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/LayoutCharacters.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/List.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/ListBuffer.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/Log.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/MandatoryWarningHandler.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/Messages.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/Name.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/Old199.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/Options.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/Pair.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/Paths.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/Position.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/PropagatedException.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/util/Warner.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/zip/ZipFileIndex.java create mode 100644 langtools/src/share/classes/com/sun/tools/javac/zip/ZipFileIndexEntry.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/AbstractTypeImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/AnnotationDescImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/AnnotationTypeDocImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/AnnotationTypeElementDocImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/AnnotationValueImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/ClassDocImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/Comment.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/ConstructorDocImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/DocEnv.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/DocImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/DocLocale.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/DocletInvoker.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/ExecutableMemberDocImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/FieldDocImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/JavadocClassReader.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/JavadocEnter.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/JavadocMemberEnter.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/JavadocTodo.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/JavadocTool.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/Main.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/MemberDocImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/Messager.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/MethodDocImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/ModifierFilter.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/PackageDocImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/ParamTagImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/ParameterImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/ParameterizedTypeImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/PrimitiveType.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/ProgramElementDocImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/RootDocImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/SeeTagImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/SerialFieldTagImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/SerializedForm.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/SourcePositionImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/Start.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/TagImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/ThrowsTagImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/TypeMaker.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/TypeVariableImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/WildcardTypeImpl.java create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc.properties create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc_ja.properties create mode 100644 langtools/src/share/classes/com/sun/tools/javadoc/resources/javadoc_zh_CN.properties create mode 100644 langtools/src/share/classes/com/sun/tools/javah/Gen.java create mode 100644 langtools/src/share/classes/com/sun/tools/javah/JNI.java create mode 100644 langtools/src/share/classes/com/sun/tools/javah/LLNI.java create mode 100644 langtools/src/share/classes/com/sun/tools/javah/Main.java create mode 100644 langtools/src/share/classes/com/sun/tools/javah/MainDoclet.java create mode 100644 langtools/src/share/classes/com/sun/tools/javah/Mangle.java create mode 100644 langtools/src/share/classes/com/sun/tools/javah/TypeSignature.java create mode 100644 langtools/src/share/classes/com/sun/tools/javah/Util.java create mode 100644 langtools/src/share/classes/com/sun/tools/javah/resources/Linux_ppc.properties create mode 100644 langtools/src/share/classes/com/sun/tools/javah/resources/Linux_sparc.properties create mode 100644 langtools/src/share/classes/com/sun/tools/javah/resources/SunOS_sparc.properties create mode 100644 langtools/src/share/classes/com/sun/tools/javah/resources/SunOS_sparcv9.properties create mode 100644 langtools/src/share/classes/com/sun/tools/javah/resources/l10n.properties create mode 100644 langtools/src/share/classes/com/sun/tools/javah/resources/l10n_ja.properties create mode 100644 langtools/src/share/classes/com/sun/tools/javah/resources/l10n_zh_CN.properties create mode 100644 langtools/src/share/classes/com/sun/tools/javah/resources/win32_x86.properties create mode 100644 langtools/src/share/classes/javax/annotation/processing/AbstractProcessor.java create mode 100644 langtools/src/share/classes/javax/annotation/processing/Completion.java create mode 100644 langtools/src/share/classes/javax/annotation/processing/Completions.java create mode 100644 langtools/src/share/classes/javax/annotation/processing/Filer.java create mode 100644 langtools/src/share/classes/javax/annotation/processing/FilerException.java create mode 100644 langtools/src/share/classes/javax/annotation/processing/Messager.java create mode 100644 langtools/src/share/classes/javax/annotation/processing/ProcessingEnvironment.java create mode 100644 langtools/src/share/classes/javax/annotation/processing/Processor.java create mode 100644 langtools/src/share/classes/javax/annotation/processing/RoundEnvironment.java create mode 100644 langtools/src/share/classes/javax/annotation/processing/SupportedAnnotationTypes.java create mode 100644 langtools/src/share/classes/javax/annotation/processing/SupportedOptions.java create mode 100644 langtools/src/share/classes/javax/annotation/processing/SupportedSourceVersion.java create mode 100644 langtools/src/share/classes/javax/annotation/processing/package-info.java create mode 100644 langtools/src/share/classes/javax/lang/model/SourceVersion.java create mode 100644 langtools/src/share/classes/javax/lang/model/element/AnnotationMirror.java create mode 100644 langtools/src/share/classes/javax/lang/model/element/AnnotationValue.java create mode 100644 langtools/src/share/classes/javax/lang/model/element/AnnotationValueVisitor.java create mode 100644 langtools/src/share/classes/javax/lang/model/element/Element.java create mode 100644 langtools/src/share/classes/javax/lang/model/element/ElementKind.java create mode 100644 langtools/src/share/classes/javax/lang/model/element/ElementVisitor.java create mode 100644 langtools/src/share/classes/javax/lang/model/element/ExecutableElement.java create mode 100644 langtools/src/share/classes/javax/lang/model/element/Modifier.java create mode 100644 langtools/src/share/classes/javax/lang/model/element/Name.java create mode 100644 langtools/src/share/classes/javax/lang/model/element/NestingKind.java create mode 100644 langtools/src/share/classes/javax/lang/model/element/PackageElement.java create mode 100644 langtools/src/share/classes/javax/lang/model/element/TypeElement.java create mode 100644 langtools/src/share/classes/javax/lang/model/element/TypeParameterElement.java create mode 100644 langtools/src/share/classes/javax/lang/model/element/UnknownAnnotationValueException.java create mode 100644 langtools/src/share/classes/javax/lang/model/element/UnknownElementException.java create mode 100644 langtools/src/share/classes/javax/lang/model/element/VariableElement.java create mode 100644 langtools/src/share/classes/javax/lang/model/element/package-info.java create mode 100644 langtools/src/share/classes/javax/lang/model/overview.html create mode 100644 langtools/src/share/classes/javax/lang/model/package-info.java create mode 100644 langtools/src/share/classes/javax/lang/model/type/ArrayType.java create mode 100644 langtools/src/share/classes/javax/lang/model/type/DeclaredType.java create mode 100644 langtools/src/share/classes/javax/lang/model/type/ErrorType.java create mode 100644 langtools/src/share/classes/javax/lang/model/type/ExecutableType.java create mode 100644 langtools/src/share/classes/javax/lang/model/type/MirroredTypeException.java create mode 100644 langtools/src/share/classes/javax/lang/model/type/MirroredTypesException.java create mode 100644 langtools/src/share/classes/javax/lang/model/type/NoType.java create mode 100644 langtools/src/share/classes/javax/lang/model/type/NullType.java create mode 100644 langtools/src/share/classes/javax/lang/model/type/PrimitiveType.java create mode 100644 langtools/src/share/classes/javax/lang/model/type/ReferenceType.java create mode 100644 langtools/src/share/classes/javax/lang/model/type/TypeKind.java create mode 100644 langtools/src/share/classes/javax/lang/model/type/TypeMirror.java create mode 100644 langtools/src/share/classes/javax/lang/model/type/TypeVariable.java create mode 100644 langtools/src/share/classes/javax/lang/model/type/TypeVisitor.java create mode 100644 langtools/src/share/classes/javax/lang/model/type/UnknownTypeException.java create mode 100644 langtools/src/share/classes/javax/lang/model/type/WildcardType.java create mode 100644 langtools/src/share/classes/javax/lang/model/type/package-info.java create mode 100644 langtools/src/share/classes/javax/lang/model/util/AbstractAnnotationValueVisitor6.java create mode 100644 langtools/src/share/classes/javax/lang/model/util/AbstractElementVisitor6.java create mode 100644 langtools/src/share/classes/javax/lang/model/util/AbstractTypeVisitor6.java create mode 100644 langtools/src/share/classes/javax/lang/model/util/ElementFilter.java create mode 100644 langtools/src/share/classes/javax/lang/model/util/ElementKindVisitor6.java create mode 100644 langtools/src/share/classes/javax/lang/model/util/ElementScanner6.java create mode 100644 langtools/src/share/classes/javax/lang/model/util/Elements.java create mode 100644 langtools/src/share/classes/javax/lang/model/util/SimpleAnnotationValueVisitor6.java create mode 100644 langtools/src/share/classes/javax/lang/model/util/SimpleElementVisitor6.java create mode 100644 langtools/src/share/classes/javax/lang/model/util/SimpleTypeVisitor6.java create mode 100644 langtools/src/share/classes/javax/lang/model/util/TypeKindVisitor6.java create mode 100644 langtools/src/share/classes/javax/lang/model/util/Types.java create mode 100644 langtools/src/share/classes/javax/lang/model/util/package-info.java create mode 100644 langtools/src/share/classes/javax/tools/Diagnostic.java create mode 100644 langtools/src/share/classes/javax/tools/DiagnosticCollector.java create mode 100644 langtools/src/share/classes/javax/tools/DiagnosticListener.java create mode 100644 langtools/src/share/classes/javax/tools/FileObject.java create mode 100644 langtools/src/share/classes/javax/tools/ForwardingFileObject.java create mode 100644 langtools/src/share/classes/javax/tools/ForwardingJavaFileManager.java create mode 100644 langtools/src/share/classes/javax/tools/ForwardingJavaFileObject.java create mode 100644 langtools/src/share/classes/javax/tools/JavaCompiler.java create mode 100644 langtools/src/share/classes/javax/tools/JavaFileManager.java create mode 100644 langtools/src/share/classes/javax/tools/JavaFileObject.java create mode 100644 langtools/src/share/classes/javax/tools/OptionChecker.java create mode 100644 langtools/src/share/classes/javax/tools/SimpleJavaFileObject.java create mode 100644 langtools/src/share/classes/javax/tools/StandardJavaFileManager.java create mode 100644 langtools/src/share/classes/javax/tools/StandardLocation.java create mode 100644 langtools/src/share/classes/javax/tools/Tool.java create mode 100644 langtools/src/share/classes/javax/tools/ToolProvider.java create mode 100644 langtools/src/share/classes/javax/tools/overview.html create mode 100644 langtools/src/share/classes/javax/tools/package-info.java create mode 100644 langtools/src/share/classes/sun/tools/javap/AttrData.java create mode 100644 langtools/src/share/classes/sun/tools/javap/CPX.java create mode 100644 langtools/src/share/classes/sun/tools/javap/CPX2.java create mode 100644 langtools/src/share/classes/sun/tools/javap/ClassData.java create mode 100644 langtools/src/share/classes/sun/tools/javap/Constants.java create mode 100644 langtools/src/share/classes/sun/tools/javap/FieldData.java create mode 100644 langtools/src/share/classes/sun/tools/javap/InnerClassData.java create mode 100644 langtools/src/share/classes/sun/tools/javap/JavapEnvironment.java create mode 100644 langtools/src/share/classes/sun/tools/javap/JavapPrinter.java create mode 100644 langtools/src/share/classes/sun/tools/javap/LineNumData.java create mode 100644 langtools/src/share/classes/sun/tools/javap/LocVarData.java create mode 100644 langtools/src/share/classes/sun/tools/javap/Main.java create mode 100644 langtools/src/share/classes/sun/tools/javap/MethodData.java create mode 100644 langtools/src/share/classes/sun/tools/javap/RuntimeConstants.java create mode 100644 langtools/src/share/classes/sun/tools/javap/StackMapData.java create mode 100644 langtools/src/share/classes/sun/tools/javap/StackMapTableData.java create mode 100644 langtools/src/share/classes/sun/tools/javap/Tables.java create mode 100644 langtools/src/share/classes/sun/tools/javap/TrapData.java create mode 100644 langtools/src/share/classes/sun/tools/javap/TypeSignature.java create mode 100644 langtools/src/share/opensource/javac/Makefile create mode 100644 langtools/src/share/opensource/javac/README-template.html create mode 100644 langtools/src/share/opensource/javac/build.properties create mode 100644 langtools/src/share/opensource/javac/build.xml create mode 100644 langtools/src/share/opensource/javac/doc/document.css create mode 100644 langtools/src/share/opensource/javac/doc/javac_lifecycle/Context.html create mode 100644 langtools/src/share/opensource/javac/doc/javac_lifecycle/Enter.html create mode 100644 langtools/src/share/opensource/javac/doc/javac_lifecycle/JavaCompiler.html create mode 100644 langtools/src/share/opensource/javac/doc/javac_lifecycle/Main.html create mode 100644 langtools/src/share/opensource/javac/doc/javac_lifecycle/ToDo.html create mode 100644 langtools/src/share/opensource/javac/doc/javac_lifecycle/contents.html create mode 100644 langtools/src/share/opensource/javac/doc/javac_lifecycle/index.html create mode 100644 langtools/src/share/opensource/javac/doc/javac_lifecycle/packages.html create mode 100644 langtools/src/share/opensource/javac/doc/javac_lifecycle/style.css create mode 100644 langtools/src/share/opensource/javac/nbproject/project.xml create mode 100644 langtools/src/share/opensource/javac/src/bin/javac.sh create mode 100644 langtools/src/share/sample/javac/processing/src/CheckNamesProcessor.java create mode 100644 langtools/test/Makefile create mode 100644 langtools/test/TEST.ROOT create mode 100644 langtools/test/bootclasspath-exclude.jtx create mode 100644 langtools/test/com/sun/javadoc/AccessAsciiArt/AccessAsciiArt.java create mode 100644 langtools/test/com/sun/javadoc/AccessAsciiArt/p1/C.java create mode 100644 langtools/test/com/sun/javadoc/AccessAsciiArt/p1/I.java create mode 100644 langtools/test/com/sun/javadoc/AccessAsciiArt/p1/SC.java create mode 100644 langtools/test/com/sun/javadoc/AccessAsciiArt/p1/SI.java create mode 100644 langtools/test/com/sun/javadoc/AccessAsciiArt/p1/subpkg/SSC.java create mode 100644 langtools/test/com/sun/javadoc/AccessFrameTitle/AccessFrameTitle.java create mode 100644 langtools/test/com/sun/javadoc/AccessFrameTitle/p1/C1.java create mode 100644 langtools/test/com/sun/javadoc/AccessFrameTitle/p2/C2.java create mode 100644 langtools/test/com/sun/javadoc/AccessH1/AccessH1.java create mode 100644 langtools/test/com/sun/javadoc/AccessH1/p1/C.java create mode 100644 langtools/test/com/sun/javadoc/AccessH1/p2/C2.java create mode 100644 langtools/test/com/sun/javadoc/AccessSkipNav/AccessSkipNav.java create mode 100644 langtools/test/com/sun/javadoc/AccessSkipNav/p1/C1.java create mode 100644 langtools/test/com/sun/javadoc/AccessSkipNav/p2/C2.java create mode 100644 langtools/test/com/sun/javadoc/AccessSummary/AccessSummary.java create mode 100644 langtools/test/com/sun/javadoc/AccessSummary/p1/C1.java create mode 100644 langtools/test/com/sun/javadoc/AccessSummary/p2/C2.java create mode 100644 langtools/test/com/sun/javadoc/AuthorDD/AuthorDD.java create mode 100644 langtools/test/com/sun/javadoc/AuthorDD/p1/C1.java create mode 100644 langtools/test/com/sun/javadoc/DocRootSlash/DocRootSlash.java create mode 100644 langtools/test/com/sun/javadoc/DocRootSlash/overview.html create mode 100644 langtools/test/com/sun/javadoc/DocRootSlash/p1/C1.java create mode 100644 langtools/test/com/sun/javadoc/DocRootSlash/p1/package.html create mode 100644 langtools/test/com/sun/javadoc/DocRootSlash/p2/C2.java create mode 100644 langtools/test/com/sun/javadoc/DocRootSlash/p2/package.html create mode 100644 langtools/test/com/sun/javadoc/JavascriptWinTitle/JavascriptWinTitle.java create mode 100644 langtools/test/com/sun/javadoc/JavascriptWinTitle/overview.html create mode 100644 langtools/test/com/sun/javadoc/JavascriptWinTitle/p1/C.java create mode 100644 langtools/test/com/sun/javadoc/JavascriptWinTitle/p2/C2.java create mode 100644 langtools/test/com/sun/javadoc/JavascriptWinTitle/package-list create mode 100644 langtools/test/com/sun/javadoc/MetaTag/MetaTag.java create mode 100644 langtools/test/com/sun/javadoc/MetaTag/p1/C1.java create mode 100644 langtools/test/com/sun/javadoc/MetaTag/p2/C2.java create mode 100644 langtools/test/com/sun/javadoc/PackagesHeader/PackagesHeader.java create mode 100644 langtools/test/com/sun/javadoc/PackagesHeader/p1/C1.java create mode 100644 langtools/test/com/sun/javadoc/PackagesHeader/p2/C2.java create mode 100644 langtools/test/com/sun/javadoc/ValidHtml/ValidHtml.java create mode 100644 langtools/test/com/sun/javadoc/ValidHtml/overview.html create mode 100644 langtools/test/com/sun/javadoc/ValidHtml/p1/C.java create mode 100644 langtools/test/com/sun/javadoc/ValidHtml/p2/C2.java create mode 100644 langtools/test/com/sun/javadoc/VersionNumber/VersionNumber.java create mode 100644 langtools/test/com/sun/javadoc/VersionNumber/p1/C.java create mode 100644 langtools/test/com/sun/javadoc/WindowTitles/WindowTitles.java create mode 100644 langtools/test/com/sun/javadoc/WindowTitles/p1/C1.java create mode 100644 langtools/test/com/sun/javadoc/WindowTitles/p2/C2.java create mode 100644 langtools/test/com/sun/javadoc/_template/Template.java create mode 100644 langtools/test/com/sun/javadoc/_template/TemplateComplete.java create mode 100644 langtools/test/com/sun/javadoc/constantValues/A.java create mode 100644 langtools/test/com/sun/javadoc/constantValues/TestConstantValues.java create mode 100644 langtools/test/com/sun/javadoc/constantValues/TestConstantValues2.java create mode 100644 langtools/test/com/sun/javadoc/constantValues/TestConstantValuesDriver.java create mode 100644 langtools/test/com/sun/javadoc/dupThrowsTags/TestDupThrowsTags.java create mode 100644 langtools/test/com/sun/javadoc/lib/JavadocTester.java create mode 100644 langtools/test/com/sun/javadoc/testAbsLinkPath/TestAbsLinkPath.java create mode 100644 langtools/test/com/sun/javadoc/testAbsLinkPath/pkg1/C1.java create mode 100644 langtools/test/com/sun/javadoc/testAbsLinkPath/pkg2/C2.java create mode 100644 langtools/test/com/sun/javadoc/testAnnotationTypes/TestAnnotationTypes.java create mode 100644 langtools/test/com/sun/javadoc/testAnnotationTypes/pkg/AnnotationType.java create mode 100644 langtools/test/com/sun/javadoc/testBackSlashInLink/C.java create mode 100644 langtools/test/com/sun/javadoc/testBackSlashInLink/TestBackSlashInLink.java create mode 100644 langtools/test/com/sun/javadoc/testBadPackageFileInJar/TestBadPackageFileInJar.java create mode 100644 langtools/test/com/sun/javadoc/testBadPackageFileInJar/badPackageFileInJar.jar create mode 100644 langtools/test/com/sun/javadoc/testBadPackageFileInJar/pkg/C.java create mode 100644 langtools/test/com/sun/javadoc/testBadSourceFile/C1.java create mode 100644 langtools/test/com/sun/javadoc/testBadSourceFile/C2.java create mode 100644 langtools/test/com/sun/javadoc/testBadSourceFile/TestBadSourceFile.java create mode 100644 langtools/test/com/sun/javadoc/testBaseClass/Bar.java create mode 100644 langtools/test/com/sun/javadoc/testBaseClass/BaseClass.java create mode 100644 langtools/test/com/sun/javadoc/testBaseClass/TestBaseClass.java create mode 100644 langtools/test/com/sun/javadoc/testBaseClass/baz/Foo.java create mode 100644 langtools/test/com/sun/javadoc/testBreakIterator/TestBreakIterator.java create mode 100644 langtools/test/com/sun/javadoc/testBreakIterator/pkg/BreakIteratorTest.java create mode 100644 langtools/test/com/sun/javadoc/testCRLineSeparator/TestCRLineSeparator.java create mode 100644 langtools/test/com/sun/javadoc/testCRLineSeparator/pkg/MyClass.java create mode 100644 langtools/test/com/sun/javadoc/testClassCrossReferences/C.java create mode 100644 langtools/test/com/sun/javadoc/testClassCrossReferences/TestClassCrossReferences.java create mode 100644 langtools/test/com/sun/javadoc/testClassCrossReferences/package-list create mode 100644 langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java create mode 100644 langtools/test/com/sun/javadoc/testClassTree/pkg/AnnotationType.java create mode 100644 langtools/test/com/sun/javadoc/testClassTree/pkg/ChildClass.java create mode 100644 langtools/test/com/sun/javadoc/testClassTree/pkg/Coin.java create mode 100644 langtools/test/com/sun/javadoc/testClassTree/pkg/ParentClass.java create mode 100644 langtools/test/com/sun/javadoc/testCmndLineClass/C5.java create mode 100644 langtools/test/com/sun/javadoc/testCmndLineClass/TestCmndLineClass.java create mode 100644 langtools/test/com/sun/javadoc/testCmndLineClass/pkg1/C1.java create mode 100644 langtools/test/com/sun/javadoc/testCmndLineClass/pkg1/C2.java create mode 100644 langtools/test/com/sun/javadoc/testCmndLineClass/pkg1/package.html create mode 100644 langtools/test/com/sun/javadoc/testCmndLineClass/pkg2/C3.java create mode 100644 langtools/test/com/sun/javadoc/testCmndLineClass/pkg2/C4.java create mode 100644 langtools/test/com/sun/javadoc/testCmndLineClass/pkg2/package.html create mode 100644 langtools/test/com/sun/javadoc/testConstantValuesPage/TestConstantValuesPage.java create mode 100644 langtools/test/com/sun/javadoc/testConstructorIndent/C.java create mode 100644 langtools/test/com/sun/javadoc/testConstructorIndent/TestConstructorIndent.java create mode 100644 langtools/test/com/sun/javadoc/testDeprecatedDocs/TestDeprecatedDocs.java create mode 100644 langtools/test/com/sun/javadoc/testDeprecatedDocs/pkg/DeprecatedClassByAnnotation.java create mode 100644 langtools/test/com/sun/javadoc/testDeprecatedDocs/pkg/TestAnnotationType.java create mode 100644 langtools/test/com/sun/javadoc/testDeprecatedDocs/pkg/TestClass.java create mode 100644 langtools/test/com/sun/javadoc/testDeprecatedDocs/pkg/TestEnum.java create mode 100644 langtools/test/com/sun/javadoc/testDeprecatedDocs/pkg/TestError.java create mode 100644 langtools/test/com/sun/javadoc/testDeprecatedDocs/pkg/TestException.java create mode 100644 langtools/test/com/sun/javadoc/testDeprecatedDocs/pkg/TestInterface.java create mode 100644 langtools/test/com/sun/javadoc/testDocErrorReporter/TestDocErrorReporter.java create mode 100644 langtools/test/com/sun/javadoc/testDocFileDir/TestDocFileDir.java create mode 100644 langtools/test/com/sun/javadoc/testDocFileDir/pkg/C.java create mode 100644 langtools/test/com/sun/javadoc/testDocFileDir/pkg/doc-files/subdir-excluded1/testfile.txt create mode 100644 langtools/test/com/sun/javadoc/testDocFileDir/pkg/doc-files/subdir-excluded2/testfile.txt create mode 100644 langtools/test/com/sun/javadoc/testDocFileDir/pkg/doc-files/subdir-used1/testfile.txt create mode 100644 langtools/test/com/sun/javadoc/testDocFileDir/pkg/doc-files/subdir-used2/testfile.txt create mode 100644 langtools/test/com/sun/javadoc/testDocFileDir/pkg/doc-files/testfile.txt create mode 100644 langtools/test/com/sun/javadoc/testDocRootInlineTag/TestDocRootInlineTag.java create mode 100644 langtools/test/com/sun/javadoc/testDocRootInlineTag/TestDocRootTag.java create mode 100644 langtools/test/com/sun/javadoc/testDocRootInlineTag/package-list create mode 100644 langtools/test/com/sun/javadoc/testDocRootInlineTag/pkg/C.java create mode 100644 langtools/test/com/sun/javadoc/testDupParamWarn/TestDupParamWarn.java create mode 100644 langtools/test/com/sun/javadoc/testDupParamWarn/pkg/Bar.java create mode 100644 langtools/test/com/sun/javadoc/testDupParamWarn/pkg/Foo.java create mode 100644 langtools/test/com/sun/javadoc/testEmptyClass/TestEmptyClass.java create mode 100644 langtools/test/com/sun/javadoc/testEmptyClass/src/Empty.java create mode 100644 langtools/test/com/sun/javadoc/testEnclosingClass/TestEnclosingClass.java create mode 100644 langtools/test/com/sun/javadoc/testEnclosingClass/pkg/MyClass.java create mode 100644 langtools/test/com/sun/javadoc/testEncoding/EncodeTest.java create mode 100644 langtools/test/com/sun/javadoc/testEncoding/TestEncoding.java create mode 100644 langtools/test/com/sun/javadoc/testExternalOverridenMethod/TestExternalOverridenMethod.java create mode 100644 langtools/test/com/sun/javadoc/testExternalOverridenMethod/package-list create mode 100644 langtools/test/com/sun/javadoc/testExternalOverridenMethod/pkg/XReader.java create mode 100644 langtools/test/com/sun/javadoc/testGroupOption/TestGroupOption.java create mode 100644 langtools/test/com/sun/javadoc/testGroupOption/pkg1/C.java create mode 100644 langtools/test/com/sun/javadoc/testGroupOption/pkg2/C.java create mode 100644 langtools/test/com/sun/javadoc/testGroupOption/pkg3/C.java create mode 100644 langtools/test/com/sun/javadoc/testHeadings/TestHeadings.java create mode 100644 langtools/test/com/sun/javadoc/testHeadings/pkg1/C1.java create mode 100644 langtools/test/com/sun/javadoc/testHeadings/pkg2/C2.java create mode 100644 langtools/test/com/sun/javadoc/testHelpOption/TestHelpOption.java create mode 100644 langtools/test/com/sun/javadoc/testHiddenMembers/TestHiddenMembers.java create mode 100644 langtools/test/com/sun/javadoc/testHiddenMembers/pkg/BaseClass.java create mode 100644 langtools/test/com/sun/javadoc/testHiddenMembers/pkg/SubClass.java create mode 100644 langtools/test/com/sun/javadoc/testHref/TestHref.java create mode 100644 langtools/test/com/sun/javadoc/testHref/package-list create mode 100644 langtools/test/com/sun/javadoc/testHref/pkg/C1.java create mode 100644 langtools/test/com/sun/javadoc/testHref/pkg/C2.java create mode 100644 langtools/test/com/sun/javadoc/testHref/pkg/C3.java create mode 100644 langtools/test/com/sun/javadoc/testHref/pkg/C4.java create mode 100644 langtools/test/com/sun/javadoc/testHrefInDocComment/TestHrefInDocComment.java create mode 100644 langtools/test/com/sun/javadoc/testHrefInDocComment/pkg/I1.java create mode 100644 langtools/test/com/sun/javadoc/testHrefInDocComment/pkg/I2.java create mode 100644 langtools/test/com/sun/javadoc/testHtmlComments/C.java create mode 100644 langtools/test/com/sun/javadoc/testHtmlComments/TestHtmlComments.java create mode 100644 langtools/test/com/sun/javadoc/testIndex/NoPackage.java create mode 100644 langtools/test/com/sun/javadoc/testIndex/TestIndex.java create mode 100644 langtools/test/com/sun/javadoc/testIndex/pkg/AnnotationType.java create mode 100644 langtools/test/com/sun/javadoc/testIndex/pkg/C.java create mode 100644 langtools/test/com/sun/javadoc/testIndex/pkg/Coin.java create mode 100644 langtools/test/com/sun/javadoc/testIndex/pkg/Interface.java create mode 100644 langtools/test/com/sun/javadoc/testInlineLinkLabel/TestInlineLinkLabel.java create mode 100644 langtools/test/com/sun/javadoc/testInlineLinkLabel/pkg/C1.java create mode 100644 langtools/test/com/sun/javadoc/testInlineLinkLabel/pkg/C2.java create mode 100644 langtools/test/com/sun/javadoc/testInlineLinkLabel/pkg/package.html create mode 100644 langtools/test/com/sun/javadoc/testInterface/TestInterface.java create mode 100644 langtools/test/com/sun/javadoc/testInterface/pkg/Child.java create mode 100644 langtools/test/com/sun/javadoc/testInterface/pkg/Interface.java create mode 100644 langtools/test/com/sun/javadoc/testInterface/pkg/Parent.java create mode 100644 langtools/test/com/sun/javadoc/testJavascript/TestJavascript.java create mode 100644 langtools/test/com/sun/javadoc/testJavascript/pkg/C.java create mode 100644 langtools/test/com/sun/javadoc/testLeadingSpaces/LeadingSpaces.java create mode 100644 langtools/test/com/sun/javadoc/testLegacyTaglet/C.java create mode 100644 langtools/test/com/sun/javadoc/testLegacyTaglet/TestLegacyTaglet.java create mode 100644 langtools/test/com/sun/javadoc/testLegacyTaglet/ToDoTaglet.java create mode 100644 langtools/test/com/sun/javadoc/testLegacyTaglet/UnderlineTaglet.java create mode 100644 langtools/test/com/sun/javadoc/testLinkOption/TestBadLinkOption.java create mode 100644 langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java create mode 100644 langtools/test/com/sun/javadoc/testLinkOption/TestNewLineInLink.java create mode 100644 langtools/test/com/sun/javadoc/testLinkOption/java/lang/StringBuilderChild.java create mode 100644 langtools/test/com/sun/javadoc/testLinkOption/package-list create mode 100644 langtools/test/com/sun/javadoc/testLinkOption/pkg/C.java create mode 100644 langtools/test/com/sun/javadoc/testLinkOption/pkg2/C2.java create mode 100644 langtools/test/com/sun/javadoc/testLinkOption/testNewLineInLink/C.java create mode 100644 langtools/test/com/sun/javadoc/testLinkOption/testNewLineInLink/package.html create mode 100644 langtools/test/com/sun/javadoc/testLinkTaglet/TestLinkTaglet.java create mode 100644 langtools/test/com/sun/javadoc/testLinkTaglet/checkPkg/A.java create mode 100644 langtools/test/com/sun/javadoc/testLinkTaglet/checkPkg/B.java create mode 100644 langtools/test/com/sun/javadoc/testLinkTaglet/pkg/C.java create mode 100644 langtools/test/com/sun/javadoc/testLinkToSerialForm/TestLinkToSerialForm.java create mode 100644 langtools/test/com/sun/javadoc/testLinkToSerialForm/pkg/C.java create mode 100644 langtools/test/com/sun/javadoc/testMemberInheritence/TestMemberInheritence.java create mode 100644 langtools/test/com/sun/javadoc/testMemberInheritence/diamond/A.java create mode 100644 langtools/test/com/sun/javadoc/testMemberInheritence/diamond/B.java create mode 100644 langtools/test/com/sun/javadoc/testMemberInheritence/diamond/C.java create mode 100644 langtools/test/com/sun/javadoc/testMemberInheritence/diamond/X.java create mode 100644 langtools/test/com/sun/javadoc/testMemberInheritence/diamond/Z.java create mode 100644 langtools/test/com/sun/javadoc/testMemberInheritence/inheritDist/A.java create mode 100644 langtools/test/com/sun/javadoc/testMemberInheritence/inheritDist/B.java create mode 100644 langtools/test/com/sun/javadoc/testMemberInheritence/inheritDist/C.java create mode 100644 langtools/test/com/sun/javadoc/testMemberInheritence/pkg/BaseClass.java create mode 100644 langtools/test/com/sun/javadoc/testMemberInheritence/pkg/BaseInterface.java create mode 100644 langtools/test/com/sun/javadoc/testMemberInheritence/pkg/SubClass.java create mode 100644 langtools/test/com/sun/javadoc/testMemberSummary/TestMemberSummary.java create mode 100644 langtools/test/com/sun/javadoc/testMemberSummary/pkg/PrivateParent.java create mode 100644 langtools/test/com/sun/javadoc/testMemberSummary/pkg/PublicChild.java create mode 100644 langtools/test/com/sun/javadoc/testMemberSummary/pkg2/A.java create mode 100644 langtools/test/com/sun/javadoc/testModifier/Interface.java create mode 100644 langtools/test/com/sun/javadoc/testModifier/ModifierAbstract.java create mode 100644 langtools/test/com/sun/javadoc/testModifier/Test.java create mode 100644 langtools/test/com/sun/javadoc/testModifier/TestModifier.java create mode 100644 langtools/test/com/sun/javadoc/testNavagation/TestNavagation.java create mode 100644 langtools/test/com/sun/javadoc/testNavagation/pkg/A.java create mode 100644 langtools/test/com/sun/javadoc/testNavagation/pkg/C.java create mode 100644 langtools/test/com/sun/javadoc/testNavagation/pkg/E.java create mode 100644 langtools/test/com/sun/javadoc/testNavagation/pkg/I.java create mode 100644 langtools/test/com/sun/javadoc/testNestedInlineTag/TestNestedInlineTag.java create mode 100644 langtools/test/com/sun/javadoc/testNestedInlineTag/testtaglets/BoldTaglet.java create mode 100644 langtools/test/com/sun/javadoc/testNestedInlineTag/testtaglets/GreenTaglet.java create mode 100644 langtools/test/com/sun/javadoc/testNestedInlineTag/testtaglets/UnderlineTaglet.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/TestNewLanguageFeatures.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg/AnnotationType.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg/AnnotationTypeUndocumented.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg/AnnotationTypeUsage.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg/Coin.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg/MultiTypeParameters.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg/SubInterface.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg/SuperInterface.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg/TypeParameterSubClass.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg/TypeParameterSuperClass.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg/TypeParameters.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg/VarArgs.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg/Wildcards.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg/package-info.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg1/A.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg1/B.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg2/ClassUseTest1.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg2/ClassUseTest2.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg2/ClassUseTest3.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg2/Foo.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg2/Foo2.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg2/Foo3.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg2/Foo4.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg2/ParamTest.java create mode 100644 langtools/test/com/sun/javadoc/testNewLanguageFeatures/pkg2/ParamTest2.java create mode 100644 langtools/test/com/sun/javadoc/testNoPackagesFile/C.java create mode 100644 langtools/test/com/sun/javadoc/testNoPackagesFile/TestNoPackagesFile.java create mode 100644 langtools/test/com/sun/javadoc/testNotifications/TestNotifications.java create mode 100644 langtools/test/com/sun/javadoc/testNotifications/pkg/C.java create mode 100644 langtools/test/com/sun/javadoc/testOverridenMethods/TestMultiInheritence.java create mode 100644 langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenMethodDocCopy.java create mode 100644 langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethods.java create mode 100644 langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPackageFlag.java create mode 100644 langtools/test/com/sun/javadoc/testOverridenMethods/TestOverridenPrivateMethodsWithPrivateFlag.java create mode 100644 langtools/test/com/sun/javadoc/testOverridenMethods/pkg1/BaseClass.java create mode 100644 langtools/test/com/sun/javadoc/testOverridenMethods/pkg1/SubClass.java create mode 100644 langtools/test/com/sun/javadoc/testOverridenMethods/pkg2/SubClass.java create mode 100644 langtools/test/com/sun/javadoc/testOverridenMethods/pkg3/I0.java create mode 100644 langtools/test/com/sun/javadoc/testOverridenMethods/pkg3/I1.java create mode 100644 langtools/test/com/sun/javadoc/testOverridenMethods/pkg3/I2.java create mode 100644 langtools/test/com/sun/javadoc/testOverridenMethods/pkg3/I3.java create mode 100644 langtools/test/com/sun/javadoc/testOverridenMethods/pkg3/I4.java create mode 100644 langtools/test/com/sun/javadoc/testPackagePage/TestPackagePage.java create mode 100644 langtools/test/com/sun/javadoc/testPackagePage/com/pkg/C.java create mode 100644 langtools/test/com/sun/javadoc/testPackagePage/com/pkg/package.html create mode 100644 langtools/test/com/sun/javadoc/testPackagePage/pkg2/C.java create mode 100644 langtools/test/com/sun/javadoc/testParamTaglet/TestParamTaglet.java create mode 100644 langtools/test/com/sun/javadoc/testParamTaglet/pkg/C.java create mode 100644 langtools/test/com/sun/javadoc/testParamTaglet/pkg/Parent.java create mode 100644 langtools/test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java create mode 100644 langtools/test/com/sun/javadoc/testPrivateClasses/pkg/PrivateInterface.java create mode 100644 langtools/test/com/sun/javadoc/testPrivateClasses/pkg/PrivateParent.java create mode 100644 langtools/test/com/sun/javadoc/testPrivateClasses/pkg/PublicChild.java create mode 100644 langtools/test/com/sun/javadoc/testPrivateClasses/pkg/PublicInterface.java create mode 100644 langtools/test/com/sun/javadoc/testPrivateClasses/pkg2/C.java create mode 100644 langtools/test/com/sun/javadoc/testPrivateClasses/pkg2/I.java create mode 100644 langtools/test/com/sun/javadoc/testRecurseSubPackages/TestRecurseSubPackages.java create mode 100644 langtools/test/com/sun/javadoc/testRecurseSubPackages/pkg1/C1.java create mode 100644 langtools/test/com/sun/javadoc/testRecurseSubPackages/pkg1/C2.java create mode 100644 langtools/test/com/sun/javadoc/testRecurseSubPackages/pkg1/pkg2/C3.java create mode 100644 langtools/test/com/sun/javadoc/testRecurseSubPackages/pkg1/pkg2/C4.java create mode 100644 langtools/test/com/sun/javadoc/testRecurseSubPackages/pkg1/pkg2/packageToExclude/DummyClass.java create mode 100644 langtools/test/com/sun/javadoc/testRecurseSubPackages/pkg1/pkg2/pkg3/C5.java create mode 100644 langtools/test/com/sun/javadoc/testRecurseSubPackages/pkg1/pkg2/pkg3/C6.java create mode 100644 langtools/test/com/sun/javadoc/testRelativeLinks/TestRelativeLinks.java create mode 100644 langtools/test/com/sun/javadoc/testRelativeLinks/pkg/C.java create mode 100644 langtools/test/com/sun/javadoc/testRelativeLinks/pkg/package.html create mode 100644 langtools/test/com/sun/javadoc/testRelativeLinks/pkg2/Foo.java create mode 100644 langtools/test/com/sun/javadoc/testReturnTag/TestReturnTag.java create mode 100644 langtools/test/com/sun/javadoc/testSerialVersionUID/C.java create mode 100644 langtools/test/com/sun/javadoc/testSerialVersionUID/TestSerialVersionUID.java create mode 100644 langtools/test/com/sun/javadoc/testSerializedForm/TestSerializedForm.java create mode 100644 langtools/test/com/sun/javadoc/testSimpleTag/C.java create mode 100644 langtools/test/com/sun/javadoc/testSimpleTag/TestSimpleTag.java create mode 100644 langtools/test/com/sun/javadoc/testSimpleTagExclude/DummyClass.java create mode 100644 langtools/test/com/sun/javadoc/testSimpleTagExclude/TestSimpleTagExclude.java create mode 100644 langtools/test/com/sun/javadoc/testSourceTab/DoubleTab/C.java create mode 100644 langtools/test/com/sun/javadoc/testSourceTab/SingleTab/C.java create mode 100644 langtools/test/com/sun/javadoc/testSourceTab/TestSourceTab.java create mode 100644 langtools/test/com/sun/javadoc/testStylesheet/TestStylesheet.java create mode 100644 langtools/test/com/sun/javadoc/testStylesheet/pkg/A.java create mode 100644 langtools/test/com/sun/javadoc/testSummaryHeading/C.java create mode 100644 langtools/test/com/sun/javadoc/testSummaryHeading/TestSummaryHeading.java create mode 100644 langtools/test/com/sun/javadoc/testSuperclassInSerialForm/TestSuperClassInSerialForm.java create mode 100644 langtools/test/com/sun/javadoc/testSuperclassInSerialForm/pkg/SubClass.java create mode 100644 langtools/test/com/sun/javadoc/testSuperclassInSerialForm/pkg/SuperClass.java create mode 100644 langtools/test/com/sun/javadoc/testSupplementary/C.java create mode 100644 langtools/test/com/sun/javadoc/testSupplementary/TestSupplementary.java create mode 100644 langtools/test/com/sun/javadoc/testTagHolderMethod/TestTagHolderMethod.java create mode 100644 langtools/test/com/sun/javadoc/testTagHolderMethod/pkg/C.java create mode 100644 langtools/test/com/sun/javadoc/testTagInheritence/TestTagInheritence.java create mode 100644 langtools/test/com/sun/javadoc/testTagInheritence/firstSentence/A.java create mode 100644 langtools/test/com/sun/javadoc/testTagInheritence/firstSentence/B.java create mode 100644 langtools/test/com/sun/javadoc/testTagInheritence/firstSentence2/A.java create mode 100644 langtools/test/com/sun/javadoc/testTagInheritence/firstSentence2/B.java create mode 100644 langtools/test/com/sun/javadoc/testTagInheritence/firstSentence2/C.java create mode 100644 langtools/test/com/sun/javadoc/testTagInheritence/pkg/TestAbstractClass.java create mode 100644 langtools/test/com/sun/javadoc/testTagInheritence/pkg/TestInterface.java create mode 100644 langtools/test/com/sun/javadoc/testTagInheritence/pkg/TestInterfaceForAbstractClass.java create mode 100644 langtools/test/com/sun/javadoc/testTagInheritence/pkg/TestSuperSuperClass.java create mode 100644 langtools/test/com/sun/javadoc/testTagInheritence/pkg/TestSuperSuperInterface.java create mode 100644 langtools/test/com/sun/javadoc/testTagInheritence/pkg/TestTagInheritence.java create mode 100644 langtools/test/com/sun/javadoc/testTagMisuse/TestTagMisuse.java create mode 100644 langtools/test/com/sun/javadoc/testTaglets/C.java create mode 100644 langtools/test/com/sun/javadoc/testTaglets/Child.java create mode 100644 langtools/test/com/sun/javadoc/testTaglets/Parent.java create mode 100644 langtools/test/com/sun/javadoc/testTaglets/TestTaglets.java create mode 100644 langtools/test/com/sun/javadoc/testTaglets/taglets/Foo.java create mode 100644 langtools/test/com/sun/javadoc/testThrowsHead/C.java create mode 100644 langtools/test/com/sun/javadoc/testThrowsHead/TestThrowsHead.java create mode 100644 langtools/test/com/sun/javadoc/testThrowsInheritence/C.java create mode 100644 langtools/test/com/sun/javadoc/testThrowsInheritence/Foo.java create mode 100644 langtools/test/com/sun/javadoc/testThrowsInheritence/I.java create mode 100644 langtools/test/com/sun/javadoc/testThrowsInheritence/Iface.java create mode 100644 langtools/test/com/sun/javadoc/testThrowsInheritence/TestThrowsTagInheritence.java create mode 100644 langtools/test/com/sun/javadoc/testThrowsTag/TestThrowsTag.java create mode 100644 langtools/test/com/sun/javadoc/testThrowsTag/pkg/C.java create mode 100644 langtools/test/com/sun/javadoc/testThrowsTag/pkg/P.java create mode 100644 langtools/test/com/sun/javadoc/testThrowsTag/pkg/T1.java create mode 100644 langtools/test/com/sun/javadoc/testThrowsTag/pkg/T2.java create mode 100644 langtools/test/com/sun/javadoc/testThrowsTag/pkg/T3.java create mode 100644 langtools/test/com/sun/javadoc/testThrowsTag/pkg/T4.java create mode 100644 langtools/test/com/sun/javadoc/testThrowsTag/pkg/T5.java create mode 100644 langtools/test/com/sun/javadoc/testThrowsTag/pkg/T6.java create mode 100644 langtools/test/com/sun/javadoc/testThrowsTag/pkg/T7.java create mode 100644 langtools/test/com/sun/javadoc/testThrowsTag/pkg/T8.java create mode 100644 langtools/test/com/sun/javadoc/testTitleInHref/TestTitleInHref.java create mode 100644 langtools/test/com/sun/javadoc/testTitleInHref/package-list create mode 100644 langtools/test/com/sun/javadoc/testTitleInHref/pkg/Class.java create mode 100644 langtools/test/com/sun/javadoc/testTitleInHref/pkg/Interface.java create mode 100644 langtools/test/com/sun/javadoc/testTitleInHref/pkg/Links.java create mode 100644 langtools/test/com/sun/javadoc/testTopOption/TestTopOption.java create mode 100644 langtools/test/com/sun/javadoc/testTopOption/overview.html create mode 100644 langtools/test/com/sun/javadoc/testTopOption/pkg/AnnotationType.java create mode 100644 langtools/test/com/sun/javadoc/testTopOption/pkg/Cl.java create mode 100644 langtools/test/com/sun/javadoc/testTypeParams/TestTypeParameters.java create mode 100644 langtools/test/com/sun/javadoc/testTypeParams/pkg/C.java create mode 100644 langtools/test/com/sun/javadoc/testTypeParams/pkg/Parent.java create mode 100644 langtools/test/com/sun/javadoc/testUnnamedPackage/BadSource.java create mode 100644 langtools/test/com/sun/javadoc/testUnnamedPackage/C.java create mode 100644 langtools/test/com/sun/javadoc/testUnnamedPackage/TestUnnamedPackage.java create mode 100644 langtools/test/com/sun/javadoc/testUnnamedPackage/package.html create mode 100644 langtools/test/com/sun/javadoc/testUseOption/TestUseOption.java create mode 100644 langtools/test/com/sun/javadoc/testUseOption/pkg1/C1.java create mode 100644 langtools/test/com/sun/javadoc/testUseOption/pkg1/C2.java create mode 100644 langtools/test/com/sun/javadoc/testUseOption/pkg1/C4.java create mode 100644 langtools/test/com/sun/javadoc/testUseOption/pkg1/C5.java create mode 100644 langtools/test/com/sun/javadoc/testUseOption/pkg1/C6.java create mode 100644 langtools/test/com/sun/javadoc/testUseOption/pkg1/C7.java create mode 100644 langtools/test/com/sun/javadoc/testUseOption/pkg1/C8.java create mode 100644 langtools/test/com/sun/javadoc/testUseOption/pkg1/UsedClass.java create mode 100644 langtools/test/com/sun/javadoc/testUseOption/pkg1/package.html create mode 100644 langtools/test/com/sun/javadoc/testUseOption/pkg2/C3.java create mode 100644 langtools/test/com/sun/javadoc/testUseOption/pkg2/package.html create mode 100644 langtools/test/com/sun/javadoc/testValueTag/TestValueTag.java create mode 100644 langtools/test/com/sun/javadoc/testValueTag/pkg1/Class1.java create mode 100644 langtools/test/com/sun/javadoc/testValueTag/pkg1/Class2.java create mode 100644 langtools/test/com/sun/javadoc/testValueTag/pkg1/CustomTagUsage.java create mode 100644 langtools/test/com/sun/javadoc/testValueTag/pkg2/Class3.java create mode 100644 langtools/test/com/sun/javadoc/testValueTag/pkg2/package.html create mode 100644 langtools/test/com/sun/javadoc/testWarnBadParamNames/C.java create mode 100644 langtools/test/com/sun/javadoc/testWarnBadParamNames/TestWarnBadParamNames.java create mode 100644 langtools/test/com/sun/javadoc/testWarnings/TestWarnings.java create mode 100644 langtools/test/com/sun/javadoc/testWarnings/pkg/X.java create mode 100644 langtools/test/com/sun/javadoc/testWarnings/pkg/package.html create mode 100644 langtools/test/jprt.config create mode 100644 langtools/test/req.flg create mode 100644 langtools/test/tools/apt/Basics/Aggregate.java create mode 100644 langtools/test/tools/apt/Basics/ClassAnnotations.java create mode 100644 langtools/test/tools/apt/Basics/FreshnessApf.java create mode 100644 langtools/test/tools/apt/Basics/GenClass.java create mode 100644 langtools/test/tools/apt/Basics/Indirect.java create mode 100644 langtools/test/tools/apt/Basics/Lacuna.java create mode 100644 langtools/test/tools/apt/Basics/MethodAnnotations.java create mode 100644 langtools/test/tools/apt/Basics/Milk.java create mode 100644 langtools/test/tools/apt/Basics/MisMatch.java create mode 100644 langtools/test/tools/apt/Basics/Misc.java create mode 100644 langtools/test/tools/apt/Basics/MyMarker.java create mode 100644 langtools/test/tools/apt/Basics/MySimple.java create mode 100644 langtools/test/tools/apt/Basics/NestedClassAnnotations.java create mode 100644 langtools/test/tools/apt/Basics/NullAPF.java create mode 100644 langtools/test/tools/apt/Basics/ParameterAnnotations.java create mode 100644 langtools/test/tools/apt/Basics/StaticFieldAnnotations.java create mode 100644 langtools/test/tools/apt/Basics/StaticMethodAnnotations.java create mode 100644 langtools/test/tools/apt/Basics/TestGetPackageApf.java create mode 100644 langtools/test/tools/apt/Basics/TestGetTypeDeclarationApf.java create mode 100644 langtools/test/tools/apt/Basics/annot/AnnotMarker.java create mode 100644 langtools/test/tools/apt/Basics/annot/AnnotShangri_la.java create mode 100644 langtools/test/tools/apt/Basics/annot/AnnotSimple.java create mode 100644 langtools/test/tools/apt/Basics/annot/annot2/AnnotMarker2.java create mode 100644 langtools/test/tools/apt/Basics/annot/annot2/AnnotSimple2.java create mode 100644 langtools/test/tools/apt/Basics/apt.sh create mode 100644 langtools/test/tools/apt/Basics/com.sun.mirror.apt.AnnotationProcessorFactory create mode 100644 langtools/test/tools/apt/Basics/foo/bar/Baz.java create mode 100644 langtools/test/tools/apt/Basics/foo/bar/Quux.java create mode 100644 langtools/test/tools/apt/Basics/golden.txt create mode 100644 langtools/test/tools/apt/Basics/goldenAggregate.txt create mode 100644 langtools/test/tools/apt/Basics/p1/p2.java create mode 100644 langtools/test/tools/apt/Basics/p1/p2/C1.java create mode 100644 langtools/test/tools/apt/Basics/print.sh create mode 100644 langtools/test/tools/apt/Compile/ClassDeclApf.java create mode 100644 langtools/test/tools/apt/Compile/ClassDeclApf2.java create mode 100644 langtools/test/tools/apt/Compile/Dummy1.java create mode 100644 langtools/test/tools/apt/Compile/ErrorAPF.java create mode 100644 langtools/test/tools/apt/Compile/HelloAnnotation.java create mode 100644 langtools/test/tools/apt/Compile/HelloWorld.java create mode 100644 langtools/test/tools/apt/Compile/Round1Apf.java create mode 100644 langtools/test/tools/apt/Compile/Round2Apf.java create mode 100644 langtools/test/tools/apt/Compile/Round3Apf.java create mode 100644 langtools/test/tools/apt/Compile/Round4Apf.java create mode 100644 langtools/test/tools/apt/Compile/Rounds.java create mode 100644 langtools/test/tools/apt/Compile/StaticApf.java create mode 100644 langtools/test/tools/apt/Compile/WarnAPF.java create mode 100644 langtools/test/tools/apt/Compile/WrappedStaticApf.java create mode 100644 langtools/test/tools/apt/Compile/compile.sh create mode 100644 langtools/test/tools/apt/Compile/golden.txt create mode 100644 langtools/test/tools/apt/Compile/goldenFactory.txt create mode 100644 langtools/test/tools/apt/Compile/goldenWarn.txt create mode 100644 langtools/test/tools/apt/Compile/servicesRound1 create mode 100644 langtools/test/tools/apt/Compile/servicesRound2 create mode 100644 langtools/test/tools/apt/Compile/servicesRound3 create mode 100644 langtools/test/tools/apt/Compile/servicesRound4 create mode 100644 langtools/test/tools/apt/Compile/servicesStaticApf create mode 100644 langtools/test/tools/apt/Compile/src/AhOneClass.java create mode 100644 langtools/test/tools/apt/Compile/src/AndAhTwoClass.java create mode 100644 langtools/test/tools/apt/Compile/src/Round1Class.java create mode 100644 langtools/test/tools/apt/Discovery/Dee.java create mode 100644 langtools/test/tools/apt/Discovery/Dum.java create mode 100644 langtools/test/tools/apt/Discovery/Empty.java create mode 100644 langtools/test/tools/apt/Discovery/PhantomTouch.java create mode 100644 langtools/test/tools/apt/Discovery/PhantomUpdate.java create mode 100644 langtools/test/tools/apt/Discovery/Touch.java create mode 100644 langtools/test/tools/apt/Discovery/discovery.sh create mode 100644 langtools/test/tools/apt/Discovery/servicesBadTouch create mode 100644 langtools/test/tools/apt/Discovery/servicesPhantomTouch create mode 100644 langtools/test/tools/apt/Discovery/servicesTouch create mode 100644 langtools/test/tools/apt/Discovery/servicesTweedle create mode 100644 langtools/test/tools/apt/Misc/Marked.java create mode 100644 langtools/test/tools/apt/Misc/Marker.java create mode 100644 langtools/test/tools/apt/Misc/Misc.java create mode 100644 langtools/test/tools/apt/Misc/misc.sh create mode 100644 langtools/test/tools/apt/Misc/servicesMisc create mode 100644 langtools/test/tools/apt/Options/Marked.java create mode 100644 langtools/test/tools/apt/Options/Marker.java create mode 100644 langtools/test/tools/apt/Options/OptionChecker.java create mode 100644 langtools/test/tools/apt/Options/options.sh create mode 100644 langtools/test/tools/apt/Options/servicesOptions create mode 100644 langtools/test/tools/apt/Scanners/Counter.java create mode 100644 langtools/test/tools/apt/Scanners/MemberOrderApf.java create mode 100644 langtools/test/tools/apt/Scanners/Order.java create mode 100644 langtools/test/tools/apt/Scanners/Scanner.java create mode 100644 langtools/test/tools/apt/Scanners/TestEnum.java create mode 100644 langtools/test/tools/apt/Scanners/VisitOrder.java create mode 100644 langtools/test/tools/apt/Scanners/scanner.sh create mode 100644 langtools/test/tools/apt/Scanners/servicesScanner create mode 100644 langtools/test/tools/apt/lib/Ignore.java create mode 100644 langtools/test/tools/apt/lib/Test.java create mode 100644 langtools/test/tools/apt/lib/TestProcessor.java create mode 100644 langtools/test/tools/apt/lib/TestProcessorFactory.java create mode 100644 langtools/test/tools/apt/lib/Tester.java create mode 100644 langtools/test/tools/apt/mirror/declaration/AnnoMirror.java create mode 100644 langtools/test/tools/apt/mirror/declaration/AnnoTypeDecl.java create mode 100644 langtools/test/tools/apt/mirror/declaration/AnnoTypeElemDecl.java create mode 100644 langtools/test/tools/apt/mirror/declaration/AnnoVal.java create mode 100644 langtools/test/tools/apt/mirror/declaration/ClassDecl.java create mode 100644 langtools/test/tools/apt/mirror/declaration/ConstExpr.java create mode 100644 langtools/test/tools/apt/mirror/declaration/ConstructorDecl.java create mode 100644 langtools/test/tools/apt/mirror/declaration/EnumDecl.java create mode 100644 langtools/test/tools/apt/mirror/declaration/FieldDecl.java create mode 100644 langtools/test/tools/apt/mirror/declaration/GetAnno.java create mode 100644 langtools/test/tools/apt/mirror/declaration/InterfaceDecl.java create mode 100644 langtools/test/tools/apt/mirror/declaration/MethodDecl.java create mode 100644 langtools/test/tools/apt/mirror/declaration/PackageDecl.java create mode 100644 langtools/test/tools/apt/mirror/declaration/ParameterDecl.java create mode 100644 langtools/test/tools/apt/mirror/declaration/pkg1/AClass.java create mode 100644 langtools/test/tools/apt/mirror/declaration/pkg1/AnAnnoType.java create mode 100644 langtools/test/tools/apt/mirror/declaration/pkg1/AnEnum.java create mode 100644 langtools/test/tools/apt/mirror/declaration/pkg1/AnInterface.java create mode 100644 langtools/test/tools/apt/mirror/declaration/pkg1/package-info.java create mode 100644 langtools/test/tools/apt/mirror/declaration/pkg1/pkg2/AnInterface.java create mode 100644 langtools/test/tools/apt/mirror/declaration/pkg1/pkg2/package.html create mode 100644 langtools/test/tools/apt/mirror/type/AnnoTyp.java create mode 100644 langtools/test/tools/apt/mirror/type/ArrayTyp.java create mode 100644 langtools/test/tools/apt/mirror/type/ClassTyp.java create mode 100644 langtools/test/tools/apt/mirror/type/EnumTyp.java create mode 100644 langtools/test/tools/apt/mirror/type/InterfaceTyp.java create mode 100644 langtools/test/tools/apt/mirror/type/PrimitiveTyp.java create mode 100644 langtools/test/tools/apt/mirror/type/TypeVar.java create mode 100644 langtools/test/tools/apt/mirror/type/WildcardTyp.java create mode 100644 langtools/test/tools/apt/mirror/util/Overrides.java create mode 100644 langtools/test/tools/apt/mirror/util/TypeCreation.java create mode 100644 langtools/test/tools/apt/verifyVariables.sh create mode 100644 langtools/test/tools/javac/4846262/Test.java create mode 100644 langtools/test/tools/javac/4846262/Test.out create mode 100644 langtools/test/tools/javac/4846262/Test.sh create mode 100644 langtools/test/tools/javac/4980495/static/Test.java create mode 100644 langtools/test/tools/javac/4980495/static/Test.out create mode 100644 langtools/test/tools/javac/4980495/static/p1/A1.java create mode 100644 langtools/test/tools/javac/4980495/static/p2/A2.java create mode 100644 langtools/test/tools/javac/4980495/std/Test.java create mode 100644 langtools/test/tools/javac/4980495/std/Test.out create mode 100644 langtools/test/tools/javac/4980495/std/p1/A1.java create mode 100644 langtools/test/tools/javac/4980495/std/p2/A2.java create mode 100644 langtools/test/tools/javac/5005368.java create mode 100644 langtools/test/tools/javac/5045412/Bar.java create mode 100644 langtools/test/tools/javac/5045412/Foo.java create mode 100644 langtools/test/tools/javac/5045412/out create mode 100644 langtools/test/tools/javac/6199662/Tree.java create mode 100644 langtools/test/tools/javac/6199662/TreeInfo.java create mode 100644 langtools/test/tools/javac/6199662/TreeScanner.java create mode 100644 langtools/test/tools/javac/6257443/T6257443.java create mode 100644 langtools/test/tools/javac/6257443/package-info.java create mode 100644 langtools/test/tools/javac/6302184/T6302184.java create mode 100644 langtools/test/tools/javac/6302184/T6302184.out create mode 100644 langtools/test/tools/javac/6302184/T6302184.sh create mode 100644 langtools/test/tools/javac/6304921/T6304921.java create mode 100644 langtools/test/tools/javac/6304921/T6304921.out create mode 100644 langtools/test/tools/javac/6304921/TestLog.java create mode 100644 langtools/test/tools/javac/6330920/T6330920.java create mode 100644 langtools/test/tools/javac/6330920/T6330920.out create mode 100644 langtools/test/tools/javac/6330997/T1.java create mode 100644 langtools/test/tools/javac/6330997/T2.java create mode 100644 langtools/test/tools/javac/6330997/T6330997.java create mode 100644 langtools/test/tools/javac/6341866/A.java create mode 100644 langtools/test/tools/javac/6341866/Anno.java create mode 100644 langtools/test/tools/javac/6341866/B.java create mode 100644 langtools/test/tools/javac/6341866/T6341866.java create mode 100644 langtools/test/tools/javac/6342411/T6342411.java create mode 100644 langtools/test/tools/javac/6342411/a/Base.java create mode 100644 langtools/test/tools/javac/6342411/a/Pub.java create mode 100644 langtools/test/tools/javac/6394683/A.java create mode 100644 langtools/test/tools/javac/6394683/B.java create mode 100644 langtools/test/tools/javac/6394683/T6394683.java create mode 100644 langtools/test/tools/javac/6400383/T6400383.java create mode 100644 langtools/test/tools/javac/6400872/A.java create mode 100644 langtools/test/tools/javac/6400872/B.java create mode 100644 langtools/test/tools/javac/6400872/C.java create mode 100644 langtools/test/tools/javac/6400872/T6400872.java create mode 100644 langtools/test/tools/javac/6402516/A.java create mode 100644 langtools/test/tools/javac/6402516/CheckClass.java create mode 100644 langtools/test/tools/javac/6402516/CheckIsAccessible.java create mode 100644 langtools/test/tools/javac/6402516/CheckLocalElements.java create mode 100644 langtools/test/tools/javac/6402516/CheckMethod.java create mode 100644 langtools/test/tools/javac/6402516/Checker.java create mode 100644 langtools/test/tools/javac/6402516/TestClass.java create mode 100644 langtools/test/tools/javac/6402516/TestIsAccessible.java create mode 100644 langtools/test/tools/javac/6402516/TestLocalElements.java create mode 100644 langtools/test/tools/javac/6402516/TestMethod.java create mode 100644 langtools/test/tools/javac/6403424/A.java create mode 100644 langtools/test/tools/javac/6403424/B.java create mode 100644 langtools/test/tools/javac/6403424/T6403424.java create mode 100644 langtools/test/tools/javac/6410653/T6410653.java create mode 100644 langtools/test/tools/javac/6440583/A.java create mode 100644 langtools/test/tools/javac/6440583/T6440583.java create mode 100644 langtools/test/tools/javac/6457284/T6457284.java create mode 100644 langtools/test/tools/javac/6464451/BigFinally.java create mode 100644 langtools/test/tools/javac/6464451/DeepNestedFinally.java create mode 100644 langtools/test/tools/javac/6464451/ManyExitsInTry.java create mode 100644 langtools/test/tools/javac/6491592/T6491592.java create mode 100644 langtools/test/tools/javac/6491592/T6491592.out create mode 100644 langtools/test/tools/javac/6520152/T.java create mode 100644 langtools/test/tools/javac/6520152/T6520152.java create mode 100644 langtools/test/tools/javac/6547131/T.java create mode 100644 langtools/test/tools/javac/6547131/p/Outer$I.class create mode 100644 langtools/test/tools/javac/6547131/p/Outer$I.jasm create mode 100644 langtools/test/tools/javac/6547131/p/Outer.class create mode 100644 langtools/test/tools/javac/6547131/p/Outer.jasm create mode 100644 langtools/test/tools/javac/6589361/T6589361.java create mode 100644 langtools/test/tools/javac/AbstractOverride.java create mode 100644 langtools/test/tools/javac/AccessMethods/AccessMethodsLHS.java create mode 100644 langtools/test/tools/javac/AccessMethods/BitwiseAssignment.java create mode 100644 langtools/test/tools/javac/AccessMethods/ChainedAssignment.java create mode 100644 langtools/test/tools/javac/AccessMethods/ConstructorAccess.java create mode 100644 langtools/test/tools/javac/AccessMethods/InternalHandshake.java create mode 100644 langtools/test/tools/javac/AccessMethods/LateAddition.java create mode 100644 langtools/test/tools/javac/AccessMethods/UplevelPrivateConstants.java create mode 100644 langtools/test/tools/javac/AddReferenceThis.java create mode 100644 langtools/test/tools/javac/Ambig3.java create mode 100644 langtools/test/tools/javac/AnonClsInIntf.java create mode 100644 langtools/test/tools/javac/AnonInnerException_1.java create mode 100644 langtools/test/tools/javac/AnonInnerException_2.java create mode 100644 langtools/test/tools/javac/AnonInnerException_3.java create mode 100644 langtools/test/tools/javac/AnonStaticMember_1.java create mode 100644 langtools/test/tools/javac/AnonStaticMember_2.java create mode 100644 langtools/test/tools/javac/AnonStaticMember_3.java create mode 100644 langtools/test/tools/javac/AnonymousConstructorExceptions.java create mode 100644 langtools/test/tools/javac/AnonymousNull.java create mode 100644 langtools/test/tools/javac/AnonymousProtect/AnonymousProtect.java create mode 100644 langtools/test/tools/javac/AnonymousProtect/P1/priv.java create mode 100644 langtools/test/tools/javac/AnonymousProtect/P1/pub.java create mode 100644 langtools/test/tools/javac/AnonymousProtect/P1/pubExposePriv.java create mode 100644 langtools/test/tools/javac/AnonymousProtect/P2/usePub.java create mode 100644 langtools/test/tools/javac/AnonymousType.java create mode 100644 langtools/test/tools/javac/ArrayCast.java create mode 100644 langtools/test/tools/javac/ArrayCloneCodeGen.java create mode 100644 langtools/test/tools/javac/BadAnnotation.java create mode 100644 langtools/test/tools/javac/BadBreak.java create mode 100644 langtools/test/tools/javac/BadCovar.java create mode 100644 langtools/test/tools/javac/BadHexConstant.java create mode 100644 langtools/test/tools/javac/BadOptimization/DeadCode1.java create mode 100644 langtools/test/tools/javac/BadOptimization/DeadCode2.java create mode 100644 langtools/test/tools/javac/BadOptimization/DeadCode3.java create mode 100644 langtools/test/tools/javac/BadOptimization/DeadCode4.java create mode 100644 langtools/test/tools/javac/BadOptimization/DeadCode5.java create mode 100644 langtools/test/tools/javac/BadOptimization/DeadCode6.java create mode 100644 langtools/test/tools/javac/BadOptimization/Switch1.java create mode 100644 langtools/test/tools/javac/BadOptimization/Switch2.java create mode 100644 langtools/test/tools/javac/BoolArray.java create mode 100644 langtools/test/tools/javac/BoundClassError.java create mode 100644 langtools/test/tools/javac/BreakAcrossClass.java create mode 100644 langtools/test/tools/javac/Capture.java create mode 100644 langtools/test/tools/javac/CaptureInSubtype.java create mode 100644 langtools/test/tools/javac/CascadedInnerNewInstance.java create mode 100644 langtools/test/tools/javac/CastInterface2Array.java create mode 100644 langtools/test/tools/javac/ClassCycle/ClassCycle1a.java create mode 100644 langtools/test/tools/javac/ClassCycle/ClassCycle1b.java create mode 100644 langtools/test/tools/javac/ClassCycle/ClassCycle2a.java create mode 100644 langtools/test/tools/javac/ClassCycle/ClassCycle2b.java create mode 100644 langtools/test/tools/javac/ClassCycle/ClassCycle3a.java create mode 100644 langtools/test/tools/javac/ClassCycle/ClassCycle3b.java create mode 100644 langtools/test/tools/javac/ClassFileModifiers/ClassModifiers.java create mode 100644 langtools/test/tools/javac/ClassFileModifiers/ClassModifiers.out create mode 100644 langtools/test/tools/javac/ClassFileModifiers/MemberModifiers.java create mode 100644 langtools/test/tools/javac/ClassFileModifiers/MemberModifiers.out create mode 100644 langtools/test/tools/javac/ClassIsAbstract.java create mode 100644 langtools/test/tools/javac/ClassLit.java create mode 100644 langtools/test/tools/javac/ClassLiterals/ClassLiteralHelperContext.java create mode 100644 langtools/test/tools/javac/ClassLiterals/InitializeOuter.java create mode 100644 langtools/test/tools/javac/ClassLiterals/InitializeTarget.java create mode 100644 langtools/test/tools/javac/ClassLiterals/InnerClassLiterals.java create mode 100644 langtools/test/tools/javac/ClassLiterals/LiteralInterfaceImpl.java create mode 100644 langtools/test/tools/javac/ClassLiterals/LiteralInterface_1.java create mode 100644 langtools/test/tools/javac/ClassLiterals/LiteralInterface_2.java create mode 100644 langtools/test/tools/javac/ClassLiterals/LiteralInterface_3.java create mode 100644 langtools/test/tools/javac/ClassLiterals/evalinit/ClassLiteralEvalInit.java create mode 100644 langtools/test/tools/javac/ClassLiterals/evalinit/java/lang/Integer.java create mode 100644 langtools/test/tools/javac/ClassLiterals/p1/C.java create mode 100644 langtools/test/tools/javac/ClassLiterals/p1/SuperClass.java create mode 100644 langtools/test/tools/javac/ClassModifiers/InterfaceAndInnerClsCtor.java create mode 100644 langtools/test/tools/javac/ClassPathTest/ClassPathTest.sh create mode 100644 langtools/test/tools/javac/ClassPathTest/ClassPathTest1.java create mode 100644 langtools/test/tools/javac/ClassPathTest/ClassPathTest2.java create mode 100644 langtools/test/tools/javac/ClassPathTest/ClassPathTest3.java create mode 100644 langtools/test/tools/javac/ClassPathTest/bar/pkg/ClassPathTestAux2.java create mode 100644 langtools/test/tools/javac/ClassPathTest/foo/pkg/ClassPathTestAux1.java create mode 100644 langtools/test/tools/javac/ClassPathTest/pkg/ClassPathTestAux3.java create mode 100644 langtools/test/tools/javac/ClassToTypeParm.java create mode 100644 langtools/test/tools/javac/CloneableProblem.java create mode 100644 langtools/test/tools/javac/Closure1.java create mode 100644 langtools/test/tools/javac/Closure2.java create mode 100644 langtools/test/tools/javac/Closure3.java create mode 100644 langtools/test/tools/javac/Closure4.java create mode 100644 langtools/test/tools/javac/Closure5.java create mode 100644 langtools/test/tools/javac/Closure6.java create mode 100644 langtools/test/tools/javac/CompoundBox.java create mode 100644 langtools/test/tools/javac/ConditionalArgTypes_1.java create mode 100644 langtools/test/tools/javac/ConditionalArgTypes_2.java create mode 100644 langtools/test/tools/javac/ConditionalClass.java create mode 100644 langtools/test/tools/javac/ConditionalInline.java create mode 100644 langtools/test/tools/javac/ConditionalWithVoid.java create mode 100644 langtools/test/tools/javac/ConstBoolAppend.java create mode 100644 langtools/test/tools/javac/ConstCharAppend.java create mode 100644 langtools/test/tools/javac/ConstantValues/ConstValInit.java create mode 100644 langtools/test/tools/javac/ConstantValues/ConstValInlining.java create mode 100644 langtools/test/tools/javac/ConstantValues/test_ff1.java create mode 100644 langtools/test/tools/javac/ConstantValues/test_ff2.java create mode 100644 langtools/test/tools/javac/CyclicInheritance.java create mode 100644 langtools/test/tools/javac/CyclicInheritance.out create mode 100644 langtools/test/tools/javac/CyclicInheritance.sh create mode 100644 langtools/test/tools/javac/CyclicInheritance2.java create mode 100644 langtools/test/tools/javac/CyclicInheritance4.java create mode 100644 langtools/test/tools/javac/CyclicInheritance6/Main.java create mode 100644 langtools/test/tools/javac/CyclicInheritance6/p1/A.java create mode 100644 langtools/test/tools/javac/CyclicInheritance6/p1/B.java create mode 100644 langtools/test/tools/javac/CyclicInheritance6/p1/C.java create mode 100644 langtools/test/tools/javac/CyclicScoping/CyclicScoping_1.java create mode 100644 langtools/test/tools/javac/CyclicScoping/CyclicScoping_2.java create mode 100644 langtools/test/tools/javac/DeadInnerClass.java create mode 100644 langtools/test/tools/javac/DeclarationStatementInline.java create mode 100644 langtools/test/tools/javac/DeepStringConcat.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/ConstantInfiniteWhile.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DABlock.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DALoop1.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DASwitch.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DUAssert.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DUBeforeDefined1.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DUBeforeDefined2.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DUParam1.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DUParam2.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DUSwitch.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DUSwitch2.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DUTry.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignAfterIf_1.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignAfterIf_2.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignAfterThis_1.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignAfterThis_2.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignAfterTry1.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignAfterTry2.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignAfterTry3.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignBoolean/DefAssignBoolean_1.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignBoolean/DefAssignBoolean_10.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignBoolean/DefAssignBoolean_11.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignBoolean/DefAssignBoolean_12.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignBoolean/DefAssignBoolean_13.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignBoolean/DefAssignBoolean_14.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignBoolean/DefAssignBoolean_15.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignBoolean/DefAssignBoolean_16.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignBoolean/DefAssignBoolean_2.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignBoolean/DefAssignBoolean_3.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignBoolean/DefAssignBoolean_4.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignBoolean/DefAssignBoolean_5.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignBoolean/DefAssignBoolean_6.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignBoolean/DefAssignBoolean_7.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignBoolean/DefAssignBoolean_8.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignBoolean/DefAssignBoolean_9.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignBoolean/DefAssignCond.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignBoolean/DefAssignConstantBoolean.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/DefAssignNestedArg.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/T4704365.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/T4717164.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/T4717165.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/T4718134.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/T4718142.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/T4718142a.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/T4718708.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/T4720379.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/T4720751.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/T4721062a.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/T4721062b.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/T4721076.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/T4721998.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/T4725725.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/ThrowBeforeTryFinally.java create mode 100644 langtools/test/tools/javac/DefiniteAssignment/UncaughtException.java create mode 100644 langtools/test/tools/javac/DepParam.java create mode 100644 langtools/test/tools/javac/Digits.java create mode 100644 langtools/test/tools/javac/Digits.out create mode 100644 langtools/test/tools/javac/DivByZero.java create mode 100644 langtools/test/tools/javac/DuplicateClass.java create mode 100644 langtools/test/tools/javac/DuplicateClass2.java create mode 100644 langtools/test/tools/javac/DuplicateImport.java create mode 100644 langtools/test/tools/javac/EOI.java create mode 100644 langtools/test/tools/javac/EarlyAssert.java create mode 100644 langtools/test/tools/javac/EmptyArray.java create mode 100644 langtools/test/tools/javac/EmptyBreak.java create mode 100644 langtools/test/tools/javac/EmptyDocComments.java create mode 100644 langtools/test/tools/javac/EmptySwitch.java create mode 100644 langtools/test/tools/javac/EnclosingAccessCheck.java create mode 100644 langtools/test/tools/javac/Enum1.java create mode 100644 langtools/test/tools/javac/ExceptionalFinally.java create mode 100644 langtools/test/tools/javac/ExceptionalFinally2.java create mode 100644 langtools/test/tools/javac/ExprQualifiedType.java create mode 100644 langtools/test/tools/javac/ExtDirs/ExtDirTest_1.java create mode 100644 langtools/test/tools/javac/ExtDirs/ExtDirTest_2.java create mode 100644 langtools/test/tools/javac/ExtDirs/ExtDirTest_3.java create mode 100644 langtools/test/tools/javac/ExtDirs/ExtDirs.sh create mode 100644 langtools/test/tools/javac/ExtDirs/ext1/pkg1.jar create mode 100644 langtools/test/tools/javac/ExtDirs/ext2/pkg2.jar create mode 100644 langtools/test/tools/javac/ExtDirs/ext3/pkg1.jar create mode 100644 langtools/test/tools/javac/ExtDirs/ext3/pkg2.jar create mode 100644 langtools/test/tools/javac/ExtendArray.java create mode 100644 langtools/test/tools/javac/ExtendArray.out create mode 100644 langtools/test/tools/javac/ExtendsAccess/ExtendsAccess.java create mode 100644 langtools/test/tools/javac/ExtendsAccess/ExtendsAccess.out create mode 100644 langtools/test/tools/javac/ExtendsAccess/ExtendsAccess.sh create mode 100644 langtools/test/tools/javac/ExtendsAccess/p/ExtendsAccess.java create mode 100644 langtools/test/tools/javac/ExtendsScope.java create mode 100644 langtools/test/tools/javac/ExtraneousEquals.java create mode 100644 langtools/test/tools/javac/FaultySignature.java create mode 100644 langtools/test/tools/javac/FinalInitializer.java create mode 100644 langtools/test/tools/javac/FinalInitializer_2.java create mode 100644 langtools/test/tools/javac/FinalIntConcatenation.java create mode 100644 langtools/test/tools/javac/FinalThisReference.java create mode 100644 langtools/test/tools/javac/FinallyWarn.java create mode 100644 langtools/test/tools/javac/FlatnameClash.java create mode 100644 langtools/test/tools/javac/FlatnameClash2.java create mode 100644 langtools/test/tools/javac/FloatingPointChanges/BadConstructorModifiers.java create mode 100644 langtools/test/tools/javac/FloatingPointChanges/BadConstructorModifiers.out create mode 100644 langtools/test/tools/javac/FloatingPointChanges/BadConstructorModifiers.sh create mode 100644 langtools/test/tools/javac/FloatingPointChanges/Test.java create mode 100644 langtools/test/tools/javac/FoldConditional.java create mode 100644 langtools/test/tools/javac/ForwardReference/ForwardReference_2.java create mode 100644 langtools/test/tools/javac/ForwardReference/ForwardReference_4.java create mode 100644 langtools/test/tools/javac/ForwardReference/ForwardReference_5.java create mode 100644 langtools/test/tools/javac/ForwardReference/UseBeforeDeclaration.java create mode 100644 langtools/test/tools/javac/GoodCovar.java create mode 100644 langtools/test/tools/javac/HexFloatLiterals.java create mode 100644 langtools/test/tools/javac/HexThree.java create mode 100644 langtools/test/tools/javac/HiddenAbstractMethod/Test create mode 100644 langtools/test/tools/javac/HiddenAbstractMethod/one/Parent.java create mode 100644 langtools/test/tools/javac/HiddenAbstractMethod/two/Child.java create mode 100644 langtools/test/tools/javac/IllDefinedOrderOfInit.java create mode 100644 langtools/test/tools/javac/IllegalAnnotation.java create mode 100644 langtools/test/tools/javac/IllegalAnnotation.out create mode 100644 langtools/test/tools/javac/IllegallyOptimizedException.java create mode 100644 langtools/test/tools/javac/ImplicitToString.java create mode 100644 langtools/test/tools/javac/ImportCycle/Dummy.java create mode 100644 langtools/test/tools/javac/ImportCycle/foo/Bottom.java create mode 100644 langtools/test/tools/javac/ImportCycle/foo/Bottom2.java create mode 100644 langtools/test/tools/javac/ImportCycle/foo/Middle.java create mode 100644 langtools/test/tools/javac/ImportCycle/foo/Middle2.java create mode 100644 langtools/test/tools/javac/ImportCycle/foo/Top.java create mode 100644 langtools/test/tools/javac/ImportCycle/foo/Top2.java create mode 100644 langtools/test/tools/javac/ImportPackagePrivateInner/Dummy.java create mode 100644 langtools/test/tools/javac/ImportPackagePrivateInner/foo/Accessee.java create mode 100644 langtools/test/tools/javac/ImportPackagePrivateInner/foo/Accessor.java create mode 100644 langtools/test/tools/javac/ImportUnnamed/Dummy.java create mode 100644 langtools/test/tools/javac/ImportUnnamed/foo/A.java create mode 100644 langtools/test/tools/javac/InconsistentInheritedSignature.java create mode 100644 langtools/test/tools/javac/InconsistentStack.java create mode 100644 langtools/test/tools/javac/Increment.java create mode 100644 langtools/test/tools/javac/InheritedPrivateImpl.java create mode 100644 langtools/test/tools/javac/InitializerCompletion_1.java create mode 100644 langtools/test/tools/javac/InitializerCompletion_2.java create mode 100644 langtools/test/tools/javac/InitializerCompletion_3.java create mode 100644 langtools/test/tools/javac/InitializerCompletion_4.java create mode 100644 langtools/test/tools/javac/InnerClassesAttribute/Outside$1$Inside.class create mode 100644 langtools/test/tools/javac/InnerClassesAttribute/Outside.class create mode 100644 langtools/test/tools/javac/InnerClassesAttribute/Outside.java.back create mode 100644 langtools/test/tools/javac/InnerClassesAttribute/Test.java create mode 100644 langtools/test/tools/javac/InnerMemberRegression.java create mode 100644 langtools/test/tools/javac/InnerMethSig.java create mode 100644 langtools/test/tools/javac/InnerNamedConstant_1.java create mode 100644 langtools/test/tools/javac/InnerNamedConstant_2.java create mode 100644 langtools/test/tools/javac/InnerNamedConstant_2.out create mode 100644 langtools/test/tools/javac/InnerNamedConstant_2.sh create mode 100644 langtools/test/tools/javac/InnerTruth.java create mode 100644 langtools/test/tools/javac/InstanceInitException_1.java create mode 100644 langtools/test/tools/javac/InstanceInitException_2.java create mode 100644 langtools/test/tools/javac/InterfaceAssert.java create mode 100644 langtools/test/tools/javac/InterfaceFieldParsing_1.java create mode 100644 langtools/test/tools/javac/InterfaceInInner.java create mode 100644 langtools/test/tools/javac/InterfaceMemberClassModifiers.java create mode 100644 langtools/test/tools/javac/InterfaceMemberClassModifiers.out create mode 100644 langtools/test/tools/javac/InterfaceObjectIncompatibility.java create mode 100644 langtools/test/tools/javac/InterfaceObjectInheritance.java create mode 100644 langtools/test/tools/javac/InterfaceOverrideCheck.java create mode 100644 langtools/test/tools/javac/InterfaceOverrideFinal.java create mode 100644 langtools/test/tools/javac/InterfaceOverrideObject.java create mode 100644 langtools/test/tools/javac/InvalidIntfCast.java create mode 100644 langtools/test/tools/javac/JsrRet.java create mode 100644 langtools/test/tools/javac/LabelHiding_1.java create mode 100644 langtools/test/tools/javac/LabeledDeclaration.java create mode 100644 langtools/test/tools/javac/LocalClasses_1.java create mode 100644 langtools/test/tools/javac/LocalClasses_2.java create mode 100644 langtools/test/tools/javac/LocalClasses_2.out create mode 100644 langtools/test/tools/javac/LocalClasses_2.sh create mode 100644 langtools/test/tools/javac/ManyMembers2.java create mode 100644 langtools/test/tools/javac/MemberTypeInheritance.java create mode 100644 langtools/test/tools/javac/MissingInclude.java create mode 100644 langtools/test/tools/javac/MissingInclude.sh create mode 100644 langtools/test/tools/javac/NameClash/One.java create mode 100644 langtools/test/tools/javac/NameClash/a/One.java create mode 100644 langtools/test/tools/javac/NameClash/b/One.java create mode 100644 langtools/test/tools/javac/NameCollision.java create mode 100644 langtools/test/tools/javac/NameCollision.out create mode 100644 langtools/test/tools/javac/NameCollision.sh create mode 100644 langtools/test/tools/javac/NameCollision2.java create mode 100644 langtools/test/tools/javac/NestedDuplicateLabels.java create mode 100644 langtools/test/tools/javac/NestedFinallyReturn.java create mode 100644 langtools/test/tools/javac/NestedInnerClassNames.java create mode 100644 langtools/test/tools/javac/NestedInnerClassNames.out create mode 100644 langtools/test/tools/javac/NestedInnerClassNames.sh create mode 100644 langtools/test/tools/javac/NewGeneric.java create mode 100644 langtools/test/tools/javac/NoClass.java create mode 100644 langtools/test/tools/javac/NoNoClassDefFoundErrorError.java create mode 100644 langtools/test/tools/javac/NonAmbiguousField/Test create mode 100644 langtools/test/tools/javac/NonAmbiguousField/one/Parent.java create mode 100644 langtools/test/tools/javac/NonAmbiguousField/one/Parent2.java create mode 100644 langtools/test/tools/javac/NonAmbiguousField/two/Child.java create mode 100644 langtools/test/tools/javac/NonAmbiguousField/two/Child2.java create mode 100644 langtools/test/tools/javac/NonStaticFieldExpr1.java create mode 100644 langtools/test/tools/javac/NonStaticFieldExpr1.out create mode 100644 langtools/test/tools/javac/NonStaticFieldExpr1.sh create mode 100644 langtools/test/tools/javac/NonStaticFieldExpr2.java create mode 100644 langtools/test/tools/javac/NonStaticFieldExpr2.out create mode 100644 langtools/test/tools/javac/NonStaticFieldExpr2.sh create mode 100644 langtools/test/tools/javac/NonStaticFieldExpr3.java create mode 100644 langtools/test/tools/javac/NonStaticFieldExpr3.out create mode 100644 langtools/test/tools/javac/NonStaticFieldExpr3.sh create mode 100644 langtools/test/tools/javac/NonStaticFieldExpr4c.java create mode 100644 langtools/test/tools/javac/NonStaticFieldExpr4d.java create mode 100644 langtools/test/tools/javac/NonStaticFinalVar.java create mode 100644 langtools/test/tools/javac/Null2DArray.java create mode 100644 langtools/test/tools/javac/NullQualifiedNew.java create mode 100644 langtools/test/tools/javac/NullQualifiedNew2.java create mode 100644 langtools/test/tools/javac/NullQualifiedSuper1.java create mode 100644 langtools/test/tools/javac/NullQualifiedSuper2.java create mode 100644 langtools/test/tools/javac/NullStaticQualifier.java create mode 100644 langtools/test/tools/javac/Object1.java create mode 100644 langtools/test/tools/javac/Object2.java create mode 100644 langtools/test/tools/javac/ObjectIncompatibleInterface.java create mode 100644 langtools/test/tools/javac/ObjectMethodRefFromInterface.java create mode 100644 langtools/test/tools/javac/OuterParameter_1.java create mode 100644 langtools/test/tools/javac/OverrideChecks/InconsistentReturn.java create mode 100644 langtools/test/tools/javac/OverrideChecks/InterfaceImplements.java create mode 100644 langtools/test/tools/javac/OverrideChecks/InterfaceOverride.java create mode 100644 langtools/test/tools/javac/OverrideChecks/Private.java create mode 100644 langtools/test/tools/javac/OverrideChecks/StaticOverride.java create mode 100644 langtools/test/tools/javac/OverrideChecks/T4720356a.java create mode 100644 langtools/test/tools/javac/OverrideChecks/T4720356b.java create mode 100644 langtools/test/tools/javac/OverrideChecks/T4720359a.java create mode 100644 langtools/test/tools/javac/OverrideChecks/T4720359b.java create mode 100644 langtools/test/tools/javac/OverrideChecks/T4721069.java create mode 100644 langtools/test/tools/javac/OverrideChecks/T6326485.java create mode 100644 langtools/test/tools/javac/OverrideChecks/T6399361.java create mode 100644 langtools/test/tools/javac/OverrideChecks/ThrowsConflict.java create mode 100644 langtools/test/tools/javac/OverridePosition.java create mode 100644 langtools/test/tools/javac/OverridePosition.out create mode 100644 langtools/test/tools/javac/PackageClassAmbiguity/Bad.java create mode 100644 langtools/test/tools/javac/PackageClassAmbiguity/util.java create mode 100644 langtools/test/tools/javac/PackageClassClash/PackageClassClash.java create mode 100644 langtools/test/tools/javac/Parens1.java create mode 100644 langtools/test/tools/javac/Parens2.java create mode 100644 langtools/test/tools/javac/Parens3.java create mode 100644 langtools/test/tools/javac/Parens4.java create mode 100644 langtools/test/tools/javac/ParseConditional.java create mode 100644 langtools/test/tools/javac/Paths/Class-Path.sh create mode 100644 langtools/test/tools/javac/Paths/CompileClose.java create mode 100644 langtools/test/tools/javac/Paths/Diagnostics.sh create mode 100644 langtools/test/tools/javac/Paths/Help.sh create mode 100644 langtools/test/tools/javac/Paths/MineField.sh create mode 100644 langtools/test/tools/javac/Paths/SameJVM.java create mode 100644 langtools/test/tools/javac/Paths/Util.sh create mode 100644 langtools/test/tools/javac/Paths/wcMineField.sh create mode 100644 langtools/test/tools/javac/PrivateLocalConstructor.java create mode 100644 langtools/test/tools/javac/PrivateUplevelConstant.java create mode 100644 langtools/test/tools/javac/ProtectedInnerClass/ProtectedInnerClass.sh create mode 100644 langtools/test/tools/javac/ProtectedInnerClass/ProtectedInnerClass_2.java create mode 100644 langtools/test/tools/javac/ProtectedInnerClass/p1/ProtectedInnerClass1.java create mode 100644 langtools/test/tools/javac/ProtectedInnerClass/p2/ProtectedInnerClass2.java create mode 100644 langtools/test/tools/javac/ProtectedInnerClass/p2/ProtectedInnerClass3.java create mode 100644 langtools/test/tools/javac/QualifiedAccess/QualifiedAccess_1.java create mode 100644 langtools/test/tools/javac/QualifiedAccess/QualifiedAccess_1.out create mode 100644 langtools/test/tools/javac/QualifiedAccess/QualifiedAccess_1.sh create mode 100644 langtools/test/tools/javac/QualifiedAccess/QualifiedAccess_2.java create mode 100644 langtools/test/tools/javac/QualifiedAccess/QualifiedAccess_2.out create mode 100644 langtools/test/tools/javac/QualifiedAccess/QualifiedAccess_2.sh create mode 100644 langtools/test/tools/javac/QualifiedAccess/QualifiedAccess_3.java create mode 100644 langtools/test/tools/javac/QualifiedAccess/QualifiedAccess_3.out create mode 100644 langtools/test/tools/javac/QualifiedAccess/QualifiedAccess_3.sh create mode 100644 langtools/test/tools/javac/QualifiedAccess/QualifiedAccess_4.java create mode 100644 langtools/test/tools/javac/QualifiedAccess/pack1/P1.java create mode 100644 langtools/test/tools/javac/QualifiedAccess/pack1/P2.java create mode 100644 langtools/test/tools/javac/QualifiedConstant.java create mode 100644 langtools/test/tools/javac/QualifiedNew.java create mode 100644 langtools/test/tools/javac/QualifiedNewScope.java create mode 100644 langtools/test/tools/javac/QualifiedOuterThis.java create mode 100644 langtools/test/tools/javac/QualifiedOuterThis2.java create mode 100644 langtools/test/tools/javac/QualifiedThisAndSuper_1.java create mode 100644 langtools/test/tools/javac/QualifiedThisAndSuper_2.java create mode 100644 langtools/test/tools/javac/QualifiedThisAndSuper_3.java create mode 100644 langtools/test/tools/javac/QualifiedThisExactMatch.java create mode 100644 langtools/test/tools/javac/RawCrash.java create mode 100644 langtools/test/tools/javac/ReturnAfterIfThenElse.java create mode 100644 langtools/test/tools/javac/SerialWarn.java create mode 100644 langtools/test/tools/javac/ShiftExpressionTest.java create mode 100644 langtools/test/tools/javac/Source5.java create mode 100644 langtools/test/tools/javac/StandaloneQualifiedSuper.java create mode 100644 langtools/test/tools/javac/StaticBlockScope.java create mode 100644 langtools/test/tools/javac/StoreClass.java create mode 100644 langtools/test/tools/javac/StrictAbstract.java create mode 100644 langtools/test/tools/javac/StringAppendAccessMethodOnLHS.java create mode 100644 langtools/test/tools/javac/StringConversion.java create mode 100644 langtools/test/tools/javac/SuperField.java create mode 100644 langtools/test/tools/javac/SuperMeth.java create mode 100644 langtools/test/tools/javac/SuperMethodResolve.java create mode 100644 langtools/test/tools/javac/SuperNew.java create mode 100644 langtools/test/tools/javac/SuperNew2.java create mode 100644 langtools/test/tools/javac/SuperNew3.java create mode 100644 langtools/test/tools/javac/SuperNew4.java create mode 100644 langtools/test/tools/javac/SuperclassConstructorException.java create mode 100644 langtools/test/tools/javac/SwitchFence.java create mode 100644 langtools/test/tools/javac/SwitchScope.java create mode 100644 langtools/test/tools/javac/SynchronizedClass.java create mode 100644 langtools/test/tools/javac/SynchronizedClass.out create mode 100644 langtools/test/tools/javac/SynchronizedClass.sh create mode 100644 langtools/test/tools/javac/SynthName1.java create mode 100644 langtools/test/tools/javac/SynthName2.java create mode 100644 langtools/test/tools/javac/T4093617/T4093617.java create mode 100644 langtools/test/tools/javac/T4093617/T4093617.out create mode 100644 langtools/test/tools/javac/T4848619/T4848619a.java create mode 100644 langtools/test/tools/javac/T4848619/T4848619b.java create mode 100644 langtools/test/tools/javac/T4906100.java create mode 100644 langtools/test/tools/javac/T4906100.out create mode 100644 langtools/test/tools/javac/T4994049/DeprecatedNOT.java create mode 100644 langtools/test/tools/javac/T4994049/DeprecatedYES.java create mode 100644 langtools/test/tools/javac/T4994049/T4994049.java create mode 100644 langtools/test/tools/javac/T4994049/T4994049.out create mode 100644 langtools/test/tools/javac/T5003235/T5003235a.java create mode 100644 langtools/test/tools/javac/T5003235/T5003235a.out create mode 100644 langtools/test/tools/javac/T5003235/T5003235b.java create mode 100644 langtools/test/tools/javac/T5003235/T5003235b.out create mode 100644 langtools/test/tools/javac/T5003235/T5003235c.java create mode 100644 langtools/test/tools/javac/T5003235/T5003235c.out create mode 100644 langtools/test/tools/javac/T5024091/T5024091.java create mode 100644 langtools/test/tools/javac/T5024091/T5024091.out create mode 100644 langtools/test/tools/javac/T5048776.java create mode 100644 langtools/test/tools/javac/T5048776a.out create mode 100644 langtools/test/tools/javac/T5048776b.out create mode 100644 langtools/test/tools/javac/T5090006/T5090006.java create mode 100644 langtools/test/tools/javac/T5090006/broken.jar create mode 100644 langtools/test/tools/javac/T5090006/compiler.sh create mode 100644 langtools/test/tools/javac/T5092545.java create mode 100644 langtools/test/tools/javac/T5105890.java create mode 100644 langtools/test/tools/javac/T6180021/AbstractSub.java create mode 100644 langtools/test/tools/javac/T6180021/Sub.java create mode 100644 langtools/test/tools/javac/T6180021/Super.java create mode 100644 langtools/test/tools/javac/T6214885.java create mode 100644 langtools/test/tools/javac/T6214885a.out create mode 100644 langtools/test/tools/javac/T6214885b.out create mode 100644 langtools/test/tools/javac/T6224167.java create mode 100644 langtools/test/tools/javac/T6224167.out create mode 100644 langtools/test/tools/javac/T6227617.java create mode 100644 langtools/test/tools/javac/T6227617.out create mode 100644 langtools/test/tools/javac/T6230128.java create mode 100644 langtools/test/tools/javac/T6230128.out create mode 100644 langtools/test/tools/javac/T6231246/T6231246.java create mode 100644 langtools/test/tools/javac/T6231847.java create mode 100644 langtools/test/tools/javac/T6231847.out create mode 100644 langtools/test/tools/javac/T6232928.java create mode 100644 langtools/test/tools/javac/T6232928/package-info.java create mode 100644 langtools/test/tools/javac/T6234077.java create mode 100644 langtools/test/tools/javac/T6238612.java create mode 100644 langtools/test/tools/javac/T6241723.java create mode 100644 langtools/test/tools/javac/T6241723.out create mode 100644 langtools/test/tools/javac/T6245591.java create mode 100644 langtools/test/tools/javac/T6245591.out create mode 100644 langtools/test/tools/javac/T6247324.java create mode 100644 langtools/test/tools/javac/T6247324.out create mode 100644 langtools/test/tools/javac/T6265400.java create mode 100644 langtools/test/tools/javac/T6266772.java create mode 100644 langtools/test/tools/javac/T6294589.java create mode 100644 langtools/test/tools/javac/T6304128.java create mode 100644 langtools/test/tools/javac/T6306967.java create mode 100644 langtools/test/tools/javac/T6341023.java create mode 100644 langtools/test/tools/javac/T6351767.java create mode 100644 langtools/test/tools/javac/T6356217/T6356217.java create mode 100644 langtools/test/tools/javac/T6358024.java create mode 100644 langtools/test/tools/javac/T6358166.java create mode 100644 langtools/test/tools/javac/T6358168.java create mode 100644 langtools/test/tools/javac/T6361619.java create mode 100644 langtools/test/tools/javac/T6366196.java create mode 100644 langtools/test/tools/javac/T6370653.java create mode 100644 langtools/test/tools/javac/T6379327.java create mode 100644 langtools/test/tools/javac/T6394563.empty.out create mode 100644 langtools/test/tools/javac/T6394563.java create mode 100644 langtools/test/tools/javac/T6394563.note.out create mode 100644 langtools/test/tools/javac/T6394563.warn.out create mode 100644 langtools/test/tools/javac/T6395974.java create mode 100644 langtools/test/tools/javac/T6397044.java create mode 100644 langtools/test/tools/javac/T6397286.java create mode 100644 langtools/test/tools/javac/T6403466.byfile.out create mode 100644 langtools/test/tools/javac/T6403466.java create mode 100644 langtools/test/tools/javac/T6403466.out create mode 100644 langtools/test/tools/javac/T6404756.java create mode 100644 langtools/test/tools/javac/T6405099.java create mode 100644 langtools/test/tools/javac/T6406771.java create mode 100644 langtools/test/tools/javac/T6407066.java create mode 100644 langtools/test/tools/javac/T6407257.java create mode 100644 langtools/test/tools/javac/T6410706.java create mode 100644 langtools/test/tools/javac/T6411379.java create mode 100644 langtools/test/tools/javac/T6413876.java create mode 100644 langtools/test/tools/javac/T6423583.java create mode 100644 langtools/test/tools/javac/T6435291/T.class create mode 100644 langtools/test/tools/javac/T6435291/T.jcod create mode 100644 langtools/test/tools/javac/T6435291/T6435291.java create mode 100644 langtools/test/tools/javac/T6534287.java create mode 100644 langtools/test/tools/javac/T6557865.java create mode 100644 langtools/test/tools/javac/ThrowNull.java create mode 100644 langtools/test/tools/javac/ThrowsIntersection_1.java create mode 100644 langtools/test/tools/javac/ThrowsIntersection_2.java create mode 100644 langtools/test/tools/javac/ThrowsIntersection_3.java create mode 100644 langtools/test/tools/javac/ThrowsIntersection_4.java create mode 100644 langtools/test/tools/javac/TryInInstanceInit.java create mode 100644 langtools/test/tools/javac/UncaughtOverflow.java create mode 100644 langtools/test/tools/javac/UncaughtOverflow2.java create mode 100644 langtools/test/tools/javac/UnreachableVar.java create mode 100644 langtools/test/tools/javac/UnterminatedLineComment.java create mode 100644 langtools/test/tools/javac/UplevelFromAnonInSuperCall.java create mode 100644 langtools/test/tools/javac/UseEnum.java create mode 100644 langtools/test/tools/javac/VarDeclarationWithAssignment.java create mode 100644 langtools/test/tools/javac/Verify.java create mode 100644 langtools/test/tools/javac/VerifyDA.java create mode 100644 langtools/test/tools/javac/VoidArray.java create mode 100644 langtools/test/tools/javac/abstract/T1.java create mode 100644 langtools/test/tools/javac/abstract/T2.java create mode 100644 langtools/test/tools/javac/abstract/T3.java create mode 100644 langtools/test/tools/javac/abstract/T4717181a.java create mode 100644 langtools/test/tools/javac/abstract/T4717181b.java create mode 100644 langtools/test/tools/javac/abstract/U1.java create mode 100644 langtools/test/tools/javac/abstract/U2.java create mode 100644 langtools/test/tools/javac/abstract/U3.java create mode 100644 langtools/test/tools/javac/accessVirtualInner/Main.java create mode 100644 langtools/test/tools/javac/accessVirtualInner/a/A.java create mode 100644 langtools/test/tools/javac/accessVirtualInner/b/B.java create mode 100644 langtools/test/tools/javac/accessVirtualInner/c/C.java create mode 100644 langtools/test/tools/javac/annotations/6214965/CompilerAnnotationTest.java create mode 100644 langtools/test/tools/javac/annotations/6214965/CompilerAnnotationTest2.java create mode 100644 langtools/test/tools/javac/annotations/6214965/CompilerAnnotationTest2bad.java create mode 100644 langtools/test/tools/javac/annotations/6214965/T6214965.java create mode 100644 langtools/test/tools/javac/annotations/6214965/T6214965.out create mode 100644 langtools/test/tools/javac/annotations/6359949/T6359949.java create mode 100644 langtools/test/tools/javac/annotations/6359949/T6359949a.java create mode 100644 langtools/test/tools/javac/annotations/6365854/T6365854.java create mode 100644 langtools/test/tools/javac/annotations/6365854/TestAnnotation.java create mode 100644 langtools/test/tools/javac/annotations/6365854/TestCore.java create mode 100644 langtools/test/tools/javac/annotations/6365854/evolve/TestAnnotation.java create mode 100644 langtools/test/tools/javac/annotations/6365854/test1.out create mode 100644 langtools/test/tools/javac/annotations/6365854/test2.out create mode 100644 langtools/test/tools/javac/annotations/default/A.java create mode 100644 langtools/test/tools/javac/annotations/default/B.java create mode 100644 langtools/test/tools/javac/annotations/default/C.java create mode 100644 langtools/test/tools/javac/annotations/default/Derr.java create mode 100644 langtools/test/tools/javac/annotations/default/Eerr.java create mode 100644 langtools/test/tools/javac/annotations/neg/AnnComma.java create mode 100644 langtools/test/tools/javac/annotations/neg/ArrayLit.java create mode 100644 langtools/test/tools/javac/annotations/neg/Constant.java create mode 100644 langtools/test/tools/javac/annotations/neg/Cycle1.java create mode 100644 langtools/test/tools/javac/annotations/neg/Cycle2.java create mode 100644 langtools/test/tools/javac/annotations/neg/Cycle3.java create mode 100644 langtools/test/tools/javac/annotations/neg/Dep.java create mode 100644 langtools/test/tools/javac/annotations/neg/Dup.java create mode 100644 langtools/test/tools/javac/annotations/neg/DupTarget.java create mode 100644 langtools/test/tools/javac/annotations/neg/MemberOver.java create mode 100644 langtools/test/tools/javac/annotations/neg/MixedSource.java create mode 100644 langtools/test/tools/javac/annotations/neg/NoAnnotationMethods.java create mode 100644 langtools/test/tools/javac/annotations/neg/NoClone.java create mode 100644 langtools/test/tools/javac/annotations/neg/NoObjectMethods.java create mode 100644 langtools/test/tools/javac/annotations/neg/ObjectMembers.java create mode 100644 langtools/test/tools/javac/annotations/neg/OverrideNo.java create mode 100644 langtools/test/tools/javac/annotations/neg/Package.java create mode 100644 langtools/test/tools/javac/annotations/neg/Recovery.java create mode 100644 langtools/test/tools/javac/annotations/neg/Recovery1.java create mode 100644 langtools/test/tools/javac/annotations/neg/Scope.java create mode 100644 langtools/test/tools/javac/annotations/neg/Syntax1.java create mode 100644 langtools/test/tools/javac/annotations/neg/WrongTarget.java create mode 100644 langtools/test/tools/javac/annotations/neg/WrongTarget2.java create mode 100644 langtools/test/tools/javac/annotations/neg/WrongValue.java create mode 100644 langtools/test/tools/javac/annotations/neg/Z1.java create mode 100644 langtools/test/tools/javac/annotations/neg/Z10.java create mode 100644 langtools/test/tools/javac/annotations/neg/Z11.java create mode 100644 langtools/test/tools/javac/annotations/neg/Z12.java create mode 100644 langtools/test/tools/javac/annotations/neg/Z13.java create mode 100644 langtools/test/tools/javac/annotations/neg/Z14.java create mode 100644 langtools/test/tools/javac/annotations/neg/Z15.java create mode 100644 langtools/test/tools/javac/annotations/neg/Z16.java create mode 100644 langtools/test/tools/javac/annotations/neg/Z2.java create mode 100644 langtools/test/tools/javac/annotations/neg/Z3.java create mode 100644 langtools/test/tools/javac/annotations/neg/Z4.java create mode 100644 langtools/test/tools/javac/annotations/neg/Z5.java create mode 100644 langtools/test/tools/javac/annotations/neg/Z8.java create mode 100644 langtools/test/tools/javac/annotations/neg/Z9.java create mode 100644 langtools/test/tools/javac/annotations/pos/AnnotationMethods.java create mode 100644 langtools/test/tools/javac/annotations/pos/AnnoteElideBraces.java create mode 100644 langtools/test/tools/javac/annotations/pos/ClassA.java create mode 100644 langtools/test/tools/javac/annotations/pos/ClassB.java create mode 100644 langtools/test/tools/javac/annotations/pos/Dep.java create mode 100644 langtools/test/tools/javac/annotations/pos/Enum1.java create mode 100644 langtools/test/tools/javac/annotations/pos/Local.java create mode 100644 langtools/test/tools/javac/annotations/pos/Members.java create mode 100644 langtools/test/tools/javac/annotations/pos/NType.java create mode 100644 langtools/test/tools/javac/annotations/pos/OverrideCheck.java create mode 100644 langtools/test/tools/javac/annotations/pos/OverrideOK.java create mode 100644 langtools/test/tools/javac/annotations/pos/Parameter.java create mode 100644 langtools/test/tools/javac/annotations/pos/Primitives.java create mode 100644 langtools/test/tools/javac/annotations/pos/RightTarget.java create mode 100644 langtools/test/tools/javac/annotations/pos/Z1.java create mode 100644 langtools/test/tools/javac/annotations/pos/Z2.java create mode 100644 langtools/test/tools/javac/annotations/pos/Z3.java create mode 100644 langtools/test/tools/javac/annotations/pos/Z4.java create mode 100644 langtools/test/tools/javac/annotations/pos/package-info.java create mode 100644 langtools/test/tools/javac/api/6400303/T6400303.java create mode 100644 langtools/test/tools/javac/api/6400303/Test1.java create mode 100644 langtools/test/tools/javac/api/6400303/Test2.java create mode 100644 langtools/test/tools/javac/api/6410643/T6410643.java create mode 100644 langtools/test/tools/javac/api/6411310/T6411310.java create mode 100644 langtools/test/tools/javac/api/6411333/T6411333.java create mode 100644 langtools/test/tools/javac/api/6412656/T6412656.java create mode 100644 langtools/test/tools/javac/api/6415780/T6415780.java create mode 100644 langtools/test/tools/javac/api/6418694/T6418694.java create mode 100644 langtools/test/tools/javac/api/6420409/T6420409.java create mode 100644 langtools/test/tools/javac/api/6420464/T6420464.java create mode 100644 langtools/test/tools/javac/api/6421111/T6421111.java create mode 100644 langtools/test/tools/javac/api/6421756/T6421756.java create mode 100644 langtools/test/tools/javac/api/6422215/T6422215.java create mode 100644 langtools/test/tools/javac/api/6422327/T6422327.java create mode 100644 langtools/test/tools/javac/api/6422327/T6422327.other create mode 100644 langtools/test/tools/javac/api/6423003/T6423003.java create mode 100644 langtools/test/tools/javac/api/6431257/T6431257.java create mode 100644 langtools/test/tools/javac/api/6431257/package-info.java create mode 100644 langtools/test/tools/javac/api/6431435/A.java create mode 100644 langtools/test/tools/javac/api/6431435/T6431435.java create mode 100644 langtools/test/tools/javac/api/6431435/p/B.java create mode 100644 langtools/test/tools/javac/api/6437349/T6437349.java create mode 100644 langtools/test/tools/javac/api/6437999/T6437999.java create mode 100644 langtools/test/tools/javac/api/6437999/Utf8.java create mode 100644 langtools/test/tools/javac/api/6440333/T6440333.java create mode 100644 langtools/test/tools/javac/api/6440528/T6440528.java create mode 100644 langtools/test/tools/javac/api/6440528/package-info.java create mode 100644 langtools/test/tools/javac/api/6452876/T6452876.java create mode 100644 langtools/test/tools/javac/api/6468404/T6468404.java create mode 100644 langtools/test/tools/javac/api/6471599/Main.java create mode 100644 langtools/test/tools/javac/api/Sibling.java create mode 100644 langtools/test/tools/javac/api/T6257235.java create mode 100644 langtools/test/tools/javac/api/T6258271.java create mode 100644 langtools/test/tools/javac/api/T6265137.java create mode 100644 langtools/test/tools/javac/api/T6265137a.java create mode 100644 langtools/test/tools/javac/api/T6306137.java create mode 100644 langtools/test/tools/javac/api/T6345974.java create mode 100644 langtools/test/tools/javac/api/T6357331.java create mode 100644 langtools/test/tools/javac/api/T6358786.java create mode 100644 langtools/test/tools/javac/api/T6358955.java create mode 100644 langtools/test/tools/javac/api/T6392782.java create mode 100644 langtools/test/tools/javac/api/T6395981.java create mode 100644 langtools/test/tools/javac/api/T6397104.java create mode 100644 langtools/test/tools/javac/api/T6400205.java create mode 100644 langtools/test/tools/javac/api/T6400207.java create mode 100644 langtools/test/tools/javac/api/T6407011.java create mode 100644 langtools/test/tools/javac/api/T6412669.java create mode 100644 langtools/test/tools/javac/api/T6431879.java create mode 100644 langtools/test/tools/javac/api/TestEvalExpression.java create mode 100644 langtools/test/tools/javac/api/TestGetTree.java create mode 100644 langtools/test/tools/javac/api/TestJavacTask.java create mode 100644 langtools/test/tools/javac/api/TestJavacTaskScanner.java create mode 100644 langtools/test/tools/javac/api/TestOperators.java create mode 100644 langtools/test/tools/javac/api/TestResolveIdent.java create mode 100644 langtools/test/tools/javac/api/TestTrees.java create mode 100644 langtools/test/tools/javac/api/evalexpr/ByteArrayClassLoader.java create mode 100644 langtools/test/tools/javac/api/evalexpr/CompileFromString.java create mode 100644 langtools/test/tools/javac/api/evalexpr/MemoryFileManager.java create mode 100644 langtools/test/tools/javac/api/guide/Test.java create mode 100644 langtools/test/tools/javac/api/guide/TestMe.java create mode 100644 langtools/test/tools/javac/api/lib/ToolTester.java create mode 100644 langtools/test/tools/javac/apt.sh create mode 100644 langtools/test/tools/javac/assert/Attach.java create mode 100644 langtools/test/tools/javac/assert/DU1.java create mode 100644 langtools/test/tools/javac/assert/DU2.java create mode 100644 langtools/test/tools/javac/assert/Position.java create mode 100644 langtools/test/tools/javac/binaryCompat/T1.java create mode 100644 langtools/test/tools/javac/binaryCompat/T2.java create mode 100644 langtools/test/tools/javac/binaryCompat/T3.java create mode 100644 langtools/test/tools/javac/boxing/BoxedForeach.java create mode 100644 langtools/test/tools/javac/boxing/Boxing1.java create mode 100644 langtools/test/tools/javac/boxing/Boxing2.java create mode 100644 langtools/test/tools/javac/boxing/Boxing4.java create mode 100644 langtools/test/tools/javac/boxing/BoxingCaching.java create mode 100644 langtools/test/tools/javac/boxing/NoBoxingBool.java create mode 100644 langtools/test/tools/javac/boxing/NoBoxingByte.java create mode 100644 langtools/test/tools/javac/boxing/NoBoxingChar.java create mode 100644 langtools/test/tools/javac/boxing/NoBoxingDouble.java create mode 100644 langtools/test/tools/javac/boxing/NoBoxingFloat.java create mode 100644 langtools/test/tools/javac/boxing/NoBoxingInt.java create mode 100644 langtools/test/tools/javac/boxing/NoBoxingLong.java create mode 100644 langtools/test/tools/javac/boxing/NoBoxingShort.java create mode 100644 langtools/test/tools/javac/boxing/T5082929.java create mode 100644 langtools/test/tools/javac/boxing/T6348760.java create mode 100644 langtools/test/tools/javac/boxing/T6369051.java create mode 100644 langtools/test/tools/javac/capture/Capture1.java create mode 100644 langtools/test/tools/javac/capture/Capture2.java create mode 100644 langtools/test/tools/javac/capture/Capture3.java create mode 100644 langtools/test/tools/javac/capture/Capture4.java create mode 100644 langtools/test/tools/javac/capture/Capture5.java create mode 100644 langtools/test/tools/javac/capture/Martin.java create mode 100644 langtools/test/tools/javac/cast/4916620/T4916620.java create mode 100644 langtools/test/tools/javac/cast/5034609/T5034609.java create mode 100644 langtools/test/tools/javac/cast/5043020/T5043020.java create mode 100644 langtools/test/tools/javac/cast/5064736/T5064736.java create mode 100644 langtools/test/tools/javac/cast/5065215/T5065215.java create mode 100644 langtools/test/tools/javac/cast/6211853/T6211853.java create mode 100644 langtools/test/tools/javac/cast/6219964/T6219964.java create mode 100644 langtools/test/tools/javac/cast/6256789/T6256789.java create mode 100644 langtools/test/tools/javac/cast/6286112/T6286112.java create mode 100644 langtools/test/tools/javac/cast/6295056/T6295056.java create mode 100644 langtools/test/tools/javac/cast/6302214/T6302214.java create mode 100644 langtools/test/tools/javac/cast/6302214/T6302214a.java create mode 100644 langtools/test/tools/javac/cast/6302956/T6302956.java create mode 100644 langtools/test/tools/javac/cast/6358534/T6358534.java create mode 100644 langtools/test/tools/javac/cast/BoxedArray.java create mode 100644 langtools/test/tools/javac/cast/forum/T654170.java create mode 100644 langtools/test/tools/javac/code/ArrayClone.java create mode 100644 langtools/test/tools/javac/code/ArrayClone.sh create mode 100644 langtools/test/tools/javac/completion/C.java create mode 100644 langtools/test/tools/javac/completion/C.out create mode 100644 langtools/test/tools/javac/completion/example/B.class create mode 100644 langtools/test/tools/javac/conditional/Conditional.java create mode 100644 langtools/test/tools/javac/constDebug/ConstDebug.java create mode 100644 langtools/test/tools/javac/constDebug/ConstDebug.sh create mode 100644 langtools/test/tools/javac/crossPackageImpl/CrossPackageImplA.java create mode 100644 langtools/test/tools/javac/crossPackageImpl/CrossPackageImplB.java create mode 100644 langtools/test/tools/javac/danglingDep/DepX.java create mode 100644 langtools/test/tools/javac/danglingDep/DepX.out create mode 100644 langtools/test/tools/javac/danglingDep/NoDepX.java create mode 100644 langtools/test/tools/javac/danglingDep/NoDepX.out create mode 100644 langtools/test/tools/javac/danglingDep/RefX.java create mode 100644 langtools/test/tools/javac/danglingDep/Test1.java create mode 100644 langtools/test/tools/javac/danglingDep/Test1.out create mode 100644 langtools/test/tools/javac/depDocComment/DeprecatedDocComment.java create mode 100644 langtools/test/tools/javac/depDocComment/DeprecatedDocComment.out create mode 100644 langtools/test/tools/javac/depDocComment/DeprecatedDocComment.sh create mode 100644 langtools/test/tools/javac/depDocComment/DeprecatedDocComment2.java create mode 100644 langtools/test/tools/javac/depDocComment/SuppressDeprecation.java create mode 100644 langtools/test/tools/javac/depDocComment/SuppressDeprecation.out create mode 100644 langtools/test/tools/javac/depOverrides/annotation/A.java create mode 100644 langtools/test/tools/javac/depOverrides/annotation/B.java create mode 100644 langtools/test/tools/javac/depOverrides/annotation/B2.java create mode 100644 langtools/test/tools/javac/depOverrides/annotation/B3.java create mode 100644 langtools/test/tools/javac/depOverrides/annotation/I.java create mode 100644 langtools/test/tools/javac/depOverrides/annotation/P.java create mode 100644 langtools/test/tools/javac/depOverrides/annotation/Q.java create mode 100644 langtools/test/tools/javac/depOverrides/annotation/R.java create mode 100644 langtools/test/tools/javac/depOverrides/annotation/Test1.java create mode 100644 langtools/test/tools/javac/depOverrides/annotation/Test1A.out create mode 100644 langtools/test/tools/javac/depOverrides/annotation/Test1B.out create mode 100644 langtools/test/tools/javac/depOverrides/annotation/Test1B2.out create mode 100644 langtools/test/tools/javac/depOverrides/annotation/Test2.java create mode 100644 langtools/test/tools/javac/depOverrides/annotation/Test2Q.out create mode 100644 langtools/test/tools/javac/depOverrides/annotation/Test2R.out create mode 100644 langtools/test/tools/javac/depOverrides/annotation/Test3.java create mode 100644 langtools/test/tools/javac/depOverrides/annotation/Test3.out create mode 100644 langtools/test/tools/javac/depOverrides/annotation/empty create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/A.java create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/B.java create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/B2.java create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/B3.java create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/I.java create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/P.java create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/Q.java create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/R.java create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/Test1.java create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/Test1A.out create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/Test1B.out create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/Test1B2.out create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/Test2.java create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/Test2Q.out create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/Test2R.out create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/Test3.java create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/Test3.out create mode 100644 langtools/test/tools/javac/depOverrides/doccomment/empty create mode 100644 langtools/test/tools/javac/enum/6350057/T6350057.java create mode 100644 langtools/test/tools/javac/enum/6350057/TestEnum.java create mode 100644 langtools/test/tools/javac/enum/6384542/T6384542.java create mode 100644 langtools/test/tools/javac/enum/6384542/T6384542.out create mode 100644 langtools/test/tools/javac/enum/6384542/T6384542a.java create mode 100644 langtools/test/tools/javac/enum/6384542/T6384542a_1_4.out create mode 100644 langtools/test/tools/javac/enum/6384542/T6384542a_5.out create mode 100644 langtools/test/tools/javac/enum/6424358/T6424358.java create mode 100644 langtools/test/tools/javac/enum/AbstractEmptyEnum.java create mode 100644 langtools/test/tools/javac/enum/AbstractEnum1.java create mode 100644 langtools/test/tools/javac/enum/DA1.java create mode 100644 langtools/test/tools/javac/enum/DA2.java create mode 100644 langtools/test/tools/javac/enum/DA3.java create mode 100644 langtools/test/tools/javac/enum/Def.java create mode 100644 langtools/test/tools/javac/enum/Enum1.java create mode 100644 langtools/test/tools/javac/enum/Enum2.java create mode 100644 langtools/test/tools/javac/enum/Enum3.java create mode 100644 langtools/test/tools/javac/enum/EnumImplicitPrivateConstructor.java create mode 100644 langtools/test/tools/javac/enum/EnumInit.java create mode 100644 langtools/test/tools/javac/enum/EnumPrivateConstructor.java create mode 100644 langtools/test/tools/javac/enum/EnumProtectedConstructor.java create mode 100644 langtools/test/tools/javac/enum/EnumPublicConstructor.java create mode 100644 langtools/test/tools/javac/enum/EnumSwitch1.java create mode 100644 langtools/test/tools/javac/enum/EnumSwitch2.java create mode 100644 langtools/test/tools/javac/enum/EnumSwitch3.java create mode 100644 langtools/test/tools/javac/enum/EnumSwitch4.java create mode 100644 langtools/test/tools/javac/enum/ExplicitlyAbstractEnum1.java create mode 100644 langtools/test/tools/javac/enum/ExplicitlyAbstractEnum2.java create mode 100644 langtools/test/tools/javac/enum/ExplicitlyFinalEnum1.java create mode 100644 langtools/test/tools/javac/enum/ExplicitlyFinalEnum2.java create mode 100644 langtools/test/tools/javac/enum/FauxEnum1.java create mode 100644 langtools/test/tools/javac/enum/FauxEnum2.java create mode 100644 langtools/test/tools/javac/enum/FauxEnum3.java create mode 100644 langtools/test/tools/javac/enum/FauxSpecialEnum1.java create mode 100644 langtools/test/tools/javac/enum/FauxSpecialEnum2.java create mode 100644 langtools/test/tools/javac/enum/LocalEnum.java create mode 100644 langtools/test/tools/javac/enum/NestedEnum.java create mode 100644 langtools/test/tools/javac/enum/NoFinal.java create mode 100644 langtools/test/tools/javac/enum/NoFinal2.java create mode 100644 langtools/test/tools/javac/enum/NoFinal3.java create mode 100644 langtools/test/tools/javac/enum/NoFinal4.java create mode 100644 langtools/test/tools/javac/enum/NoFinal5.java create mode 100644 langtools/test/tools/javac/enum/OkFinal.java create mode 100644 langtools/test/tools/javac/enum/SynthValues.java create mode 100644 langtools/test/tools/javac/enum/T5075242.java create mode 100644 langtools/test/tools/javac/enum/T5081785.java create mode 100644 langtools/test/tools/javac/enum/T5081785a.java create mode 100644 langtools/test/tools/javac/enum/T5081785b.java create mode 100644 langtools/test/tools/javac/enum/T5081785c.java create mode 100644 langtools/test/tools/javac/enum/TrailingComma.java create mode 100644 langtools/test/tools/javac/enum/UserValue.java create mode 100644 langtools/test/tools/javac/enum/ValueOf.java create mode 100644 langtools/test/tools/javac/enum/enumSwitch/Color2.java create mode 100644 langtools/test/tools/javac/enum/enumSwitch/EnumSwitch.java create mode 100644 langtools/test/tools/javac/enum/forwardRef/T6425594.java create mode 100644 langtools/test/tools/javac/enum/forwardRef/T6425594.out create mode 100644 langtools/test/tools/javac/enum/forwardRef/TestEnum1.java create mode 100644 langtools/test/tools/javac/enum/forwardRef/TestEnum2.java create mode 100644 langtools/test/tools/javac/enum/forwardRef/TestEnum3.java create mode 100644 langtools/test/tools/javac/enum/forwardRef/TestEnum4.java create mode 100644 langtools/test/tools/javac/enum/forwardRef/TestEnum5.java create mode 100644 langtools/test/tools/javac/enum/forwardRef/TestEnum6.java create mode 100644 langtools/test/tools/javac/expression/NullAppend.java create mode 100644 langtools/test/tools/javac/expression/NullAppend2.java create mode 100644 langtools/test/tools/javac/expression/ObjectAppend.java create mode 100644 langtools/test/tools/javac/falseCycle/FalseCycle.java create mode 100644 langtools/test/tools/javac/falseCycle/FalseCycleBase.java create mode 100644 langtools/test/tools/javac/fatalErrors/NoJavaLang.java create mode 100644 langtools/test/tools/javac/fatalErrors/NoJavaLang.out create mode 100644 langtools/test/tools/javac/fatalErrors/NoJavaLang.sh create mode 100644 langtools/test/tools/javac/foreach/Foreach.java create mode 100644 langtools/test/tools/javac/foreach/GenericIterator.java create mode 100644 langtools/test/tools/javac/foreach/IntersectIterator.java create mode 100644 langtools/test/tools/javac/foreach/ListOfListTest.java create mode 100644 langtools/test/tools/javac/foreach/SpecIterable.java create mode 100644 langtools/test/tools/javac/foreach/StaticBlock.java create mode 100644 langtools/test/tools/javac/foreach/SuperfluousAbstract.java create mode 100644 langtools/test/tools/javac/generics/5066774/T5066774.java create mode 100644 langtools/test/tools/javac/generics/5086027/T5086027.java create mode 100644 langtools/test/tools/javac/generics/5086027/T5086027pos.java create mode 100644 langtools/test/tools/javac/generics/6192945/Method.java create mode 100644 langtools/test/tools/javac/generics/6192945/MethodNeg.java create mode 100644 langtools/test/tools/javac/generics/6192945/MethodNeg.out create mode 100644 langtools/test/tools/javac/generics/6192945/Neg.java create mode 100644 langtools/test/tools/javac/generics/6192945/Neg.out create mode 100644 langtools/test/tools/javac/generics/6192945/Neg2.java create mode 100644 langtools/test/tools/javac/generics/6192945/Neg2.out create mode 100644 langtools/test/tools/javac/generics/6192945/Neg3.java create mode 100644 langtools/test/tools/javac/generics/6192945/Neg3.out create mode 100644 langtools/test/tools/javac/generics/6192945/T6192945.java create mode 100644 langtools/test/tools/javac/generics/6207386/T6207386.java create mode 100644 langtools/test/tools/javac/generics/6207386/T6207386.out create mode 100644 langtools/test/tools/javac/generics/6207386/Test.java create mode 100644 langtools/test/tools/javac/generics/6213818/T6213818.java create mode 100644 langtools/test/tools/javac/generics/6218229/T6218229.java create mode 100644 langtools/test/tools/javac/generics/6227936/Orig.java create mode 100644 langtools/test/tools/javac/generics/6227936/T6227936.java create mode 100644 langtools/test/tools/javac/generics/6245699/T6245699.java create mode 100644 langtools/test/tools/javac/generics/6245699/T6245699a.java create mode 100644 langtools/test/tools/javac/generics/6245699/T6245699b.java create mode 100644 langtools/test/tools/javac/generics/6245699/T6245699c.java create mode 100644 langtools/test/tools/javac/generics/6268476/T6268476.java create mode 100644 langtools/test/tools/javac/generics/6292765/T6292765.java create mode 100644 langtools/test/tools/javac/generics/6332204/T6332204.java create mode 100644 langtools/test/tools/javac/generics/6332204/T6346876.java create mode 100644 langtools/test/tools/javac/generics/6356636/T6356636.java create mode 100644 langtools/test/tools/javac/generics/6356636/a/AbstractFoo.java create mode 100644 langtools/test/tools/javac/generics/6356636/a/Bar.java create mode 100644 langtools/test/tools/javac/generics/6359951/T6359951.java create mode 100644 langtools/test/tools/javac/generics/6359951/T6359951.out create mode 100644 langtools/test/tools/javac/generics/6372782/AbstractElement.java create mode 100644 langtools/test/tools/javac/generics/6372782/AbstractPlanarVector.java create mode 100644 langtools/test/tools/javac/generics/6372782/AbstractVector.java create mode 100644 langtools/test/tools/javac/generics/6372782/AdditionDefined.java create mode 100644 langtools/test/tools/javac/generics/6372782/AdditiveClosure.java create mode 100644 langtools/test/tools/javac/generics/6372782/Element.java create mode 100644 langtools/test/tools/javac/generics/6372782/MultiplicationDefined.java create mode 100644 langtools/test/tools/javac/generics/6372782/PlainForm.java create mode 100644 langtools/test/tools/javac/generics/6372782/PlainPlanarVector.java create mode 100644 langtools/test/tools/javac/generics/6372782/PlanarVector.java create mode 100644 langtools/test/tools/javac/generics/6372782/PlanarVectorVariable.java create mode 100644 langtools/test/tools/javac/generics/6372782/Ring.java create mode 100644 langtools/test/tools/javac/generics/6372782/Scalar.java create mode 100644 langtools/test/tools/javac/generics/6372782/State.java create mode 100644 langtools/test/tools/javac/generics/6372782/T6372782.java create mode 100644 langtools/test/tools/javac/generics/6372782/Value.java create mode 100644 langtools/test/tools/javac/generics/6372782/VariableForm.java create mode 100644 langtools/test/tools/javac/generics/6372782/Vector.java create mode 100644 langtools/test/tools/javac/generics/6413682/T6413682.java create mode 100644 langtools/test/tools/javac/generics/6413682/TestPos.java create mode 100644 langtools/test/tools/javac/generics/6495506/A.java create mode 100644 langtools/test/tools/javac/generics/6495506/T6495506.java create mode 100644 langtools/test/tools/javac/generics/ArrayClone.java create mode 100644 langtools/test/tools/javac/generics/ArrayTypearg.java create mode 100644 langtools/test/tools/javac/generics/BridgeClash.java create mode 100644 langtools/test/tools/javac/generics/BridgeOrder.java create mode 100644 langtools/test/tools/javac/generics/BridgeRestype.java create mode 100644 langtools/test/tools/javac/generics/CastCrash.java create mode 100644 langtools/test/tools/javac/generics/Casting.java create mode 100644 langtools/test/tools/javac/generics/Casting2.java create mode 100644 langtools/test/tools/javac/generics/Casting3.java create mode 100644 langtools/test/tools/javac/generics/Casting4.java create mode 100644 langtools/test/tools/javac/generics/CatchTyparam.java create mode 100644 langtools/test/tools/javac/generics/Conditional.java create mode 100644 langtools/test/tools/javac/generics/Covar2.java create mode 100644 langtools/test/tools/javac/generics/Covar3.java create mode 100644 langtools/test/tools/javac/generics/Covar4.java create mode 100644 langtools/test/tools/javac/generics/Crash01.java create mode 100644 langtools/test/tools/javac/generics/Crash02.java create mode 100644 langtools/test/tools/javac/generics/CyclicInheritance3.java create mode 100644 langtools/test/tools/javac/generics/CyclicInheritance5.java create mode 100644 langtools/test/tools/javac/generics/ErasureClashCrash.java create mode 100644 langtools/test/tools/javac/generics/ExtendedRaw1.java create mode 100644 langtools/test/tools/javac/generics/ExtendedRaw2.java create mode 100644 langtools/test/tools/javac/generics/ExtendedRaw3.java create mode 100644 langtools/test/tools/javac/generics/ExtendedRaw4.java create mode 100644 langtools/test/tools/javac/generics/FinalBridge.java create mode 100644 langtools/test/tools/javac/generics/GenLit1.java create mode 100644 langtools/test/tools/javac/generics/GenLit2.java create mode 100644 langtools/test/tools/javac/generics/GenericAnonCtor.java create mode 100644 langtools/test/tools/javac/generics/GenericMerge.java create mode 100644 langtools/test/tools/javac/generics/GenericOverride.java create mode 100644 langtools/test/tools/javac/generics/GenericThrowable.java create mode 100644 langtools/test/tools/javac/generics/GetClass.java create mode 100644 langtools/test/tools/javac/generics/GetClass2.java create mode 100644 langtools/test/tools/javac/generics/InheritanceConflict.java create mode 100644 langtools/test/tools/javac/generics/InheritanceConflict2.java create mode 100644 langtools/test/tools/javac/generics/InheritanceConflict3.java create mode 100644 langtools/test/tools/javac/generics/InnerInterface1.java create mode 100644 langtools/test/tools/javac/generics/InnerInterface2.java create mode 100644 langtools/test/tools/javac/generics/InstanceOf1.java create mode 100644 langtools/test/tools/javac/generics/InstanceOf2.java create mode 100644 langtools/test/tools/javac/generics/InstanceOf3.java create mode 100644 langtools/test/tools/javac/generics/InterfaceCast1.java create mode 100644 langtools/test/tools/javac/generics/LoadOrder.java create mode 100644 langtools/test/tools/javac/generics/MissingBridge.java create mode 100644 langtools/test/tools/javac/generics/MissingCast.java create mode 100644 langtools/test/tools/javac/generics/Multibound1.java create mode 100644 langtools/test/tools/javac/generics/MultipleInheritance.java create mode 100644 langtools/test/tools/javac/generics/NameOrder.java create mode 100644 langtools/test/tools/javac/generics/Nonlinear.java create mode 100644 langtools/test/tools/javac/generics/ParametricException.java create mode 100644 langtools/test/tools/javac/generics/ParenVerify.java create mode 100644 langtools/test/tools/javac/generics/PermuteBound.java create mode 100644 langtools/test/tools/javac/generics/PrimitiveClass.java create mode 100644 langtools/test/tools/javac/generics/PrimitiveVariant.java create mode 100644 langtools/test/tools/javac/generics/RawClient.java create mode 100644 langtools/test/tools/javac/generics/RefEqual.java create mode 100644 langtools/test/tools/javac/generics/RelaxedArrays.java create mode 100644 langtools/test/tools/javac/generics/ReverseOrder.java create mode 100644 langtools/test/tools/javac/generics/SelfImplement.java create mode 100644 langtools/test/tools/javac/generics/SilentUnchecked.java create mode 100644 langtools/test/tools/javac/generics/SuperTypeargs.java create mode 100644 langtools/test/tools/javac/generics/T4661029.java create mode 100644 langtools/test/tools/javac/generics/T4683314.java create mode 100644 langtools/test/tools/javac/generics/T4684378.java create mode 100644 langtools/test/tools/javac/generics/T4695348.java create mode 100644 langtools/test/tools/javac/generics/T4695415.java create mode 100644 langtools/test/tools/javac/generics/T4695847.java create mode 100644 langtools/test/tools/javac/generics/T4711570.java create mode 100644 langtools/test/tools/javac/generics/T4711572.java create mode 100644 langtools/test/tools/javac/generics/T4711694.java create mode 100644 langtools/test/tools/javac/generics/T4738171.java create mode 100644 langtools/test/tools/javac/generics/T4739399.java create mode 100644 langtools/test/tools/javac/generics/T4757416.java create mode 100644 langtools/test/tools/javac/generics/T4784207a.java create mode 100644 langtools/test/tools/javac/generics/T4784207b.java create mode 100644 langtools/test/tools/javac/generics/T4784219.java create mode 100644 langtools/test/tools/javac/generics/T5011073.java create mode 100644 langtools/test/tools/javac/generics/T5094318.java create mode 100644 langtools/test/tools/javac/generics/T6391995.java create mode 100644 langtools/test/tools/javac/generics/TyparamLit.java create mode 100644 langtools/test/tools/javac/generics/TyparamStaticScope.java create mode 100644 langtools/test/tools/javac/generics/TyparamStaticScope2.java create mode 100644 langtools/test/tools/javac/generics/UncheckedArray.java create mode 100644 langtools/test/tools/javac/generics/UncheckedConstructor.java create mode 100644 langtools/test/tools/javac/generics/UncheckedCovariance.java create mode 100644 langtools/test/tools/javac/generics/UnsoundInference.java create mode 100644 langtools/test/tools/javac/generics/Varargs.java create mode 100644 langtools/test/tools/javac/generics/Varargs2.java create mode 100644 langtools/test/tools/javac/generics/WrongNew.java create mode 100644 langtools/test/tools/javac/generics/abstract/T4717181c.java create mode 100644 langtools/test/tools/javac/generics/bridge1/A.java create mode 100644 langtools/test/tools/javac/generics/bridge1/C.java create mode 100644 langtools/test/tools/javac/generics/bridge1/D.java create mode 100644 langtools/test/tools/javac/generics/bridge1/E.java create mode 100644 langtools/test/tools/javac/generics/classreader/HArrayMethod.java create mode 100644 langtools/test/tools/javac/generics/classreader/HMember.java create mode 100644 langtools/test/tools/javac/generics/classreader/HMethod.java create mode 100644 langtools/test/tools/javac/generics/classreader/HMethodImpl.java create mode 100644 langtools/test/tools/javac/generics/compat/CovariantCompat1.java create mode 100644 langtools/test/tools/javac/generics/compat/CovariantCompat2.java create mode 100644 langtools/test/tools/javac/generics/compat/OverrideBridge1.java create mode 100644 langtools/test/tools/javac/generics/compat/OverrideBridge2.java create mode 100644 langtools/test/tools/javac/generics/compat/OverrideBridge3.java create mode 100644 langtools/test/tools/javac/generics/compat/VisibleBridge.java create mode 100644 langtools/test/tools/javac/generics/forwardSeparateBound/ForwardSeparateBound1.java create mode 100644 langtools/test/tools/javac/generics/forwardSeparateBound/ForwardSeparateBound2.java create mode 100644 langtools/test/tools/javac/generics/genericAbstract/A.java create mode 100644 langtools/test/tools/javac/generics/genericAbstract/B.java create mode 100644 langtools/test/tools/javac/generics/inference/4941882/T4941882.java create mode 100644 langtools/test/tools/javac/generics/inference/4942040/T4942040.java create mode 100644 langtools/test/tools/javac/generics/inference/4954546/T4954546.java create mode 100644 langtools/test/tools/javac/generics/inference/4972073/T4972073.java create mode 100644 langtools/test/tools/javac/generics/inference/4972073/T4972073a.java create mode 100644 langtools/test/tools/javac/generics/inference/4972073/T4972073b.java create mode 100644 langtools/test/tools/javac/generics/inference/5003431/T5003431.java create mode 100644 langtools/test/tools/javac/generics/inference/5021635/T5021635.java create mode 100644 langtools/test/tools/javac/generics/inference/5021635/T6299211.java create mode 100644 langtools/test/tools/javac/generics/inference/5034571/T5034571.java create mode 100644 langtools/test/tools/javac/generics/inference/5042462/T5042462.java create mode 100644 langtools/test/tools/javac/generics/inference/5044646/T5044646.java create mode 100644 langtools/test/tools/javac/generics/inference/5044646/p1/A1.java create mode 100644 langtools/test/tools/javac/generics/inference/5044646/p1/B.java create mode 100644 langtools/test/tools/javac/generics/inference/5044646/p1/C.java create mode 100644 langtools/test/tools/javac/generics/inference/5044646/p2/A2.java create mode 100644 langtools/test/tools/javac/generics/inference/5049523/T5049523.java create mode 100644 langtools/test/tools/javac/generics/inference/5070671/T5070671.java create mode 100644 langtools/test/tools/javac/generics/inference/5073060/GenericsAndPackages.java create mode 100644 langtools/test/tools/javac/generics/inference/5073060/Neg.java create mode 100644 langtools/test/tools/javac/generics/inference/5073060/NegHelper.java create mode 100644 langtools/test/tools/javac/generics/inference/5073060/T5073060.java create mode 100644 langtools/test/tools/javac/generics/inference/5073060/T5073060a.java create mode 100644 langtools/test/tools/javac/generics/inference/5080917/T5080917.java create mode 100644 langtools/test/tools/javac/generics/inference/5081782/Neg.java create mode 100644 langtools/test/tools/javac/generics/inference/5081782/Pos.java create mode 100644 langtools/test/tools/javac/generics/inference/6215213/T6215213.java create mode 100644 langtools/test/tools/javac/generics/inference/6222762/T6222762.java create mode 100644 langtools/test/tools/javac/generics/inference/6240565/T6240565.java create mode 100644 langtools/test/tools/javac/generics/inference/6273455/T6273455.java create mode 100644 langtools/test/tools/javac/generics/inference/6278587/T6278587.java create mode 100644 langtools/test/tools/javac/generics/inference/6278587/T6278587Neg.java create mode 100644 langtools/test/tools/javac/generics/inference/6302954/T6456971.java create mode 100644 langtools/test/tools/javac/generics/inference/6302954/T6476073.java create mode 100644 langtools/test/tools/javac/generics/inference/6302954/X.java create mode 100644 langtools/test/tools/javac/generics/inference/6356673/Test.java create mode 100644 langtools/test/tools/javac/generics/inference/6359106/Orig.java create mode 100644 langtools/test/tools/javac/generics/inference/6359106/T6359106.java create mode 100644 langtools/test/tools/javac/generics/inference/6365166/NewTest.java create mode 100644 langtools/test/tools/javac/generics/inference/6468384/T6468384.java create mode 100644 langtools/test/tools/javac/generics/odersky/BadTest.java create mode 100644 langtools/test/tools/javac/generics/odersky/BadTest2.java create mode 100644 langtools/test/tools/javac/generics/odersky/BadTest3.java create mode 100644 langtools/test/tools/javac/generics/odersky/BadTest4.java create mode 100644 langtools/test/tools/javac/generics/odersky/Cell.java create mode 100644 langtools/test/tools/javac/generics/odersky/List.java create mode 100644 langtools/test/tools/javac/generics/odersky/Test.java create mode 100644 langtools/test/tools/javac/generics/odersky/Test2.java create mode 100644 langtools/test/tools/javac/generics/odersky/Test3.java create mode 100644 langtools/test/tools/javac/generics/odersky/Test4.java create mode 100644 langtools/test/tools/javac/generics/parametricException/J.java create mode 100644 langtools/test/tools/javac/generics/parametricException/K.java create mode 100644 langtools/test/tools/javac/generics/rare/Rare1.java create mode 100644 langtools/test/tools/javac/generics/rare/Rare10.java create mode 100644 langtools/test/tools/javac/generics/rare/Rare11.java create mode 100644 langtools/test/tools/javac/generics/rare/Rare2.java create mode 100644 langtools/test/tools/javac/generics/rare/Rare3.java create mode 100644 langtools/test/tools/javac/generics/rare/Rare4.java create mode 100644 langtools/test/tools/javac/generics/rare/Rare5.java create mode 100644 langtools/test/tools/javac/generics/rare/Rare6.java create mode 100644 langtools/test/tools/javac/generics/rare/Rare7.java create mode 100644 langtools/test/tools/javac/generics/rare/Rare8.java create mode 100644 langtools/test/tools/javac/generics/rare/Rare9.java create mode 100644 langtools/test/tools/javac/generics/rawOverride/AttributeSet.java create mode 100644 langtools/test/tools/javac/generics/rawOverride/Fail1.java create mode 100644 langtools/test/tools/javac/generics/rawOverride/T6178365.java create mode 100644 langtools/test/tools/javac/generics/rawOverride/Warn1.java create mode 100644 langtools/test/tools/javac/generics/rawOverride/Warn2.java create mode 100644 langtools/test/tools/javac/generics/rawSeparate/CharScanner.java create mode 100644 langtools/test/tools/javac/generics/rawSeparate/Hashtable.java create mode 100644 langtools/test/tools/javac/generics/rawSeparate/RetroLexer.java create mode 100644 langtools/test/tools/javac/generics/syntax/6318240/Bar.java create mode 100644 langtools/test/tools/javac/generics/syntax/6318240/BarNeg1.java create mode 100644 langtools/test/tools/javac/generics/syntax/6318240/BarNeg1a.java create mode 100644 langtools/test/tools/javac/generics/syntax/6318240/BarNeg2.java create mode 100644 langtools/test/tools/javac/generics/syntax/6318240/BarNeg2a.java create mode 100644 langtools/test/tools/javac/generics/syntax/6318240/Foo.java create mode 100644 langtools/test/tools/javac/generics/typeargs/Basic.java create mode 100644 langtools/test/tools/javac/generics/typeargs/Metharg1.java create mode 100644 langtools/test/tools/javac/generics/typeargs/Metharg2.java create mode 100644 langtools/test/tools/javac/generics/typeargs/Newarg1.java create mode 100644 langtools/test/tools/javac/generics/typeargs/Newarg2.java create mode 100644 langtools/test/tools/javac/generics/typeargs/Superarg1.java create mode 100644 langtools/test/tools/javac/generics/typeargs/Superarg2.java create mode 100644 langtools/test/tools/javac/generics/typeargs/ThisArg.java create mode 100644 langtools/test/tools/javac/generics/typevars/4856983/T4856983.java create mode 100644 langtools/test/tools/javac/generics/typevars/4856983/T4856983a.java create mode 100644 langtools/test/tools/javac/generics/typevars/4856983/T4856983b.java create mode 100644 langtools/test/tools/javac/generics/typevars/5060485/Compatibility.java create mode 100644 langtools/test/tools/javac/generics/typevars/5060485/Method.java create mode 100644 langtools/test/tools/javac/generics/typevars/5060485/Neg1.java create mode 100644 langtools/test/tools/javac/generics/typevars/5060485/Neg2.java create mode 100644 langtools/test/tools/javac/generics/typevars/5060485/Pos.java create mode 100644 langtools/test/tools/javac/generics/typevars/5060485/T5060485.java create mode 100644 langtools/test/tools/javac/generics/typevars/5061359/Base.java create mode 100644 langtools/test/tools/javac/generics/typevars/5061359/Intf.java create mode 100644 langtools/test/tools/javac/generics/typevars/5061359/T5061359.java create mode 100644 langtools/test/tools/javac/generics/typevars/5061359/T5061359a.java create mode 100644 langtools/test/tools/javac/generics/typevars/5061359/T5061359b.java create mode 100644 langtools/test/tools/javac/generics/typevars/6182630/T6182630.java create mode 100644 langtools/test/tools/javac/generics/typevars/6182630/T6182630a.java create mode 100644 langtools/test/tools/javac/generics/typevars/6182630/T6182630b.java create mode 100644 langtools/test/tools/javac/generics/typevars/6182630/T6182630c.java create mode 100644 langtools/test/tools/javac/generics/typevars/6182630/T6182630d.java create mode 100644 langtools/test/tools/javac/generics/typevars/6182630/T6182630e.java create mode 100644 langtools/test/tools/javac/generics/typevars/6182630/T6182630f.java create mode 100644 langtools/test/tools/javac/generics/typevars/6199146/T6199146.java create mode 100644 langtools/test/tools/javac/generics/typevars/6486430/T6486430.java create mode 100644 langtools/test/tools/javac/generics/typevars/6486430/T6486430a.java create mode 100644 langtools/test/tools/javac/generics/wildcards/6320612/T6320612.java create mode 100644 langtools/test/tools/javac/generics/wildcards/6330931/T6330931.java create mode 100644 langtools/test/tools/javac/generics/wildcards/6437894/A.java create mode 100644 langtools/test/tools/javac/generics/wildcards/6437894/B.java create mode 100644 langtools/test/tools/javac/generics/wildcards/6437894/T6437894.java create mode 100644 langtools/test/tools/javac/generics/wildcards/6437894/T6437894.out create mode 100644 langtools/test/tools/javac/generics/wildcards/AssignmentDifferentTypes1.java create mode 100644 langtools/test/tools/javac/generics/wildcards/AssignmentDifferentTypes2.java create mode 100644 langtools/test/tools/javac/generics/wildcards/AssignmentDifferentTypes3.java create mode 100644 langtools/test/tools/javac/generics/wildcards/AssignmentDifferentTypes4.java create mode 100644 langtools/test/tools/javac/generics/wildcards/AssignmentDifferentTypes5.java create mode 100644 langtools/test/tools/javac/generics/wildcards/AssignmentDifferentTypes6.java create mode 100644 langtools/test/tools/javac/generics/wildcards/AssignmentDifferentTypes7.java create mode 100644 langtools/test/tools/javac/generics/wildcards/AssignmentDifferentTypes8.java create mode 100644 langtools/test/tools/javac/generics/wildcards/AssignmentDifferentTypes9.java create mode 100644 langtools/test/tools/javac/generics/wildcards/AssignmentSameType1.java create mode 100644 langtools/test/tools/javac/generics/wildcards/AssignmentSameType2.java create mode 100644 langtools/test/tools/javac/generics/wildcards/AssignmentSameType3.java create mode 100644 langtools/test/tools/javac/generics/wildcards/AssignmentSameType4.java create mode 100644 langtools/test/tools/javac/generics/wildcards/AssignmentSameType5.java create mode 100644 langtools/test/tools/javac/generics/wildcards/AssignmentSameType6.java create mode 100644 langtools/test/tools/javac/generics/wildcards/AssignmentSameType7.java create mode 100644 langtools/test/tools/javac/generics/wildcards/AssignmentSameType8.java create mode 100644 langtools/test/tools/javac/generics/wildcards/BoundBug.java create mode 100644 langtools/test/tools/javac/generics/wildcards/ContraArg.java create mode 100644 langtools/test/tools/javac/generics/wildcards/T5097548.java create mode 100644 langtools/test/tools/javac/generics/wildcards/T5097548b.java create mode 100644 langtools/test/tools/javac/generics/wildcards/UnboundArray.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/AmbiguousCast.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/Capture.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail1.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail10.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail11.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail12.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail13.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail14.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail15.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail16.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail17.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail18.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail19.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail2.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail20.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail21.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail3.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail4.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail5.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail6.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail7.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail8.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastFail9.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastWarn10.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastWarn11.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastWarn12.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastWarn13.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastWarn14.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastWarn2.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastWarn3.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastWarn4.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastWarn5.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastWarn6.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastWarn7.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastWarn8.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/CastWarn9.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/ParamCast.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/Readonly.java create mode 100644 langtools/test/tools/javac/generics/wildcards/neg/Unbounded.java create mode 100644 langtools/test/tools/javac/generics/wildcards/pos/AmbiguousCast2.java create mode 100644 langtools/test/tools/javac/generics/wildcards/pos/BoundsCollision.java create mode 100644 langtools/test/tools/javac/generics/wildcards/pos/Capture.java create mode 100644 langtools/test/tools/javac/generics/wildcards/pos/CastTest.java create mode 100644 langtools/test/tools/javac/generics/wildcards/pos/InstanceOf.java create mode 100644 langtools/test/tools/javac/generics/wildcards/pos/ParamCast.java create mode 100644 langtools/test/tools/javac/generics/wildcards/pos/RvalConversion.java create mode 100644 langtools/test/tools/javac/generics/wildcards/pos/UncheckedCast1.java create mode 100644 langtools/test/tools/javac/ignored.jtx create mode 100644 langtools/test/tools/javac/implicitThis/NewBeforeOuterConstructed.java create mode 100644 langtools/test/tools/javac/implicitThis/NewBeforeOuterConstructed2.java create mode 100644 langtools/test/tools/javac/implicitThis/NewBeforeOuterConstructed3.java create mode 100644 langtools/test/tools/javac/implicitThis/WhichImplicitThis1.java create mode 100644 langtools/test/tools/javac/implicitThis/WhichImplicitThis10.java create mode 100644 langtools/test/tools/javac/implicitThis/WhichImplicitThis11.java create mode 100644 langtools/test/tools/javac/implicitThis/WhichImplicitThis2.java create mode 100644 langtools/test/tools/javac/implicitThis/WhichImplicitThis3.java create mode 100644 langtools/test/tools/javac/implicitThis/WhichImplicitThis4.java create mode 100644 langtools/test/tools/javac/implicitThis/WhichImplicitThis5.java create mode 100644 langtools/test/tools/javac/implicitThis/WhichImplicitThis6.java create mode 100644 langtools/test/tools/javac/implicitThis/WhichImplicitThis7.java create mode 100644 langtools/test/tools/javac/implicitThis/WhichImplicitThis9.java create mode 100644 langtools/test/tools/javac/importChecks/ImportCanonical1.java create mode 100644 langtools/test/tools/javac/importChecks/ImportCanonical2.java create mode 100644 langtools/test/tools/javac/importChecks/ImportIsFullyQualified.java create mode 100644 langtools/test/tools/javac/importChecks/ImportOfOwnClass.java create mode 100644 langtools/test/tools/javac/importChecks/InvalidImportsNoClasses.java create mode 100644 langtools/test/tools/javac/importContext/anonPackage/Foo.java create mode 100644 langtools/test/tools/javac/importContext/anonPackage/bar/Baz.java create mode 100644 langtools/test/tools/javac/importContext/namedPackage/Dummy.java create mode 100644 langtools/test/tools/javac/importContext/namedPackage/bar/Baz.java create mode 100644 langtools/test/tools/javac/importContext/namedPackage/foo/Foo.java create mode 100644 langtools/test/tools/javac/importscope/A.java create mode 100644 langtools/test/tools/javac/importscope/B.java create mode 100644 langtools/test/tools/javac/incompatibleNoninherited/A.java create mode 100644 langtools/test/tools/javac/incompatibleNoninherited/B.java create mode 100644 langtools/test/tools/javac/inheritAccess/PvtMbrsNotInherit1.java create mode 100644 langtools/test/tools/javac/inheritedAccess/MethodReferenceQualification_1.java create mode 100644 langtools/test/tools/javac/inheritedAccess/P1/priv.java create mode 100644 langtools/test/tools/javac/inheritedAccess/P1/pub.java create mode 100644 langtools/test/tools/javac/innerClassFile/Driver.java create mode 100644 langtools/test/tools/javac/innerClassFile/Driver.sh create mode 100644 langtools/test/tools/javac/innerClassFile/x/B.java create mode 100644 langtools/test/tools/javac/innerClassFile/x/C.java create mode 100644 langtools/test/tools/javac/innerClassFile/y/Main.java create mode 100644 langtools/test/tools/javac/innerClassFile/y/R1.java create mode 100644 langtools/test/tools/javac/innerClassFile/y/R2.java create mode 100644 langtools/test/tools/javac/innerClassFile/y/R3.java create mode 100644 langtools/test/tools/javac/javazip/A.java create mode 100644 langtools/test/tools/javac/javazip/Test.sh create mode 100644 langtools/test/tools/javac/javazip/bad/B.java create mode 100644 langtools/test/tools/javac/javazip/good/B.java create mode 100644 langtools/test/tools/javac/jvm/6397652/T6397652.java create mode 100644 langtools/test/tools/javac/jvm/6397652/com/test/Test$Test$Test.java create mode 100644 langtools/test/tools/javac/jvm/6397652/com/test/Test$Test.java create mode 100644 langtools/test/tools/javac/jvm/6397652/com/test/Test.java create mode 100644 langtools/test/tools/javac/limits/ArrayDims1.java create mode 100644 langtools/test/tools/javac/limits/ArrayDims2.java create mode 100644 langtools/test/tools/javac/limits/ArrayDims3.java create mode 100644 langtools/test/tools/javac/limits/ArrayDims4.java create mode 100644 langtools/test/tools/javac/limits/ArrayDims5.java create mode 100644 langtools/test/tools/javac/limits/CodeSize.java create mode 100644 langtools/test/tools/javac/limits/FinallyNesting.java create mode 100644 langtools/test/tools/javac/limits/LongName.java create mode 100644 langtools/test/tools/javac/limits/NumArgs1.java create mode 100644 langtools/test/tools/javac/limits/NumArgs2.java create mode 100644 langtools/test/tools/javac/limits/NumArgs3.java create mode 100644 langtools/test/tools/javac/limits/NumArgs4.java create mode 100644 langtools/test/tools/javac/limits/PoolSize1.java create mode 100644 langtools/test/tools/javac/limits/PoolSize2.java create mode 100644 langtools/test/tools/javac/limits/StringLength.java create mode 100644 langtools/test/tools/javac/links/T.java create mode 100644 langtools/test/tools/javac/links/b/B.java create mode 100644 langtools/test/tools/javac/links/links.sh create mode 100644 langtools/test/tools/javac/lint/Deprecation.java create mode 100644 langtools/test/tools/javac/lint/FallThrough.java create mode 100644 langtools/test/tools/javac/lint/NoWarn.java create mode 100644 langtools/test/tools/javac/lint/NoWarn1.out create mode 100644 langtools/test/tools/javac/lint/NoWarn2.out create mode 100644 langtools/test/tools/javac/lint/Unchecked.java create mode 100644 langtools/test/tools/javac/mandatoryWarnings/deprecated/A.java create mode 100644 langtools/test/tools/javac/mandatoryWarnings/deprecated/B.java create mode 100644 langtools/test/tools/javac/mandatoryWarnings/deprecated/P.java create mode 100644 langtools/test/tools/javac/mandatoryWarnings/deprecated/Q.java create mode 100644 langtools/test/tools/javac/mandatoryWarnings/deprecated/Test.java create mode 100644 langtools/test/tools/javac/mandatoryWarnings/deprecated/Test1.out create mode 100644 langtools/test/tools/javac/mandatoryWarnings/deprecated/Test2.out create mode 100644 langtools/test/tools/javac/mandatoryWarnings/deprecated/Test3.out create mode 100644 langtools/test/tools/javac/mandatoryWarnings/deprecated/Test3b.out create mode 100644 langtools/test/tools/javac/mandatoryWarnings/deprecated/Test4.out create mode 100644 langtools/test/tools/javac/mandatoryWarnings/deprecated/Test4b.out create mode 100644 langtools/test/tools/javac/mandatoryWarnings/deprecated/Test4c.out create mode 100644 langtools/test/tools/javac/mandatoryWarnings/deprecated/Test4d.out create mode 100644 langtools/test/tools/javac/mandatoryWarnings/deprecated/Test5.out create mode 100644 langtools/test/tools/javac/mandatoryWarnings/deprecated/Test5b.out create mode 100644 langtools/test/tools/javac/mandatoryWarnings/unchecked/A.java create mode 100644 langtools/test/tools/javac/mandatoryWarnings/unchecked/B.java create mode 100644 langtools/test/tools/javac/mandatoryWarnings/unchecked/Test.java create mode 100644 langtools/test/tools/javac/mandatoryWarnings/unchecked/Test1.out create mode 100644 langtools/test/tools/javac/mandatoryWarnings/unchecked/Test2.out create mode 100644 langtools/test/tools/javac/mandatoryWarnings/unchecked/Test3.out create mode 100644 langtools/test/tools/javac/mandatoryWarnings/unchecked/Test3b.out create mode 100644 langtools/test/tools/javac/mandatoryWarnings/unchecked/Test4.out create mode 100644 langtools/test/tools/javac/mandatoryWarnings/unchecked/Test4b.out create mode 100644 langtools/test/tools/javac/mandatoryWarnings/unchecked/Test4c.out create mode 100644 langtools/test/tools/javac/mandatoryWarnings/unchecked/Test4d.out create mode 100644 langtools/test/tools/javac/miranda/4686148/AbstractTest.java create mode 100644 langtools/test/tools/javac/miranda/4686148/ConcreteTest.java create mode 100644 langtools/test/tools/javac/miranda/4686148/Test.java create mode 100644 langtools/test/tools/javac/miranda/4686811/Tryit.java create mode 100644 langtools/test/tools/javac/miranda/4686811/p1/A.java create mode 100644 langtools/test/tools/javac/miranda/4686811/p1/C.java create mode 100644 langtools/test/tools/javac/miranda/4686811/p2/B.java create mode 100644 langtools/test/tools/javac/miranda/4711056/T1.java create mode 100644 langtools/test/tools/javac/miranda/4711056/T2.java create mode 100644 langtools/test/tools/javac/miranda/4711056/T3.java create mode 100644 langtools/test/tools/javac/miranda/4711056/T4.java create mode 100644 langtools/test/tools/javac/miranda/T4279316a.java create mode 100644 langtools/test/tools/javac/miranda/T4279316b.java create mode 100644 langtools/test/tools/javac/miranda/T4279316c.java create mode 100644 langtools/test/tools/javac/miranda/T4279316d.java create mode 100644 langtools/test/tools/javac/miranda/T4528315.java create mode 100644 langtools/test/tools/javac/miranda/T4666866.java create mode 100644 langtools/test/tools/javac/miranda/T4666866.out create mode 100644 langtools/test/tools/javac/miranda/T4711325.java create mode 100644 langtools/test/tools/javac/missingClass/A.java create mode 100644 langtools/test/tools/javac/missingClass/B.java create mode 100644 langtools/test/tools/javac/missingSuperRecovery/MissingSuperRecovery.java create mode 100644 langtools/test/tools/javac/missingSuperRecovery/MissingSuperRecovery.out create mode 100644 langtools/test/tools/javac/missingSuperRecovery/impl.class create mode 100644 langtools/test/tools/javac/mixedTarget/CompatibleAbstracts1.java create mode 100644 langtools/test/tools/javac/mixedTarget/CompatibleAbstracts2.java create mode 100644 langtools/test/tools/javac/mixedTarget/CompatibleAbstracts3.java create mode 100644 langtools/test/tools/javac/mixedTarget/CompatibleAbstracts4.java create mode 100644 langtools/test/tools/javac/mixedTarget/CompatibleAbstracts5.java create mode 100644 langtools/test/tools/javac/mixedTarget/ExtendCovariant1.java create mode 100644 langtools/test/tools/javac/mixedTarget/ExtendCovariant2.java create mode 100644 langtools/test/tools/javac/nested/4903103/T4903103.java create mode 100644 langtools/test/tools/javac/nested/5009484/X.java create mode 100644 langtools/test/tools/javac/nested/5009484/Y.java create mode 100644 langtools/test/tools/javac/newlines/Newlines.sh create mode 100644 langtools/test/tools/javac/overload/T4494762.java create mode 100644 langtools/test/tools/javac/overload/T4723909.java create mode 100644 langtools/test/tools/javac/overload/T4743490.java create mode 100644 langtools/test/tools/javac/overload/T5090220.java create mode 100644 langtools/test/tools/javac/overrridecrash/A.java create mode 100644 langtools/test/tools/javac/overrridecrash/B.java create mode 100644 langtools/test/tools/javac/p1/AS.java create mode 100644 langtools/test/tools/javac/p1/BS.java create mode 100644 langtools/test/tools/javac/p1/CS.java create mode 100644 langtools/test/tools/javac/packone/Mediator.java create mode 100644 langtools/test/tools/javac/packone/Secret.java create mode 100644 langtools/test/tools/javac/policy/A.java create mode 100644 langtools/test/tools/javac/policy/B.java create mode 100644 langtools/test/tools/javac/policy/C.java create mode 100644 langtools/test/tools/javac/policy/D.java create mode 100644 langtools/test/tools/javac/policy/Test.java create mode 100644 langtools/test/tools/javac/policy/byfile.ABD.out create mode 100644 langtools/test/tools/javac/policy/byfile.ACD.out create mode 100644 langtools/test/tools/javac/policy/bytodo.ABD.out create mode 100644 langtools/test/tools/javac/policy/bytodo.ACD.out create mode 100644 langtools/test/tools/javac/policy/simple.ABD.out create mode 100644 langtools/test/tools/javac/policy/simple.ACD.out create mode 100644 langtools/test/tools/javac/positions/T6253161.java create mode 100644 langtools/test/tools/javac/positions/T6253161.out create mode 100644 langtools/test/tools/javac/positions/T6253161a.java create mode 100644 langtools/test/tools/javac/positions/T6253161a.out create mode 100644 langtools/test/tools/javac/positions/T6264029.java create mode 100644 langtools/test/tools/javac/positions/T6264029.out create mode 100644 langtools/test/tools/javac/positions/T6402077.java create mode 100644 langtools/test/tools/javac/positions/T6404194.java create mode 100644 langtools/test/tools/javac/processing/6348193/T6348193.java create mode 100644 langtools/test/tools/javac/processing/6348499/A.java create mode 100644 langtools/test/tools/javac/processing/6348499/T6348499.java create mode 100644 langtools/test/tools/javac/processing/6350124/HelloWorldAP.java create mode 100644 langtools/test/tools/javac/processing/6350124/Marked.java create mode 100644 langtools/test/tools/javac/processing/6350124/Marker.java create mode 100644 langtools/test/tools/javac/processing/6350124/T6350124.java create mode 100644 langtools/test/tools/javac/processing/6359313/Foo.java create mode 100644 langtools/test/tools/javac/processing/6359313/T6359313.java create mode 100644 langtools/test/tools/javac/processing/6359313/package-info.java create mode 100644 langtools/test/tools/javac/processing/6365040/ProcBar.java create mode 100644 langtools/test/tools/javac/processing/6365040/ProcFoo.java create mode 100644 langtools/test/tools/javac/processing/6365040/T6365040.java create mode 100644 langtools/test/tools/javac/processing/6378728/T6378728.java create mode 100644 langtools/test/tools/javac/processing/6413690/T6413690.java create mode 100644 langtools/test/tools/javac/processing/6413690/TestMe.java create mode 100644 langtools/test/tools/javac/processing/6413690/src/Super.java create mode 100644 langtools/test/tools/javac/processing/6414633/A.java create mode 100644 langtools/test/tools/javac/processing/6414633/T6414633.java create mode 100644 langtools/test/tools/javac/processing/6430209/T6430209.java create mode 100644 langtools/test/tools/javac/processing/6430209/b6341534.java create mode 100644 langtools/test/tools/javac/processing/6430209/test0.java create mode 100644 langtools/test/tools/javac/processing/6430209/test1.java create mode 100644 langtools/test/tools/javac/processing/T6439826.java create mode 100644 langtools/test/tools/javac/processing/Xprint.java create mode 100644 langtools/test/tools/javac/processing/completion/TestCompletions.java create mode 100644 langtools/test/tools/javac/processing/environment/HelloWorld.java create mode 100644 langtools/test/tools/javac/processing/environment/TestSourceVersion.java create mode 100644 langtools/test/tools/javac/processing/environment/round/AnnotatedElementInfo.java create mode 100644 langtools/test/tools/javac/processing/environment/round/BuriedAnnotations.java create mode 100644 langtools/test/tools/javac/processing/environment/round/C1.java create mode 100644 langtools/test/tools/javac/processing/environment/round/C2.java create mode 100644 langtools/test/tools/javac/processing/environment/round/InheritedAnnotation.java create mode 100644 langtools/test/tools/javac/processing/environment/round/Part1.java create mode 100644 langtools/test/tools/javac/processing/environment/round/Part2.java create mode 100644 langtools/test/tools/javac/processing/environment/round/SurfaceAnnotations.java create mode 100644 langtools/test/tools/javac/processing/environment/round/TestElementsAnnotatedWith.java create mode 100644 langtools/test/tools/javac/processing/errors/Foo.java create mode 100644 langtools/test/tools/javac/processing/errors/TestFatalityOfParseErrors.java create mode 100644 langtools/test/tools/javac/processing/errors/TestOptionSyntaxErrors.java create mode 100644 langtools/test/tools/javac/processing/errors/TestReturnCode.java create mode 100644 langtools/test/tools/javac/processing/filer/TestFilerConstraints.java create mode 100644 langtools/test/tools/javac/processing/filer/TestGetResource.java create mode 100644 langtools/test/tools/javac/processing/filer/TestPackageInfo.java create mode 100644 langtools/test/tools/javac/processing/filer/foo/Foo.java create mode 100644 langtools/test/tools/javac/processing/filer/foo/bar/FuBar.java create mode 100644 langtools/test/tools/javac/processing/filer/foo/bar/package-info.java create mode 100644 langtools/test/tools/javac/processing/messager/6362067/T6362067.java create mode 100644 langtools/test/tools/javac/processing/messager/6362067/T6362067.out create mode 100644 langtools/test/tools/javac/processing/messager/MessagerBasics.java create mode 100644 langtools/test/tools/javac/processing/model/6194785/T6194785.java create mode 100644 langtools/test/tools/javac/processing/model/6194785/T6194785a.java create mode 100644 langtools/test/tools/javac/processing/model/6341534/T6341534.java create mode 100644 langtools/test/tools/javac/processing/model/6341534/dir/Foo.java create mode 100644 langtools/test/tools/javac/processing/model/6341534/dir/package-info.java create mode 100644 langtools/test/tools/javac/processing/model/element/TestElement.java create mode 100644 langtools/test/tools/javac/processing/model/element/TestNames.java create mode 100644 langtools/test/tools/javac/processing/model/element/TestPackageElement.java create mode 100644 langtools/test/tools/javac/processing/model/element/TypeParamBounds.java create mode 100644 langtools/test/tools/javac/processing/model/testgetallmembers/Main.java create mode 100644 langtools/test/tools/javac/processing/model/type/MirroredTypeEx/OverEager.java create mode 100644 langtools/test/tools/javac/processing/model/type/NoTypes.java create mode 100644 langtools/test/tools/javac/processing/model/type/TestTypeKind.java create mode 100644 langtools/test/tools/javac/processing/model/util/BinaryName.java create mode 100644 langtools/test/tools/javac/processing/model/util/GetTypeElemBadArg.java create mode 100644 langtools/test/tools/javac/processing/model/util/NoSupers.java create mode 100644 langtools/test/tools/javac/processing/model/util/OverridesSpecEx.java create mode 100644 langtools/test/tools/javac/processing/model/util/Superless.java create mode 100644 langtools/test/tools/javac/processing/model/util/TypesBadArg.java create mode 100644 langtools/test/tools/javac/processing/model/util/deprecation/Dep1.java create mode 100644 langtools/test/tools/javac/processing/model/util/deprecation/ExpectedDeprecation.java create mode 100644 langtools/test/tools/javac/processing/model/util/deprecation/TestDeprecation.java create mode 100644 langtools/test/tools/javac/processing/model/util/directSupersOfErr/C1.java create mode 100644 langtools/test/tools/javac/processing/model/util/directSupersOfErr/DirectSupersOfErr.java create mode 100644 langtools/test/tools/javac/processing/model/util/elements/TestGetPackageOf.java create mode 100644 langtools/test/tools/javac/processing/model/util/filter/ExpectedElementCounts.java create mode 100644 langtools/test/tools/javac/processing/model/util/filter/Foo1.java create mode 100644 langtools/test/tools/javac/processing/model/util/filter/TestIterables.java create mode 100644 langtools/test/tools/javac/processing/warnings/HelloWorld.java create mode 100644 langtools/test/tools/javac/processing/warnings/TestSourceVersionWarnings.java create mode 100644 langtools/test/tools/javac/processing/warnings/gold_0.out create mode 100644 langtools/test/tools/javac/processing/warnings/gold_sv_none.out create mode 100644 langtools/test/tools/javac/processing/warnings/gold_sv_warn_0_2.out create mode 100644 langtools/test/tools/javac/processing/warnings/gold_sv_warn_2_3.out create mode 100644 langtools/test/tools/javac/processing/warnings/gold_sv_warn_5_6.out create mode 100644 langtools/test/tools/javac/processing/warnings/gold_unsp_warn.out create mode 100644 langtools/test/tools/javac/proprietary/WarnClass.java create mode 100644 langtools/test/tools/javac/proprietary/WarnImport.java create mode 100644 langtools/test/tools/javac/proprietary/WarnMethod.java create mode 100644 langtools/test/tools/javac/proprietary/WarnStaticImport.java create mode 100644 langtools/test/tools/javac/proprietary/WarnVariable.java create mode 100644 langtools/test/tools/javac/proprietary/WarnWildcard.java create mode 100644 langtools/test/tools/javac/protectedAccess/ProtectedAccess_1.java create mode 100644 langtools/test/tools/javac/protectedAccess/ProtectedAccess_2.java create mode 100644 langtools/test/tools/javac/protectedAccess/ProtectedAccess_3.java create mode 100644 langtools/test/tools/javac/protectedAccess/ProtectedMemberAccess1.java create mode 100644 langtools/test/tools/javac/protectedAccess/ProtectedMemberAccess2.java create mode 100644 langtools/test/tools/javac/protectedAccess/ProtectedMemberAccess2.out create mode 100644 langtools/test/tools/javac/protectedAccess/ProtectedMemberAccess3.java create mode 100644 langtools/test/tools/javac/protectedAccess/ProtectedMemberAccess3.out create mode 100644 langtools/test/tools/javac/protectedAccess/ProtectedMemberAccess4.java create mode 100644 langtools/test/tools/javac/protectedAccess/ProtectedMemberAccess4.out create mode 100644 langtools/test/tools/javac/protectedAccess/ProtectedMemberAccess5/Main.java create mode 100644 langtools/test/tools/javac/protectedAccess/ProtectedMemberAccess5/z1/Z1.java create mode 100644 langtools/test/tools/javac/protectedAccess/ProtectedMemberAccess5/z2/Z2.java create mode 100644 langtools/test/tools/javac/protectedAccess/p/SuperClass.java create mode 100644 langtools/test/tools/javac/protectedAccess/pkg/SuperClass.java create mode 100644 langtools/test/tools/javac/protectedInner/AnonInnerClass.java create mode 100644 langtools/test/tools/javac/protectedInner/InnerClass.java create mode 100644 langtools/test/tools/javac/protectedInner/Outerclass.java create mode 100644 langtools/test/tools/javac/protectedInner/mypackage/Superclass.java create mode 100644 langtools/test/tools/javac/protectedInner/pkg1/Base.java create mode 100644 langtools/test/tools/javac/protectedInner/pkg2/Sub.java create mode 100644 langtools/test/tools/javac/rawDiags/Error.java create mode 100644 langtools/test/tools/javac/rawDiags/Error.out create mode 100644 langtools/test/tools/javac/rawDiags/Note.java create mode 100644 langtools/test/tools/javac/rawDiags/Note.out create mode 100644 langtools/test/tools/javac/rawDiags/Warning.java create mode 100644 langtools/test/tools/javac/rawDiags/Warning.out create mode 100644 langtools/test/tools/javac/scope/6225935/Bar.java create mode 100644 langtools/test/tools/javac/scope/6225935/Baz.java create mode 100644 langtools/test/tools/javac/scope/6225935/Estatico4.java create mode 100644 langtools/test/tools/javac/scope/6225935/StaticImportAccess.java create mode 100644 langtools/test/tools/javac/scope/6225935/T6214959.java create mode 100644 langtools/test/tools/javac/scope/6225935/T6225935.java create mode 100644 langtools/test/tools/javac/scope/6225935/T6381787.java create mode 100644 langtools/test/tools/javac/scope/6225935/Test.java create mode 100644 langtools/test/tools/javac/scope/6225935/a/Ambiguous.java create mode 100644 langtools/test/tools/javac/scope/6225935/a/Named.java create mode 100644 langtools/test/tools/javac/scope/6225935/a/Private.java create mode 100644 langtools/test/tools/javac/scope/6225935/a/Star.java create mode 100644 langtools/test/tools/javac/scope/6392998/T6392998.java create mode 100644 langtools/test/tools/javac/sourcePath/SourcePath.java create mode 100644 langtools/test/tools/javac/sourcePath/SourcePathA.java create mode 100644 langtools/test/tools/javac/sourcePath2/SourcePath2.java create mode 100644 langtools/test/tools/javac/sourcePath2/p/SourcePath2A.java create mode 100644 langtools/test/tools/javac/stackmap/T4955930.java create mode 100644 langtools/test/tools/javac/stackmap/T4955930.sh create mode 100644 langtools/test/tools/javac/stackmap/UninitThis.java create mode 100644 langtools/test/tools/javac/staticImport/Ambig1.java create mode 100644 langtools/test/tools/javac/staticImport/ImportInherit.java create mode 100644 langtools/test/tools/javac/staticImport/ImportPrivate.java create mode 100644 langtools/test/tools/javac/staticImport/PrivateStaticImport.java create mode 100644 langtools/test/tools/javac/staticImport/Shadow.java create mode 100644 langtools/test/tools/javac/staticImport/StaticImport.java create mode 100644 langtools/test/tools/javac/staticImport/StaticImport2.java create mode 100644 langtools/test/tools/javac/staticQualifiedNew/StaticQualifiedNew.java create mode 100644 langtools/test/tools/javac/staticQualifiedNew/p2/X.java create mode 100644 langtools/test/tools/javac/unicode/FirstChar.java create mode 100644 langtools/test/tools/javac/unicode/FirstChar2.java create mode 100644 langtools/test/tools/javac/unicode/NonasciiDigit.java create mode 100644 langtools/test/tools/javac/unicode/NonasciiDigit2.java create mode 100644 langtools/test/tools/javac/unicode/SubChar.java create mode 100644 langtools/test/tools/javac/unicode/SupplementaryJavaID1.java create mode 100644 langtools/test/tools/javac/unicode/SupplementaryJavaID2.java create mode 100644 langtools/test/tools/javac/unicode/SupplementaryJavaID3.java create mode 100644 langtools/test/tools/javac/unicode/SupplementaryJavaID4.java create mode 100644 langtools/test/tools/javac/unicode/SupplementaryJavaID5.java create mode 100644 langtools/test/tools/javac/unicode/SupplementaryJavaID6.java create mode 100644 langtools/test/tools/javac/unicode/SupplementaryJavaID6.sh create mode 100644 langtools/test/tools/javac/unicode/TripleQuote.java create mode 100644 langtools/test/tools/javac/unicode/UnicodeAtEOL.java create mode 100644 langtools/test/tools/javac/unicode/UnicodeCommentDelimiter.java create mode 100644 langtools/test/tools/javac/unicode/UnicodeNewline.java create mode 100644 langtools/test/tools/javac/unicode/UnicodeNewline.out create mode 100644 langtools/test/tools/javac/unicode/UnicodeUnicode.java create mode 100644 langtools/test/tools/javac/unicode/Unmappable.java create mode 100644 langtools/test/tools/javac/unit/T6198196.java create mode 100644 langtools/test/tools/javac/unit/util/convert/EnclosingCandidates.java create mode 100644 langtools/test/tools/javac/unit/util/list/AbstractList.java create mode 100644 langtools/test/tools/javac/unit/util/list/FromArray.java create mode 100644 langtools/test/tools/javac/util/filemanager/TestName.java create mode 100644 langtools/test/tools/javac/util/list/TList.java create mode 100644 langtools/test/tools/javac/varargs/Anon.java create mode 100644 langtools/test/tools/javac/varargs/BadSyntax2.java create mode 100644 langtools/test/tools/javac/varargs/Varargs1.java create mode 100644 langtools/test/tools/javac/varargs/VarargsOverride.java create mode 100644 langtools/test/tools/javac/varargs/Warn1.java create mode 100644 langtools/test/tools/javac/varargs/Warn2.java create mode 100644 langtools/test/tools/javac/varargs/warning/Warn1.java create mode 100644 langtools/test/tools/javac/varargs/warning/Warn2.java create mode 100644 langtools/test/tools/javac/varargs/warning/Warn3.java create mode 100644 langtools/test/tools/javac/versionOpt.sh create mode 100644 langtools/test/tools/javac/versions/CheckClassFileVersion.java create mode 100644 langtools/test/tools/javac/versions/check.sh create mode 100644 langtools/test/tools/javac/warnings/DepAnn.java create mode 100644 langtools/test/tools/javac/warnings/Deprecation.java create mode 100644 langtools/test/tools/javac/warnings/Deprecation.lintAll.out create mode 100644 langtools/test/tools/javac/warnings/Deprecation.lintDeprecation.out create mode 100644 langtools/test/tools/javac/warnings/Deprecation.noLint.out create mode 100644 langtools/test/tools/javac/warnings/DivZero.java create mode 100644 langtools/test/tools/javac/warnings/DivZero.lint.out create mode 100644 langtools/test/tools/javac/warnings/DivZero.noLint.out create mode 100644 langtools/test/tools/javac/warnings/FallThrough.java create mode 100644 langtools/test/tools/javac/warnings/FallThrough.lintAll.out create mode 100644 langtools/test/tools/javac/warnings/FallThrough.lintFallThrough.out create mode 100644 langtools/test/tools/javac/warnings/FallThrough.noLint.out create mode 100644 langtools/test/tools/javac/warnings/Finally.java create mode 100644 langtools/test/tools/javac/warnings/Serial.java create mode 100644 langtools/test/tools/javac/warnings/Unchecked.java create mode 100644 langtools/test/tools/javac/warnings/Unchecked.lintAll.out create mode 100644 langtools/test/tools/javac/warnings/Unchecked.lintUnchecked.out create mode 100644 langtools/test/tools/javac/warnings/Unchecked.noLint.out create mode 100644 langtools/test/tools/javadoc/BooleanConst.java create mode 100644 langtools/test/tools/javadoc/BreakIteratorWarning.java create mode 100644 langtools/test/tools/javadoc/FlagsTooEarly.java create mode 100644 langtools/test/tools/javadoc/InlineTagsWithBraces.java create mode 100644 langtools/test/tools/javadoc/LangVers.java create mode 100644 langtools/test/tools/javadoc/MethodLinks.java create mode 100644 langtools/test/tools/javadoc/NoStar.java create mode 100644 langtools/test/tools/javadoc/T4994049/FileWithTabs.java create mode 100644 langtools/test/tools/javadoc/T4994049/T4994049.java create mode 100644 langtools/test/tools/javadoc/XWerror.java create mode 100644 langtools/test/tools/javadoc/annotations/annotateMethodsFields/Main.java create mode 100644 langtools/test/tools/javadoc/annotations/annotateMethodsFields/expected.out create mode 100644 langtools/test/tools/javadoc/annotations/annotateMethodsFields/pkg1/A.java create mode 100644 langtools/test/tools/javadoc/annotations/annotateMethodsFields/pkg1/B.java create mode 100644 langtools/test/tools/javadoc/annotations/annotateMethodsFields/pkg1/E.java create mode 100644 langtools/test/tools/javadoc/annotations/annotatePackage/Main.java create mode 100644 langtools/test/tools/javadoc/annotations/annotatePackage/expected.out create mode 100644 langtools/test/tools/javadoc/annotations/annotatePackage/pkg1/A.java create mode 100644 langtools/test/tools/javadoc/annotations/annotatePackage/pkg1/package-info.java create mode 100644 langtools/test/tools/javadoc/annotations/annotatePackage/pkg1/package.html create mode 100644 langtools/test/tools/javadoc/annotations/annotatePackage/pkg2/B.java create mode 100644 langtools/test/tools/javadoc/annotations/annotatePackage/pkg2/package.html create mode 100644 langtools/test/tools/javadoc/annotations/annotateParams/Main.java create mode 100644 langtools/test/tools/javadoc/annotations/annotateParams/expected.out create mode 100644 langtools/test/tools/javadoc/annotations/annotateParams/pkg1/A.java create mode 100644 langtools/test/tools/javadoc/annotations/annotateParams/pkg1/C.java create mode 100644 langtools/test/tools/javadoc/annotations/badVals/Main.java create mode 100644 langtools/test/tools/javadoc/annotations/badVals/pkg1/A.java create mode 100644 langtools/test/tools/javadoc/annotations/defaults/Main.java create mode 100644 langtools/test/tools/javadoc/annotations/defaults/expected.out create mode 100644 langtools/test/tools/javadoc/annotations/defaults/pkg1/A.java create mode 100644 langtools/test/tools/javadoc/annotations/defaults/pkg1/B.java create mode 100644 langtools/test/tools/javadoc/annotations/elementTypes/Main.java create mode 100644 langtools/test/tools/javadoc/annotations/elementTypes/expected.out create mode 100644 langtools/test/tools/javadoc/annotations/elementTypes/pkg1/A.java create mode 100644 langtools/test/tools/javadoc/annotations/elementTypes/pkg1/B.java create mode 100644 langtools/test/tools/javadoc/annotations/shortcuts/Main.java create mode 100644 langtools/test/tools/javadoc/annotations/shortcuts/expected.out create mode 100644 langtools/test/tools/javadoc/annotations/shortcuts/pkg1/A.java create mode 100644 langtools/test/tools/javadoc/annotations/shortcuts/pkg1/Array.java create mode 100644 langtools/test/tools/javadoc/annotations/shortcuts/pkg1/Marker.java create mode 100644 langtools/test/tools/javadoc/annotations/shortcuts/pkg1/Value.java create mode 100644 langtools/test/tools/javadoc/badSuper/BadSuper.java create mode 100644 langtools/test/tools/javadoc/badSuper/p/A.java create mode 100644 langtools/test/tools/javadoc/badSuper/p/B.java create mode 100644 langtools/test/tools/javadoc/completionFailure/CompletionFailure.java create mode 100644 langtools/test/tools/javadoc/completionFailure/pkg/A.java create mode 100644 langtools/test/tools/javadoc/completionFailure/pkg/B.java create mode 100644 langtools/test/tools/javadoc/dupOk/DupOk.java create mode 100644 langtools/test/tools/javadoc/dupOk/sp1/p/A.java create mode 100644 langtools/test/tools/javadoc/dupOk/sp2/p/A.java create mode 100644 langtools/test/tools/javadoc/dupOk/sp2/p/B.java create mode 100644 langtools/test/tools/javadoc/enum/docComments/Main.java create mode 100644 langtools/test/tools/javadoc/enum/docComments/pkg1/Operation.java create mode 100644 langtools/test/tools/javadoc/enum/enumType/Main.java create mode 100644 langtools/test/tools/javadoc/enum/enumType/expected.out create mode 100644 langtools/test/tools/javadoc/enum/enumType/pkg1/QuotablePerson.java create mode 100644 langtools/test/tools/javadoc/generics/genericClass/Main.java create mode 100644 langtools/test/tools/javadoc/generics/genericClass/expected.out create mode 100644 langtools/test/tools/javadoc/generics/genericClass/pkg1/A.java create mode 100644 langtools/test/tools/javadoc/generics/genericInnerAndOuter/Main.java create mode 100644 langtools/test/tools/javadoc/generics/genericInnerAndOuter/expected.out create mode 100644 langtools/test/tools/javadoc/generics/genericInnerAndOuter/pkg1/O.java create mode 100644 langtools/test/tools/javadoc/generics/genericInnerAndOuter/pkg1/X.java create mode 100644 langtools/test/tools/javadoc/generics/genericInterface/Main.java create mode 100644 langtools/test/tools/javadoc/generics/genericInterface/expected.out create mode 100644 langtools/test/tools/javadoc/generics/genericInterface/pkg1/A.java create mode 100644 langtools/test/tools/javadoc/generics/genericMethod/Main.java create mode 100644 langtools/test/tools/javadoc/generics/genericMethod/expected.out create mode 100644 langtools/test/tools/javadoc/generics/genericMethod/pkg1/A.java create mode 100644 langtools/test/tools/javadoc/generics/genericSuper/Main.java create mode 100644 langtools/test/tools/javadoc/generics/genericSuper/expected.out create mode 100644 langtools/test/tools/javadoc/generics/genericSuper/pkg1/A.java create mode 100644 langtools/test/tools/javadoc/generics/supertypes/Main.java create mode 100644 langtools/test/tools/javadoc/generics/supertypes/expected.out create mode 100644 langtools/test/tools/javadoc/generics/supertypes/pkg1/A.java create mode 100644 langtools/test/tools/javadoc/generics/supertypes/pkg1/B.java create mode 100644 langtools/test/tools/javadoc/generics/throwsGeneric/Main.java create mode 100644 langtools/test/tools/javadoc/generics/throwsGeneric/expected.out create mode 100644 langtools/test/tools/javadoc/generics/throwsGeneric/pkg1/A.java create mode 100644 langtools/test/tools/javadoc/generics/tparamCycle/Main.java create mode 100644 langtools/test/tools/javadoc/generics/tparamCycle/pkg1/LikeEnum.java create mode 100644 langtools/test/tools/javadoc/generics/tparamTagOnMethod/Main.java create mode 100644 langtools/test/tools/javadoc/generics/tparamTagOnMethod/expected.out create mode 100644 langtools/test/tools/javadoc/generics/tparamTagOnMethod/pkg1/A.java create mode 100644 langtools/test/tools/javadoc/generics/tparamTagOnType/Main.java create mode 100644 langtools/test/tools/javadoc/generics/tparamTagOnType/expected.out create mode 100644 langtools/test/tools/javadoc/generics/tparamTagOnType/pkg1/A.java create mode 100644 langtools/test/tools/javadoc/generics/wildcards/Main.java create mode 100644 langtools/test/tools/javadoc/generics/wildcards/expected.out create mode 100644 langtools/test/tools/javadoc/generics/wildcards/pkg1/A.java create mode 100644 langtools/test/tools/javadoc/imports/I.java create mode 100644 langtools/test/tools/javadoc/imports/MissingImport.java create mode 100644 langtools/test/tools/javadoc/lib/Tester.java create mode 100644 langtools/test/tools/javadoc/nestedClass/NestedClass.java create mode 100644 langtools/test/tools/javadoc/nestedClass/NestedClassB.java create mode 100644 langtools/test/tools/javadoc/outputRedirect/Test.java create mode 100644 langtools/test/tools/javadoc/outputRedirect/p/OutputRedirect.java create mode 100644 langtools/test/tools/javadoc/sourceOnly/Test.java create mode 100644 langtools/test/tools/javadoc/sourceOnly/p/NonSource.class create mode 100644 langtools/test/tools/javadoc/sourceOnly/p/SourceOnly.java create mode 100644 langtools/test/tools/javadoc/subpackageIgnore/SubpackageIgnore.java create mode 100644 langtools/test/tools/javadoc/subpackageIgnore/pkg1/not-subpkg/SomeJavaFile.java create mode 100644 langtools/test/tools/javadoc/varArgs/Main.java create mode 100644 langtools/test/tools/javadoc/varArgs/expected.out create mode 100644 langtools/test/tools/javadoc/varArgs/pkg1/A.java create mode 100644 langtools/test/tools/javah/6257087/foo.java create mode 100644 langtools/test/tools/javah/6257087/foo.sh create mode 100644 langtools/test/tools/javah/6257087/foo_bar.h create mode 100644 langtools/test/tools/javah/ConstMacroTest.sh create mode 100644 langtools/test/tools/javah/MissingParamClassException.java create mode 100644 langtools/test/tools/javah/MissingParamClassTest.sh create mode 100644 langtools/test/tools/javah/ParamClassTest.java create mode 100644 langtools/test/tools/javah/ReadOldClass.sh create mode 100644 langtools/test/tools/javah/SubClassConsts.java create mode 100644 langtools/test/tools/javah/SubClassConsts.out create mode 100644 langtools/test/tools/javah/SubClassConsts.win create mode 100644 langtools/test/tools/javah/SuperClassConsts.java create mode 100644 langtools/test/tools/javah/T5070898.java create mode 100644 langtools/test/tools/javap/ExtPath.java create mode 100644 langtools/test/tools/javap/NotPackagePrivateInterface.java create mode 100644 langtools/test/tools/javap/PublicInterfaceTest.sh create mode 100644 langtools/test/tools/javap/pathsep.sh create mode 100644 langtools/test/tools/javap/stackmap/T6271292.java create mode 100644 langtools/test/tools/javap/stackmap/T6271292.out create mode 100644 langtools/test/tools/javap/stackmap/T6271292.sh diff --git a/langtools/.hgignore b/langtools/.hgignore new file mode 100644 index 00000000000..ca1b0b21ee2 --- /dev/null +++ b/langtools/.hgignore @@ -0,0 +1,3 @@ +^build/ +^dist/ +^nbproject/private/ diff --git a/langtools/ASSEMBLY_EXCEPTION b/langtools/ASSEMBLY_EXCEPTION new file mode 100644 index 00000000000..8b7ac1d0813 --- /dev/null +++ b/langtools/ASSEMBLY_EXCEPTION @@ -0,0 +1,27 @@ + +OPENJDK ASSEMBLY EXCEPTION + +The OpenJDK source code made available by Sun at openjdk.java.net and +openjdk.dev.java.net ("OpenJDK Code") is distributed under the terms of the +GNU General Public License version 2 +only ("GPL2"), with the following clarification and special exception. + + Linking this OpenJDK Code statically or dynamically with other code + is making a combined work based on this library. Thus, the terms + and conditions of GPL2 cover the whole combination. + + As a special exception, Sun gives you permission to link this + OpenJDK Code with certain code licensed by Sun as indicated at + http://openjdk.java.net/legal/exception-modules-2007-05-08.html + ("Designated Exception Modules") to produce an executable, + regardless of the license terms of the Designated Exception Modules, + and to copy and distribute the resulting executable under GPL2, + provided that the Designated Exception Modules continue to be + governed by the licenses under which they were offered by Sun. + +As such, it allows licensees and sublicensees of Sun's GPL2 OpenJDK Code to +build an executable that includes those portions of necessary code that Sun +could not provide under GPL2 (or that Sun has provided under GPL2 with the +Classpath exception). If you modify or add to the OpenJDK code, that new +GPL2 code may still be combined with Designated Exception Modules if the +new code is made subject to this exception by its copyright holder. diff --git a/langtools/LICENSE b/langtools/LICENSE new file mode 100644 index 00000000000..eeab58c21c9 --- /dev/null +++ b/langtools/LICENSE @@ -0,0 +1,347 @@ +The GNU General Public License (GPL) + +Version 2, June 1991 + +Copyright (C) 1989, 1991 Free Software Foundation, Inc. +59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Everyone is permitted to copy and distribute verbatim copies of this license +document, but changing it is not allowed. + +Preamble + +The licenses for most software are designed to take away your freedom to share +and change it. By contrast, the GNU General Public License is intended to +guarantee your freedom to share and change free software--to make sure the +software is free for all its users. This General Public License applies to +most of the Free Software Foundation's software and to any other program whose +authors commit to using it. (Some other Free Software Foundation software is +covered by the GNU Library General Public License instead.) You can apply it to +your programs, too. + +When we speak of free software, we are referring to freedom, not price. Our +General Public Licenses are designed to make sure that you have the freedom to +distribute copies of free software (and charge for this service if you wish), +that you receive source code or can get it if you want it, that you can change +the software or use pieces of it in new free programs; and that you know you +can do these things. + +To protect your rights, we need to make restrictions that forbid anyone to deny +you these rights or to ask you to surrender the rights. These restrictions +translate to certain responsibilities for you if you distribute copies of the +software, or if you modify it. + +For example, if you distribute copies of such a program, whether gratis or for +a fee, you must give the recipients all the rights that you have. You must +make sure that they, too, receive or can get the source code. And you must +show them these terms so they know their rights. + +We protect your rights with two steps: (1) copyright the software, and (2) +offer you this license which gives you legal permission to copy, distribute +and/or modify the software. + +Also, for each author's protection and ours, we want to make certain that +everyone understands that there is no warranty for this free software. If the +software is modified by someone else and passed on, we want its recipients to +know that what they have is not the original, so that any problems introduced +by others will not reflect on the original authors' reputations. + +Finally, any free program is threatened constantly by software patents. We +wish to avoid the danger that redistributors of a free program will +individually obtain patent licenses, in effect making the program proprietary. +To prevent this, we have made it clear that any patent must be licensed for +everyone's free use or not licensed at all. + +The precise terms and conditions for copying, distribution and modification +follow. + +TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + +0. This License applies to any program or other work which contains a notice +placed by the copyright holder saying it may be distributed under the terms of +this General Public License. The "Program", below, refers to any such program +or work, and a "work based on the Program" means either the Program or any +derivative work under copyright law: that is to say, a work containing the +Program or a portion of it, either verbatim or with modifications and/or +translated into another language. (Hereinafter, translation is included +without limitation in the term "modification".) Each licensee is addressed as +"you". + +Activities other than copying, distribution and modification are not covered by +this License; they are outside its scope. The act of running the Program is +not restricted, and the output from the Program is covered only if its contents +constitute a work based on the Program (independent of having been made by +running the Program). Whether that is true depends on what the Program does. + +1. You may copy and distribute verbatim copies of the Program's source code as +you receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice and +disclaimer of warranty; keep intact all the notices that refer to this License +and to the absence of any warranty; and give any other recipients of the +Program a copy of this License along with the Program. + +You may charge a fee for the physical act of transferring a copy, and you may +at your option offer warranty protection in exchange for a fee. + +2. You may modify your copy or copies of the Program or any portion of it, thus +forming a work based on the Program, and copy and distribute such modifications +or work under the terms of Section 1 above, provided that you also meet all of +these conditions: + + a) You must cause the modified files to carry prominent notices stating + that you changed the files and the date of any change. + + b) You must cause any work that you distribute or publish, that in whole or + in part contains or is derived from the Program or any part thereof, to be + licensed as a whole at no charge to all third parties under the terms of + this License. + + c) If the modified program normally reads commands interactively when run, + you must cause it, when started running for such interactive use in the + most ordinary way, to print or display an announcement including an + appropriate copyright notice and a notice that there is no warranty (or + else, saying that you provide a warranty) and that users may redistribute + the program under these conditions, and telling the user how to view a copy + of this License. (Exception: if the Program itself is interactive but does + not normally print such an announcement, your work based on the Program is + not required to print an announcement.) + +These requirements apply to the modified work as a whole. If identifiable +sections of that work are not derived from the Program, and can be reasonably +considered independent and separate works in themselves, then this License, and +its terms, do not apply to those sections when you distribute them as separate +works. But when you distribute the same sections as part of a whole which is a +work based on the Program, the distribution of the whole must be on the terms +of this License, whose permissions for other licensees extend to the entire +whole, and thus to each and every part regardless of who wrote it. + +Thus, it is not the intent of this section to claim rights or contest your +rights to work written entirely by you; rather, the intent is to exercise the +right to control the distribution of derivative or collective works based on +the Program. + +In addition, mere aggregation of another work not based on the Program with the +Program (or with a work based on the Program) on a volume of a storage or +distribution medium does not bring the other work under the scope of this +License. + +3. You may copy and distribute the Program (or a work based on it, under +Section 2) in object code or executable form under the terms of Sections 1 and +2 above provided that you also do one of the following: + + a) Accompany it with the complete corresponding machine-readable source + code, which must be distributed under the terms of Sections 1 and 2 above + on a medium customarily used for software interchange; or, + + b) Accompany it with a written offer, valid for at least three years, to + give any third party, for a charge no more than your cost of physically + performing source distribution, a complete machine-readable copy of the + corresponding source code, to be distributed under the terms of Sections 1 + and 2 above on a medium customarily used for software interchange; or, + + c) Accompany it with the information you received as to the offer to + distribute corresponding source code. (This alternative is allowed only + for noncommercial distribution and only if you received the program in + object code or executable form with such an offer, in accord with + Subsection b above.) + +The source code for a work means the preferred form of the work for making +modifications to it. For an executable work, complete source code means all +the source code for all modules it contains, plus any associated interface +definition files, plus the scripts used to control compilation and installation +of the executable. However, as a special exception, the source code +distributed need not include anything that is normally distributed (in either +source or binary form) with the major components (compiler, kernel, and so on) +of the operating system on which the executable runs, unless that component +itself accompanies the executable. + +If distribution of executable or object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the source +code from the same place counts as distribution of the source code, even though +third parties are not compelled to copy the source along with the object code. + +4. You may not copy, modify, sublicense, or distribute the Program except as +expressly provided under this License. Any attempt otherwise to copy, modify, +sublicense or distribute the Program is void, and will automatically terminate +your rights under this License. However, parties who have received copies, or +rights, from you under this License will not have their licenses terminated so +long as such parties remain in full compliance. + +5. You are not required to accept this License, since you have not signed it. +However, nothing else grants you permission to modify or distribute the Program +or its derivative works. These actions are prohibited by law if you do not +accept this License. Therefore, by modifying or distributing the Program (or +any work based on the Program), you indicate your acceptance of this License to +do so, and all its terms and conditions for copying, distributing or modifying +the Program or works based on it. + +6. Each time you redistribute the Program (or any work based on the Program), +the recipient automatically receives a license from the original licensor to +copy, distribute or modify the Program subject to these terms and conditions. +You may not impose any further restrictions on the recipients' exercise of the +rights granted herein. You are not responsible for enforcing compliance by +third parties to this License. + +7. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), conditions +are imposed on you (whether by court order, agreement or otherwise) that +contradict the conditions of this License, they do not excuse you from the +conditions of this License. If you cannot distribute so as to satisfy +simultaneously your obligations under this License and any other pertinent +obligations, then as a consequence you may not distribute the Program at all. +For example, if a patent license would not permit royalty-free redistribution +of the Program by all those who receive copies directly or indirectly through +you, then the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Program. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply and +the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any patents or +other property right claims or to contest validity of any such claims; this +section has the sole purpose of protecting the integrity of the free software +distribution system, which is implemented by public license practices. Many +people have made generous contributions to the wide range of software +distributed through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing to +distribute software through any other system and a licensee cannot impose that +choice. + +This section is intended to make thoroughly clear what is believed to be a +consequence of the rest of this License. + +8. If the distribution and/or use of the Program is restricted in certain +countries either by patents or by copyrighted interfaces, the original +copyright holder who places the Program under this License may add an explicit +geographical distribution limitation excluding those countries, so that +distribution is permitted only in or among countries not thus excluded. In +such case, this License incorporates the limitation as if written in the body +of this License. + +9. The Free Software Foundation may publish revised and/or new versions of the +General Public License from time to time. Such new versions will be similar in +spirit to the present version, but may differ in detail to address new problems +or concerns. + +Each version is given a distinguishing version number. If the Program +specifies a version number of this License which applies to it and "any later +version", you have the option of following the terms and conditions either of +that version or of any later version published by the Free Software Foundation. +If the Program does not specify a version number of this License, you may +choose any version ever published by the Free Software Foundation. + +10. If you wish to incorporate parts of the Program into other free programs +whose distribution conditions are different, write to the author to ask for +permission. For software which is copyrighted by the Free Software Foundation, +write to the Free Software Foundation; we sometimes make exceptions for this. +Our decision will be guided by the two goals of preserving the free status of +all derivatives of our free software and of promoting the sharing and reuse of +software generally. + +NO WARRANTY + +11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR +THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE +STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE +PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, +INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND +FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND +PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, +YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + +12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL +ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE +PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR +INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA +BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), EVEN IF SUCH HOLDER +OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. + +END OF TERMS AND CONDITIONS + +How to Apply These Terms to Your New Programs + +If you develop a new program, and you want it to be of the greatest possible +use to the public, the best way to achieve this is to make it free software +which everyone can redistribute and change under these terms. + +To do so, attach the following notices to the program. It is safest to attach +them to the start of each source file to most effectively convey the exclusion +of warranty; and each file should have at least the "copyright" line and a +pointer to where the full notice is found. + + One line to give the program's name and a brief idea of what it does. + + Copyright (C) + + This program is free software; you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by the Free + Software Foundation; either version 2 of the License, or (at your option) + any later version. + + This program is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + more details. + + You should have received a copy of the GNU General Public License along + with this program; if not, write to the Free Software Foundation, Inc., 59 + Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +If the program is interactive, make it output a short notice like this when it +starts in an interactive mode: + + Gnomovision version 69, Copyright (C) year name of author Gnomovision comes + with ABSOLUTELY NO WARRANTY; for details type 'show w'. This is free + software, and you are welcome to redistribute it under certain conditions; + type 'show c' for details. + +The hypothetical commands 'show w' and 'show c' should show the appropriate +parts of the General Public License. Of course, the commands you use may be +called something other than 'show w' and 'show c'; they could even be +mouse-clicks or menu items--whatever suits your program. + +You should also get your employer (if you work as a programmer) or your school, +if any, to sign a "copyright disclaimer" for the program, if necessary. Here +is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the program + 'Gnomovision' (which makes passes at compilers) written by James Hacker. + + signature of Ty Coon, 1 April 1989 + + Ty Coon, President of Vice + +This General Public License does not permit incorporating your program into +proprietary programs. If your program is a subroutine library, you may +consider it more useful to permit linking proprietary applications with the +library. If this is what you want to do, use the GNU Library General Public +License instead of this License. + + +"CLASSPATH" EXCEPTION TO THE GPL + +Certain source files distributed by Sun Microsystems, Inc. are subject to +the following clarification and special exception to the GPL, but only where +Sun has expressly included in the particular source file's header the words +"Sun designates this particular file as subject to the "Classpath" exception +as provided by Sun in the LICENSE file that accompanied this code." + + Linking this library statically or dynamically with other modules is making + a combined work based on this library. Thus, the terms and conditions of + the GNU General Public License cover the whole combination. + + As a special exception, the copyright holders of this library give you + permission to link this library with independent modules to produce an + executable, regardless of the license terms of these independent modules, + and to copy and distribute the resulting executable under terms of your + choice, provided that you also meet, for each linked independent module, + the terms and conditions of the license of that module. An independent + module is a module which is not derived from or based on this library. If + you modify this library, you may extend this exception to your version of + the library, but you are not obligated to do so. If you do not wish to do + so, delete this exception statement from your version. diff --git a/langtools/README b/langtools/README new file mode 100644 index 00000000000..466426d8ad6 --- /dev/null +++ b/langtools/README @@ -0,0 +1,43 @@ +Building the "langtools" workspace. + +The "langtools" workspace can be built from the command line with Ant. +The build file is make/build.xml, in conjunction with make/build.properties. +Some additional user-specific properties files are also read, to allow +you to customize selected properties as needed. + +Individual tools within the workspace can also be built and worked on +with NetBeans, using the projects in the make/netbeans directory. + +The "langtools" workspace can also be built from the command line with +GNU Make, although the Makefile is simply a wrapper around the Ant +build file. This is provided for systems (such as the full OpenJDK build) +that expect to be able to build this workspace with GNU Make. + +System Requirements: + Ant: version 1.6.5 or later + NetBeans: version 5.0 or later (optional) + JDK: currently version 1.5.0, although 1.6.0 is recommended + OS: any system supporting the above tools + +For more information: + Ant: http://ant.apache.org/ + GNU Make: http://www.gnu.org/software/make/ + NetBeans: http://www.netbeans.org/ + + +Testing the "langtools" workspace. + +The primary set of tests for the compiler is the compiler TCK. This +tests that the compiler performs according to the specifications in +JLS and JVMS. + +In addition, there is a substantial collection of regression and unit +tests for all the tools in the maain langtools test/ directory. + +Finally, there is a small set of tests to do basic validation of a build +of the langtools workspace for use by JDK. These tests check the contents +of the dist/ directory generated by the build, and verify that the various +tools can do basic "Hello World"-style processing. These tests should be +run by jtreg, with the -jdk option set a version of JDK capable of running +the default output of the javac compiler in this workspace. Currently, +this means JDK 6 or better. diff --git a/langtools/THIRD_PARTY_README b/langtools/THIRD_PARTY_README new file mode 100644 index 00000000000..9f4d7e5087a --- /dev/null +++ b/langtools/THIRD_PARTY_README @@ -0,0 +1,1616 @@ +DO NOT TRANSLATE OR LOCALIZE. + +%% This notice is provided with respect to Thai dictionary for text breaking, which may be included with this software: + +--- begin of LICENSE file --- + +Copyright (C) 1982 The Royal Institute, Thai Royal Government. + +Copyright (C) 1998 National Electronics and Computer Technology Center, + National Science and Technology Development Agency, + Ministry of Science Technology and Environment, + Thai Royal Government. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the "Software"), to +deal in the Software without restriction, including without +limitation the rights to use, copy, modify, merge, publish, distribute, +sublicense, and/or sell copies of the Software, and to permit persons to +whom the Software is furnished to do so, subject to the following +conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN +NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE +USE OR OTHER DEALINGS IN THE SOFTWARE. + +--- end of LICENSE file --- +%% This notice is provided with respect to ASM, which may be included with this software: +Copyright (c) 2000-2005 INRIA, France Telecom +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + +3. Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from + this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE +ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR +CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF +SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN +CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) +ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF +THE POSSIBILITY OF SUCH DAMAGE. +%% This notice is provided with respect to zlib 1.1.3, which may be included with this software: + +Acknowledgments: + + The deflate format used by zlib was defined by Phil Katz. The deflate + and zlib specifications were written by L. Peter Deutsch. Thanks to all the + people who reported problems and suggested various improvements in zlib; + they are too numerous to cite here. + +Copyright notice: + + (C) 1995-1998 Jean-loup Gailly and Mark Adler + + This software is provided 'as-is', without any express or implied + warranty. In no event will the authors be held liable for any damages + arising from the use of this software. + + Permission is granted to anyone to use this software for any purpose, + including commercial applications, and to alter it and redistribute it + freely, subject to the following restrictions: + + 1. The origin of this software must not be misrepresented; you must not + claim that you wrote the original software. If you use this software + in a product, an acknowledgment in the product documentation would be + appreciated but is not required. + 2. Altered source versions must be plainly marked as such, and must not be + misrepresented as being the original software. + 3. This notice may not be removed or altered from any source distribution. + + Jean-loup Gailly Mark Adler + jloup@gzip.org madler@alumni.caltech.edu + +If you use the zlib library in a product, we would appreciate *not* +receiving lengthy legal documents to sign. The sources are provided +for free but without warranty of any kind. The library has been +entirely written by Jean-loup Gailly and Mark Adler; it does not +include third-party code. + +If you redistribute modified sources, we would appreciate that you include +in the file ChangeLog history information documenting your changes. + +%% This notice is provided with respect to W3C (DTD for XML Signatures), which may be included with this software: +W3C® SOFTWARE NOTICE AND LICENSE +Copyright © 1994-2002 World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/ +This W3C work (including software, documents, or other related items) is being provided by the copyright holders under the following license. By obtaining, using and/or copying this work, you (the licensee) agree that you have read, understood, and will comply with the following terms and conditions: +Permission to use, copy, modify, and distribute this software and its documentation, with or without modification,  for any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies of the software and documentation or portions thereof, including modifications, that you make: +1.The full text of this NOTICE in a location viewable to users of the redistributed or derivative work. +2.Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, a short notice of the following form (hypertext is preferred, text is permitted) should be used within the body of any redistributed or derivative code: "Copyright © [$date-of-software] World Wide Web Consortium, (Massachusetts Institute of Technology, Institut National de Recherche en Informatique et en Automatique, Keio University). All Rights Reserved. http://www.w3.org/Consortium/Legal/" +3.Notice of any changes or modifications to the W3C files, including the date changes were made. (We recommend you provide URIs to the location from which the code is derived.) +THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THE USE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS, COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION. +The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the software without specific, written prior permission. Title to copyright in this software and any associated documentation will at all times remain with copyright holders. +____________________________________ +This formulation of W3C's notice and license became active on August 14 1998 so as to improve compatibility with GPL. This version ensures that W3C software licensing terms are no more restrictive than GPL and consequently W3C software may be distributed in GPL packages. See the older formulation for the policy prior to this date. Please see our Copyright FAQ for common questions about using materials from our site, including specific terms and conditions for packages like libwww, Amaya, and Jigsaw. Other questions about this notice can be directed to site-policy@w3.org. +  +%% This notice is provided with respect to jscheme.jar, which may be included with this software: +Software License Agreement +Copyright © 1998-2002 by Peter Norvig. +Permission is granted to anyone to use this software, in source or object code form, on any computer system, and to modify, compile, decompile, run, and redistribute it to anyone else, subject to the following restrictions: +1.The author makes no warranty of any kind, either expressed or implied, about the suitability of this software for any purpose. +2.The author accepts no liability of any kind for damages or other consequences of the use of this software, even if they arise from defects in the software. +3.The origin of this software must not be misrepresented, either by explicit claim or by omission. +4.Altered versions must be plainly marked as such, and must not be misrepresented as being the original software. Altered versions may be distributed in packages under other licenses (such as the GNU license). +If you find this software useful, it would be nice if you let me (peter@norvig.com) know about it, and nicer still if you send me modifications that you are willing to share. However, you are not required to do so. + + +%% This notice is provided with respect to PC/SC Lite for Suse Linux v. 1.1.1, which may be included with this software: + +Copyright (c) 1999-2004 David Corcoran +All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions +are met: + +1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. +2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. +3. The name of the author may not be used to endorse or promote products + derived from this software without specific prior written permission. + +Changes to this license can be made only by the copyright author with +explicit written consent. + +THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. +IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, +INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT +NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, +DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY +THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF +THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + +%% This notice is provided with respect to IAIK PKCS Wrapper, which may be included with this software: + +Copyright (c) 2002 Graz University of Technology. All rights reserved. +Redistribution and use in source and binary forms, with or without modification,are permitted provided that the following conditions are met: + + +1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. + +3. The end-user documentation included with the redistribution, if any, must include the following acknowledgment: + + "This product includes software developed by IAIK of Graz University of Technology." + + Alternately, this acknowledgment may appear in the software itself, if and wherever such third-party acknowledgments normally appear. + +4. The names "Graz University of Technology" and "IAIK of Graz University of Technology" must not be used to endorse or promote products derived from this software without prior written permission. + +5. Products derived from this software may not be called "IAIK PKCS Wrapper", nor may "IAIK" appear in their name, without prior written permission of Graz University of Technology. + +THIS SOFTWARE IS PROVIDED "AS IS" AND ANY EXPRESSED OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE LICENSOR BE +LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, +OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, +OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON +ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY +OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE +POSSIBILITY OF SUCH DAMAGE. + +%% This notice is provided with respect to Document Object Model (DOM) v. Level 3, which may be included with this software: + +W3Cýý SOFTWARE NOTICE AND LICENSE + +http://www.w3.org/Consortium/Legal/2002/copyright-software-20021231 + +This work (and included software, documentation such as READMEs, or other related items) is being +provided by the copyright holders under the following license. By obtaining, using and/or copying this work, you +(the licensee) agree that you have read, understood, and will comply with the following terms and conditions. + +Permission to copy, modify, and distribute this software and its documentation, with or without modification, for +any purpose and without fee or royalty is hereby granted, provided that you include the following on ALL copies +of the software and documentation or portions thereof, including modifications: + 1.The full text of this NOTICE in a location viewable to users of the redistributed or derivative work. + 2.Any pre-existing intellectual property disclaimers, notices, or terms and conditions. If none exist, the + W3C Software Short Notice should be included (hypertext is preferred, text is permitted) within the body + of any redistributed or derivative code. + 3.Notice of any changes or modifications to the files, including the date changes were made. (We + recommend you provide URIs to the location from which the code is derived.) +THIS SOFTWARE AND DOCUMENTATION IS PROVIDED "AS IS," AND COPYRIGHT HOLDERS MAKENO REPRESENTATIONS OR WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO, +WARRANTIES OF MERCHANTABILITY OR FITNESS FOR ANY PARTICULAR PURPOSE OR THAT THEUSE OF THE SOFTWARE OR DOCUMENTATION WILL NOT INFRINGE ANY THIRD PARTY PATENTS,COPYRIGHTS, TRADEMARKS OR OTHER RIGHTS. + +COPYRIGHT HOLDERS WILL NOT BE LIABLE FOR ANY DIRECT, INDIRECT, SPECIAL ORCONSEQUENTIAL DAMAGES ARISING OUT OF ANY USE OF THE SOFTWARE OR DOCUMENTATION. +The name and trademarks of copyright holders may NOT be used in advertising or publicity pertaining to the +software without specific, written prior permission. Title to copyright in this software and any associated +documentation will at all times remain with copyright holders. + +____________________________________ + +This formulation of W3C's notice and license became active on December 31 2002. This version removes the +copyright ownership notice such that this license can be used with materials other than those owned by the +W3C, reflects that ERCIM is now a host of the W3C, includes references to this specific dated version of the +license, and removes the ambiguous grant of "use". Otherwise, this version is the same as the previous +version and is written so as to preserve the Free Software Foundation's assessment of GPL compatibility and +OSI's certification under the Open Source Definition. Please see our Copyright FAQ for common questions +about using materials from our site, including specific terms and conditions for packages like libwww, Amaya, +and Jigsaw. Other questions about this notice can be directed to +site-policy@w3.org. + +%% This notice is provided with respect to Xalan, Xerces, which may be included with this software: + +/* + * The Apache Software License, Version 1.1 + * + * + * Copyright (c) 1999-2003 The Apache Software Foundation. All rights * reserved. + * + * Redistribution and use in source and binary forms, with or without + * modification, are permitted provided that the following conditions + * are met: + * + * 1. Redistributions of source code must retain the above copyright + * notice, this list of conditions and the following disclaimer. * + * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in + * the documentation and/or other materials provided with the + * distribution. + * + * 3. The end-user documentation included with the redistribution, + * if any, must include the following acknowledgment: + * "This product includes software developed by the + * Apache Software Foundation (http://www.apache.org/)." + * Alternately, this acknowledgment may appear in the software itself, * if and wherever such third-party acknowledgments normally appear. * + * 4. The names "Xerces" and "Apache Software Foundation" must + * not be used to endorse or promote products derived from this + * software without prior written permission. For written + * permission, please contact apache@apache.org. + * + * 5. Products derived from this software may not be called "Apache", + * nor may "Apache" appear in their name, without prior written + * permission of the Apache Software Foundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF + * SUCH DAMAGE. + * ==================================================================== * + * This software consists of voluntary contributions made by many + * individuals on behalf of the Apache Software Foundation and was + * originally based on software copyright (c) 1999, International + * Business Machines, Inc., http://www.ibm.com. For more + * information on the Apache Software Foundation, please see + * + +%% This notice is provided with respect to JavaScript, which may be included with this software: + +AMENDMENTS +The Netscape Public License Version 1.1 ("NPL") consists of the Mozilla Public License Version 1.1 with the following Amendments, including Exhibit A-Netscape Public License.  Files identified with "Exhibit A-Netscape Public License" are governed by the Netscape Public License Version 1.1. +Additional Terms applicable to the Netscape Public License. +I. Effect. +These additional terms described in this Netscape Public License -- Amendments shall apply to the Mozilla Communicator client code and to all Covered Code under this License. +II. ''Netscape's Branded Code'' means Covered Code that Netscape distributes and/or permits others to distribute under one or more trademark(s) which are controlled by Netscape but which are not licensed for use under this License. +III. Netscape and logo. +This License does not grant any rights to use the trademarks "Netscape'', the "Netscape N and horizon'' logo or the "Netscape lighthouse" logo, "Netcenter", "Gecko", "Java" or "JavaScript", "Smart Browsing" even if such marks are included in the Original Code or Modifications. +IV. Inability to Comply Due to Contractual Obligation. +Prior to licensing the Original Code under this License, Netscape has licensed third party code for use in Netscape's Branded Code. To the extent that Netscape is limited contractually from making such third party code available under this License, Netscape may choose to reintegrate such code into Covered Code without being required to distribute such code in Source Code form, even if such code would otherwise be considered ''Modifications'' under this License. +V. Use of Modifications and Covered Code by Initial Developer. +V.1. In General. +The obligations of Section 3 apply to Netscape, except to the extent specified in this Amendment, Section V.2 and V.3. +V.2. Other Products. +Netscape may include Covered Code in products other than the Netscape's Branded Code which are released by Netscape during the two (2) years following the release date of the Original Code, without such additional products becoming subject to the terms of this License, and may license such additional products on different terms from those contained in this License. +V.3. Alternative Licensing. +Netscape may license the Source Code of Netscape's Branded Code, including Modifications incorporated therein, without such Netscape Branded Code becoming subject to the terms of this License, and may license such Netscape Branded Code on different terms from those contained in this License. +  +VI. Litigation. +Notwithstanding the limitations of Section 11 above, the provisions regarding litigation in Section 11(a), (b) and (c) of the License shall apply to all disputes relating to this License. + +EXHIBIT A-Netscape Public License. +  +''The contents of this file are subject to the Netscape Public License Version 1.1 (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.mozilla.org/NPL/ +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations under the License. +The Original Code is Mozilla Communicator client code, released March 31, 1998. +The Initial Developer of the Original Code is Netscape Communications Corporation. Portions created by Netscape are Copyright (C) 1998-1999 Netscape Communications Corporation. All Rights Reserved. +Contributor(s): ______________________________________. +  +Alternatively, the contents of this file may be used under the terms of the _____ license (the  "[___] License"), in which case the provisions of [______] License are applicable  instead of those above.  If you wish to allow use of your version of this file only under the terms of the [____] License and not to allow others to use your version of this file under the NPL, indicate your decision by deleting  the provisions above and replace  them with the notice and other provisions required by the [___] License.  If you do not delete the provisions above, a recipient may use your version of this file under either the NPL or the [___] License." + +MOZILLA PUBLIC LICENSE +Version 1.1 + +1. Definitions. +1.0.1. "Commercial Use" means distribution or otherwise making the Covered Code available to a third party. +1.1. ''Contributor'' means each entity that creates or contributes to the creation of Modifications. +1.2. ''Contributor Version'' means the combination of the Original Code, prior Modifications used by a Contributor, and the Modifications made by that particular Contributor. +1.3. ''Covered Code'' means the Original Code or Modifications or the combination of the Original Code and Modifications, in each case including portions thereof. +1.4. ''Electronic Distribution Mechanism'' means a mechanism generally accepted in the software development community for the electronic transfer of data. +1.5. ''Executable'' means Covered Code in any form other than Source Code. +1.6. ''Initial Developer'' means the individual or entity identified as the Initial Developer in the Source Code notice required by Exhibit A. +1.7. ''Larger Work'' means a work which combines Covered Code or portions thereof with code not governed by the terms of this License. +1.8. ''License'' means this document. +1.8.1. "Licensable" means having the right to grant, to the maximum extent possible, whether at the time of the initial grant or subsequently acquired, any and all of the rights conveyed herein. +1.9. ''Modifications'' means any addition to or deletion from the substance or structure of either the Original Code or any previous Modifications. When Covered Code is released as a series of files, a Modification is: +A. Any addition to or deletion from the contents of a file containing Original Code or previous Modifications. +B. Any new file that contains any part of the Original Code or previous Modifications. +  +1.10. ''Original Code'' means Source Code of computer software code which is described in the Source Code notice required by Exhibit A as Original Code, and which, at the time of its release under this License is not already Covered Code governed by this License. +1.10.1. "Patent Claims" means any patent claim(s), now owned or hereafter acquired, including without limitation,  method, process, and apparatus claims, in any patent Licensable by grantor. +1.11. ''Source Code'' means the preferred form of the Covered Code for making modifications to it, including all modules it contains, plus any associated interface definition files, scripts used to control compilation and installation of an Executable, or source code differential comparisons against either the Original Code or another well known, available Covered Code of the Contributor's choice. The Source Code can be in a compressed or archival form, provided the appropriate decompression or de-archiving software is widely available for no charge. +1.12. "You'' (or "Your")  means an individual or a legal entity exercising rights under, and complying with all of the terms of, this License or a future version of this License issued under Section 6.1. For legal entities, "You'' includes any entity which controls, is controlled by, or is under common control with You. For purposes of this definition, "control'' means (a) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (b) ownership of more than fifty percent (50%) of the outstanding shares or beneficial ownership of such entity. +2. Source Code License. +2.1. The Initial Developer Grant. +The Initial Developer hereby grants You a world-wide, royalty-free, non-exclusive license, subject to third party intellectual property claims: +(a)  under intellectual property rights (other than patent or trademark) Licensable by Initial Developer to use, reproduce, modify, display, perform, sublicense and distribute the Original Code (or portions thereof) with or without Modifications, and/or as part of a Larger Work; and +(b) under Patents Claims infringed by the making, using or selling of Original Code, to make, have made, use, practice, sell, and offer for sale, and/or otherwise dispose of the Original Code (or portions thereof). +  +(c) the licenses granted in this Section 2.1(a) and (b) are effective on the date Initial Developer first distributes Original Code under the terms of this License. +(d) Notwithstanding Section 2.1(b) above, no patent license is granted: 1) for code that You delete from the Original Code; 2) separate from the Original Code;  or 3) for infringements caused by: i) the modification of the Original Code or ii) the combination of the Original Code with other software or devices. +  +2.2. Contributor Grant. +Subject to third party intellectual property claims, each Contributor hereby grants You a world-wide, royalty-free, non-exclusive license +  +(a)  under intellectual property rights (other than patent or trademark) Licensable by Contributor, to use, reproduce, modify, display, perform, sublicense and distribute the Modifications created by such Contributor (or portions thereof) either on an unmodified basis, with other Modifications, as Covered Code and/or as part of a Larger Work; and +(b) under Patent Claims infringed by the making, using, or selling of  Modifications made by that Contributor either alone and/or in combination with its Contributor Version (or portions of such combination), to make, use, sell, offer for sale, have made, and/or otherwise dispose of: 1) Modifications made by that Contributor (or portions thereof); and 2) the combination of  Modifications made by that Contributor with its Contributor Version (or portions of such combination). +(c) the licenses granted in Sections 2.2(a) and 2.2(b) are effective on the date Contributor first makes Commercial Use of the Covered Code. +(d)    Notwithstanding Section 2.2(b) above, no patent license is granted: 1) for any code that Contributor has deleted from the Contributor Version; 2)  separate from the Contributor Version;  3)  for infringements caused by: i) third party modifications of Contributor Version or ii)  the combination of Modifications made by that Contributor with other software  (except as part of the Contributor Version) or other devices; or 4) under Patent Claims infringed by Covered Code in the absence of Modifications made by that Contributor. + +3. Distribution Obligations. +3.1. Application of License. +The Modifications which You create or to which You contribute are governed by the terms of this License, including without limitation Section 2.2. The Source Code version of Covered Code may be distributed only under the terms of this License or a future version of this License released under Section 6.1, and You must include a copy of this License with every copy of the Source Code You distribute. You may not offer or impose any terms on any Source Code version that alters or restricts the applicable version of this License or the recipients' rights hereunder. However, You may include an additional document offering the additional rights described in Section 3.5. +3.2. Availability of Source Code. +Any Modification which You create or to which You contribute must be made available in Source Code form under the terms of this License either on the same media as an Executable version or via an accepted Electronic Distribution Mechanism to anyone to whom you made an Executable version available; and if made available via Electronic Distribution Mechanism, must remain available for at least twelve (12) months after the date it initially became available, or at least six (6) months after a subsequent version of that particular Modification has been made available to such recipients. You are responsible for ensuring that the Source Code version remains available even if the Electronic Distribution Mechanism is maintained by a third party. +3.3. Description of Modifications. +You must cause all Covered Code to which You contribute to contain a file documenting the changes You made to create that Covered Code and the date of any change. You must include a prominent statement that the Modification is derived, directly or indirectly, from Original Code provided by the Initial Developer and including the name of the Initial Developer in (a) the Source Code, and (b) in any notice in an Executable version or related documentation in which You describe the origin or ownership of the Covered Code. +3.4. Intellectual Property Matters +(a) Third Party Claims. +If Contributor has knowledge that a license under a third party's intellectual property rights is required to exercise the rights granted by such Contributor under Sections 2.1 or 2.2, Contributor must include a text file with the Source Code distribution titled "LEGAL'' which describes the claim and the party making the claim in sufficient detail that a recipient will know whom to contact. If Contributor obtains such knowledge after the Modification is made available as described in Section 3.2, Contributor shall promptly modify the LEGAL file in all copies Contributor makes available thereafter and shall take other steps (such as notifying appropriate mailing lists or newsgroups) reasonably calculated to inform those who received the Covered Code that new knowledge has been obtained. +(b) Contributor APIs. +If Contributor's Modifications include an application programming interface and Contributor has knowledge of patent licenses which are reasonably necessary to implement that API, Contributor must also include this information in the LEGAL file. +  +          (c)    Representations. +Contributor represents that, except as disclosed pursuant to Section 3.4(a) above, Contributor believes that Contributor's Modifications are Contributor's original creation(s) and/or Contributor has sufficient rights to grant the rights conveyed by this License. + +3.5. Required Notices. +You must duplicate the notice in Exhibit A in each file of the Source Code.  If it is not possible to put such notice in a particular Source Code file due to its structure, then You must include such notice in a location (such as a relevant directory) where a user would be likely to look for such a notice.  If You created one or more Modification(s) You may add your name as a Contributor to the notice described in Exhibit A.  You must also duplicate this License in any documentation for the Source Code where You describe recipients' rights or ownership rights relating to Covered Code.  You may choose to offer, and to charge a fee for, warranty, support, indemnity or liability obligations to one or more recipients of Covered Code. However, You may do so only on Your own behalf, and not on behalf of the Initial Developer or any Contributor. You must make it absolutely clear than any such warranty, support, indemnity or liability obligation is offered by You alone, and You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of warranty, support, indemnity or liability terms You offer. +3.6. Distribution of Executable Versions. +You may distribute Covered Code in Executable form only if the requirements of Section 3.1-3.5 have been met for that Covered Code, and if You include a notice stating that the Source Code version of the Covered Code is available under the terms of this License, including a description of how and where You have fulfilled the obligations of Section 3.2. The notice must be conspicuously included in any notice in an Executable version, related documentation or collateral in which You describe recipients' rights relating to the Covered Code. You may distribute the Executable version of Covered Code or ownership rights under a license of Your choice, which may contain terms different from this License, provided that You are in compliance with the terms of this License and that the license for the Executable version does not attempt to limit or alter the recipient's rights in the Source Code version from the rights set forth in this License. If You distribute the Executable version under a different license You must make it absolutely clear that any terms which differ from this License are offered by You alone, not by the Initial Developer or any Contributor. You hereby agree to indemnify the Initial Developer and every Contributor for any liability incurred by the Initial Developer or such Contributor as a result of any such terms You offer. +3.7. Larger Works. +You may create a Larger Work by combining Covered Code with other code not governed by the terms of this License and distribute the Larger Work as a single product. In such a case, You must make sure the requirements of this License are fulfilled for the Covered Code. +4. Inability to Comply Due to Statute or Regulation. +If it is impossible for You to comply with any of the terms of this License with respect to some or all of the Covered Code due to statute, judicial order, or regulation then You must: (a) comply with the terms of this License to the maximum extent possible; and (b) describe the limitations and the code they affect. Such description must be included in the LEGAL file described in Section 3.4 and must be included with all distributions of the Source Code. Except to the extent prohibited by statute or regulation, such description must be sufficiently detailed for a recipient of ordinary skill to be able to understand it. +5. Application of this License. +This License applies to code to which the Initial Developer has attached the notice in Exhibit A and to related Covered Code. +6. Versions of the License. +6.1. New Versions. +Netscape Communications Corporation (''Netscape'') may publish revised and/or new versions of the License from time to time. Each version will be given a distinguishing version number. +6.2. Effect of New Versions. +Once Covered Code has been published under a particular version of the License, You may always continue to use it under the terms of that version. You may also choose to use such Covered Code under the terms of any subsequent version of the License published by Netscape. No one other than Netscape has the right to modify the terms applicable to Covered Code created under this License. +6.3. Derivative Works. +If You create or use a modified version of this License (which you may only do in order to apply it to code which is not already Covered Code governed by this License), You must (a) rename Your license so that the phrases ''Mozilla'', ''MOZILLAPL'', ''MOZPL'', ''Netscape'', "MPL", ''NPL'' or any confusingly similar phrase do not appear in your license (except to note that your license differs from this License) and (b) otherwise make it clear that Your version of the license contains terms which differ from the Mozilla Public License and Netscape Public License. (Filling in the name of the Initial Developer, Original Code or Contributor in the notice described in Exhibit A shall not of themselves be deemed to be modifications of this License.) +7. DISCLAIMER OF WARRANTY. +COVERED CODE IS PROVIDED UNDER THIS LICENSE ON AN "AS IS'' BASIS, WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, WITHOUT LIMITATION, WARRANTIES THAT THE COVERED CODE IS FREE OF DEFECTS, MERCHANTABLE, FIT FOR A PARTICULAR PURPOSE OR NON-INFRINGING. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE COVERED CODE IS WITH YOU. SHOULD ANY COVERED CODE PROVE DEFECTIVE IN ANY RESPECT, YOU (NOT THE INITIAL DEVELOPER OR ANY OTHER CONTRIBUTOR) ASSUME THE COST OF ANY NECESSARY SERVICING, REPAIR OR CORRECTION. THIS DISCLAIMER OF WARRANTY CONSTITUTES AN ESSENTIAL PART OF THIS LICENSE. NO USE OF ANY COVERED CODE IS AUTHORIZED HEREUNDER EXCEPT UNDER THIS DISCLAIMER. +8. TERMINATION. +8.1.  This License and the rights granted hereunder will terminate automatically if You fail to comply with terms herein and fail to cure such breach within 30 days of becoming aware of the breach. All sublicenses to the Covered Code which are properly granted shall survive any termination of this License. Provisions which, by their nature, must remain in effect beyond the termination of this License shall survive. +8.2.  If You initiate litigation by asserting a patent infringement claim (excluding declatory judgment actions) against Initial Developer or a Contributor (the Initial Developer or Contributor against whom You file such action is referred to as "Participant")  alleging that: +(a)  such Participant's Contributor Version directly or indirectly infringes any patent, then any and all rights granted by such Participant to You under Sections 2.1 and/or 2.2 of this License shall, upon 60 days notice from Participant terminate prospectively, unless if within 60 days after receipt of notice You either: (i)  agree in writing to pay Participant a mutually agreeable reasonable royalty for Your past and future use of Modifications made by such Participant, or (ii) withdraw Your litigation claim with respect to the Contributor Version against such Participant.  If within 60 days of notice, a reasonable royalty and payment arrangement are not mutually agreed upon in writing by the parties or the litigation claim is not withdrawn, the rights granted by Participant to You under Sections 2.1 and/or 2.2 automatically terminate at the expiration of the 60 day notice period specified above. +(b)  any software, hardware, or device, other than such Participant's Contributor Version, directly or indirectly infringes any patent, then any rights granted to You by such Participant under Sections 2.1(b) and 2.2(b) are revoked effective as of the date You first made, used, sold, distributed, or had made, Modifications made by that Participant. +8.3.  If You assert a patent infringement claim against Participant alleging that such Participant's Contributor Version directly or indirectly infringes any patent where such claim is resolved (such as by license or settlement) prior to the initiation of patent infringement litigation, then the reasonable value of the licenses granted by such Participant under Sections 2.1 or 2.2 shall be taken into account in determining the amount or value of any payment or license. +8.4.  In the event of termination under Sections 8.1 or 8.2 above,  all end user license agreements (excluding distributors and resellers) which have been validly granted by You or any distributor hereunder prior to termination shall survive termination. +9. LIMITATION OF LIABILITY. +UNDER NO CIRCUMSTANCES AND UNDER NO LEGAL THEORY, WHETHER TORT (INCLUDING NEGLIGENCE), CONTRACT, OR OTHERWISE, SHALL YOU, THE INITIAL DEVELOPER, ANY OTHER CONTRIBUTOR, OR ANY DISTRIBUTOR OF COVERED CODE, OR ANY SUPPLIER OF ANY OF SUCH PARTIES, BE LIABLE TO ANY PERSON FOR ANY INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES OF ANY CHARACTER INCLUDING, WITHOUT LIMITATION, DAMAGES FOR LOSS OF GOODWILL, WORK STOPPAGE, COMPUTER FAILURE OR MALFUNCTION, OR ANY AND ALL OTHER COMMERCIAL DAMAGES OR LOSSES, EVEN IF SUCH PARTY SHALL HAVE BEEN INFORMED OF THE POSSIBILITY OF SUCH DAMAGES. THIS LIMITATION OF LIABILITY SHALL NOT APPLY TO LIABILITY FOR DEATH OR PERSONAL INJURY RESULTING FROM SUCH PARTY'S NEGLIGENCE TO THE EXTENT APPLICABLE LAW PROHIBITS SUCH LIMITATION. SOME JURISDICTIONS DO NOT ALLOW THE EXCLUSION OR LIMITATION OF INCIDENTAL OR CONSEQUENTIAL DAMAGES, SO THIS EXCLUSION AND LIMITATION MAY NOT APPLY TO YOU. +10. U.S. GOVERNMENT END USERS. +The Covered Code is a ''commercial item,'' as that term is defined in 48 C.F.R. 2.101 (Oct. 1995), consisting of ''commercial computer software'' and ''commercial computer software documentation,'' as such terms are used in 48 C.F.R. 12.212 (Sept. 1995). Consistent with 48 C.F.R. 12.212 and 48 C.F.R. 227.7202-1 through 227.7202-4 (June 1995), all U.S. Government End Users acquire Covered Code with only those rights set forth herein. +11. MISCELLANEOUS. +This License represents the complete agreement concerning subject matter hereof. If any provision of this License is held to be unenforceable, such provision shall be reformed only to the extent necessary to make it enforceable. This License shall be governed by California law provisions (except to the extent applicable law, if any, provides otherwise), excluding its conflict-of-law provisions. With respect to disputes in which at least one party is a citizen of, or an entity chartered or registered to do business in the United States of America, any litigation relating to this License shall be subject to the jurisdiction of the Federal Courts of the Northern District of California, with venue lying in Santa Clara County, California, with the losing party responsible for costs, including without limitation, court costs and reasonable attorneys' fees and expenses. The application of the United Nations Convention on Contracts for the International Sale of Goods is expressly excluded. Any law or regulation which provides that the language of a contract shall be construed against the drafter shall not apply to this License. +12. RESPONSIBILITY FOR CLAIMS. +As between Initial Developer and the Contributors, each party is responsible for claims and damages arising, directly or indirectly, out of its utilization of rights under this License and You agree to work with Initial Developer and Contributors to distribute such responsibility on an equitable basis. Nothing herein is intended or shall be deemed to constitute any admission of liability. +13. MULTIPLE-LICENSED CODE. +Initial Developer may designate portions of the Covered Code as "Multiple-Licensed".  "Multiple-Licensed" means that the Initial Developer permits you to utilize portions of the Covered Code under Your choice of the NPL or the alternative licenses, if any, specified by the Initial Developer in the file described in Exhibit A. + +EXHIBIT A -Mozilla Public License. +``The contents of this file are subject to the Mozilla Public License Version 1.1 (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.mozilla.org/MPL/ +Software distributed under the License is distributed on an "AS IS" basis, WITHOUT WARRANTY OF +ANY KIND, either express or implied. See the License for the specific language governing rights and +limitations under the License. +The Original Code is ______________________________________. +The Initial Developer of the Original Code is ________________________. Portions created by + ______________________ are Copyright (C) ______ _______________________. All Rights +Reserved. +Contributor(s): ______________________________________. +Alternatively, the contents of this file may be used under the terms of the _____ license (the  "[___] License"), in which case the provisions of [______] License are applicable  instead of those above.  If you wish to allow use of your version of this file only under the terms of the [____] License and not to allow others to use your version of this file under the MPL, indicate your decision by deleting  the provisions above and replace  them with the notice and other provisions required by the [___] License.  If you do not delete the provisions above, a recipient may use your version of this file under either the MPL or the [___] License." +[NOTE: The text of this Exhibit A may differ slightly from the text of the notices in the Source Code files of the Original Code. You should use the text of this Exhibit A rather than the text found in the Original Code Source Code for Your Modifications.] + +%% This notice is provided with respect to Mesa 3-D graphics library v. 5, which may be included with this software: + +Copyright (c) 2007 The Khronos Group Inc. + +Permission is hereby granted, free of charge, to any person obtaining a +copy of this software and/or associated documentation files (the +"Materials"), to deal in the Materials without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Materials, and to +permit persons to whom the Materials are furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Materials. + +THE MATERIALS ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +MATERIALS OR THE USE OR OTHER DEALINGS IN THE MATERIALS. + +%% This notice is provided with respect to Byte Code Engineering Library (BCEL), which may be included with this software: + + Apache Software License + + /* +==================================================================== * The Apache Software License, Version 1.1 + * + * Copyright (c) 2001 The Apache Software Foundation. Allrights + * reserved. + * + * Redistribution and use in source and binary forms, withor without + * modification, are permitted provided that the followingconditions + * are met: + * + * 1. Redistributions of source code must retain the abovecopyright + * notice, this list of conditions and the followingdisclaimer. + * + * 2. Redistributions in binary form must reproduce theabove copyright + * notice, this list of conditions and the followingdisclaimer in + * the documentation and/or other materials providedwith the + * distribution. + * + * 3. The end-user documentation included with theredistribution, + * if any, must include the following acknowledgment: * "This product includes software developed by the * Apache Software Foundation +(http://www.apache.org/)." + * Alternately, this acknowledgment may appear in thesoftware itself, + * if and wherever such third-party acknowledgmentsnormally appear. + * + * 4. The names "Apache" and "Apache Software Foundation"and + * "Apache BCEL" must not be used to endorse or promoteproducts + * derived from this software without prior writtenpermission. For + * written permission, please contact apache@apache.org. * + * 5. Products derived from this software may not be called"Apache", + * "Apache BCEL", nor may "Apache" appear in their name,without + * prior written permission of the Apache SoftwareFoundation. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED ORIMPLIED + * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIEDWARRANTIES + * OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSEARE + * DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWAREFOUNDATION OR + * ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,INCIDENTAL, + * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,BUT NOT + * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF + * USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVERCAUSED AND + * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICTLIABILITY, + * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING INANY WAY OUT + * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF + * SUCH DAMAGE. + * +==================================================================== * + * This software consists of voluntary contributions madeby many + * individuals on behalf of the Apache Software +Foundation. For more + * information on the Apache Software Foundation, pleasesee + * . + */ + +%% This notice is provided with respect to Regexp, Regular Expression Package, which may be included with this software: + +The Apache Software License, Version 1.1 +Copyright (c) 2001 The Apache Software Foundation. All rights +reserved. +Redistribution and use in source and binary forms, with or without modification,are permitted provided that the following conditions are met: + +1. Redistributions of source code must retain the above copyright +notice, this list of conditions and the following disclaimer. + +2. Redistributions in binary form must reproduce the above copyright +notice, this list of conditions and the following disclaimer in +the documentation and/or other materials provided with the +distribution. + +3. The end-user documentation included with the redistribution, +if any, must include the following acknowledgment: +"This product includes software developed by the +Apache Software Foundation (http://www.apache.org/)." +Alternately, this acknowledgment may appear in the software itself, +if and wherever such third-party acknowledgments normally appear. + +4. The names "Apache" and "Apache Software Foundation" and +"Apache Turbine" must not be used to endorse or promote products +derived from this software without prior written permission. For +written permission, please contact apache@apache.org. + +5. Products derived from this software may not be called "Apache", +"Apache Turbine", nor may "Apache" appear in their name, without +prior written permission of the Apache Software Foundation. + +THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED +WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES +OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE APACHE SOFTWARE FOUNDATION OR +ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, +SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT +LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF +USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT +OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF +SUCH DAMAGE. + +==================================================================== +This software consists of voluntary contributions made by many +individuals on behalf of the Apache Software Foundation. For more +information on the Apache Software Foundation, please see + +http://www.apache.org. + +%% This notice is provided with respect to CUP Parser Generator for Java, which may be included with this software: + +CUP Parser Generator Copyright Notice, License, and Disclaimer + +Copyright 1996-1999 by Scott Hudson, Frank Flannery, C. Scott Ananian +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, provided thatthe above copyright notice appear in all copies and that both the copyrightnotice and this permission notice and warranty disclaimer appear in +supporting documentation, and that the names of the authors or their employersnot be used in advertising or publicity pertaining to distribution of +the software without specific, written prior permission. + +The authors and their employers disclaim all warranties with regard to thissoftware, including all implied warranties of merchantability and +fitness. In no event shall the authors or their employers be liable for anyspecial, indirect or consequential damages or any damages whatsoever +resulting from loss of use, data or profits, whether in an action of contract,negligence or other tortious action, arising out of or in connection withthe use or performance of this software. + +%% This notice is provided with respect to SAX v. 2.0.1, which may be included with this software: + +Copyright Status + + SAX is free! + + In fact, it's not possible to own a license to SAX, since it's been placed in the public + domain. + + No Warranty + + Because SAX is released to the public domain, there is no warranty for the design or for + the software implementation, to the extent permitted by applicable law. Except when + otherwise stated in writing the copyright holders and/or other parties provide SAX "as is" + without warranty of any kind, either expressed or implied, including, but not limited to, the + implied warranties of merchantability and fitness for a particular purpose. The entire risk as + to the quality and performance of SAX is with you. Should SAX prove defective, you + assume the cost of all necessary servicing, repair or correction. + + In no event unless required by applicable law or agreed to in writing will any copyright + holder, or any other party who may modify and/or redistribute SAX, be liable to you for + damages, including any general, special, incidental or consequential damages arising out of + the use or inability to use SAX (including but not limited to loss of data or data being + rendered inaccurate or losses sustained by you or third parties or a failure of the SAX to + operate with any other programs), even if such holder or other party has been advised of + the possibility of such damages. + + Copyright Disclaimers + + This page includes statements to that effect by David Megginson, who would have been + able to claim copyright for the original work. + SAX 1.0 + + Version 1.0 of the Simple API for XML (SAX), created collectively by the membership of + the XML-DEV mailing list, is hereby released into the public domain. + + No one owns SAX: you may use it freely in both commercial and non-commercial + applications, bundle it with your software distribution, include it on a CD-ROM, list the + source code in a book, mirror the documentation at your own web site, or use it in any + other way you see fit. + + David Megginson, sax@megginson.com + 1998-05-11 + + SAX 2.0 + + I hereby abandon any property rights to SAX 2.0 (the Simple API for XML), and release + all of the SAX 2.0 source code, compiled code, and documentation contained in this + distribution into the Public Domain. SAX comes with NO WARRANTY or guarantee of + fitness for any purpose. + + David Megginson, david@megginson.com + 2000-05-05 + +%% This notice is provided with respect to Cryptix, which may be included with this software: + +Cryptix General License + +Copyright © 1995-2003 The Cryptix Foundation Limited. All rights reserved. +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions aremet: + + 1.Redistributions of source code must retain the copyright notice, this list of conditions and the following disclaimer. 2.Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +THIS SOFTWARE IS PROVIDED BY THE CRYPTIX FOUNDATION LIMITED AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS ORIMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FORA PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE CRYPTIX FOUNDATION LIMITED OR CONTRIBUTORS BELIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOTLIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESSINTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OFTHE POSSIBILITY OF SUCH DAMAGE. + +%% This notice is provided with respect to X Window System, which may be included with this software: + +Copyright The Open Group + +Permission to use, copy, modify, distribute, and sell this software and itsdocumentation for any purpose is hereby granted without fee, provided that theabove copyright notice appear in all copies and that both that copyright noticeand this permission notice appear in supporting documentation. + +The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESSFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE OPEN GROUPBE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OFCONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THESOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be used in advertising or otherwise to promote the sale, use or other dealings in this Software without prior written authorization from The Open Group. + +Portions also covered by other licenses as noted in the above URL. + +%% This notice is provided with respect to Retroweaver, which may be included with this software: + +Copyright (c) February 2004, Toby Reyelts +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: + +Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. +Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. +Neither the name of Toby Reyelts nor the names of his contributors may be used to endorse or promote products derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICTLIABILITY, +OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +%% This notice is provided with respect to stripper, which may be included with this software: + +Stripper : debug information stripper + Copyright (c) 2003 Kohsuke Kawaguchi + All rights reserved. + + Redistribution and use in source and binary forms, with or without + modification, are permitted provided that the following conditions + are met: + 1. Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holders nor the names of its + contributors may be used to endorse or promote products derived from this software without specific prior written permission. + + THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR + CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF + SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +%% This notice is provided with respect to libpng official PNG reference library, which may be included with this software: + +This copy of the libpng notices is provided for your convenience. In case ofany discrepancy between this copy and the notices in the file png.h that isincluded in the libpng distribution, the latter shall prevail. + +COPYRIGHT NOTICE, DISCLAIMER, and LICENSE: + +If you modify libpng you may insert additional notices immediately followingthis sentence. + +libpng version 1.2.6, December 3, 2004, is +Copyright (c) 2004 Glenn Randers-Pehrson, and is +distributed according to the same disclaimer and license as libpng-1.2.5with the following individual added to the list of Contributing Authors + Cosmin Truta + +libpng versions 1.0.7, July 1, 2000, through 1.2.5 - October 3, 2002, areCopyright (c) 2000-2002 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-1.0.6with the following individuals added to the list of Contributing Authors + Simon-Pierre Cadieux + Eric S. Raymond + Gilles Vollant + +and with the following additions to the disclaimer: + + There is no warranty against interference with your enjoyment of the library or against infringement. There is no warranty that our + efforts or the library will fulfill any of your particular purposes or needs. This library is provided with all faults, and the entire risk of satisfactory quality, performance, accuracy, and effort is with the user. + +libpng versions 0.97, January 1998, through 1.0.6, March 20, 2000, areCopyright (c) 1998, 1999 Glenn Randers-Pehrson, and are +distributed according to the same disclaimer and license as libpng-0.96,with the following individuals added to the list of Contributing Authors: + Tom Lane + Glenn Randers-Pehrson + Willem van Schaik + +libpng versions 0.89, June 1996, through 0.96, May 1997, are +Copyright (c) 1996, 1997 Andreas Dilger +Distributed according to the same disclaimer and license as libpng-0.88,with the following individuals added to the list of Contributing Authors: + John Bowler + Kevin Bracey + Sam Bushell + Magnus Holmgren + Greg Roelofs + Tom Tanner + +libpng versions 0.5, May 1995, through 0.88, January 1996, are +Copyright (c) 1995, 1996 Guy Eric Schalnat, Group 42, Inc. + +For the purposes of this copyright and license, "Contributing Authors"is defined as the following set of individuals: + + Andreas Dilger + Dave Martindale + Guy Eric Schalnat + Paul Schmidt + Tim Wegner + +The PNG Reference Library is supplied "AS IS". The Contributing Authorsand Group 42, Inc. disclaim all warranties, expressed or implied, +including, without limitation, the warranties of merchantability and offitness for any purpose. The Contributing Authors and Group 42, Inc. +assume no liability for direct, indirect, incidental, special, exemplary,or consequential damages, which may result from the use of the PNG +Reference Library, even if advised of the possibility of such damage. + +Permission is hereby granted to use, copy, modify, and distribute thissource code, or portions hereof, for any purpose, without fee, subjectto the following restrictions: + +1. The origin of this source code must not be misrepresented. + +2. Altered versions must be plainly marked as such and must not + be misrepresented as being the original source. + +3. This Copyright notice may not be removed or altered from any + source or altered source distribution. + +The Contributing Authors and Group 42, Inc. specifically permit, withoutfee, and encourage the use of this source code as a component to +supporting the PNG file format in commercial products. If you use thissource code in a product, acknowledgment is not required but would be +appreciated. + + +A "png_get_copyright" function is available, for convenient use in "about"boxes and the like: + + printf("%s",png_get_copyright(NULL)); + +Also, the PNG logo (in PNG format, of course) is supplied in the +files "pngbar.png" and "pngbar.jpg (88x31) and "pngnow.png" (98x31). + +Libpng is OSI Certified Open Source Software. OSI Certified Open Source is acertification mark of the Open Source Initiative. + +Glenn Randers-Pehrson +glennrp at users.sourceforge.net +December 3, 2004 + +%% This notice is provided with respect to Libungif - An uncompressed GIF library, which may be included with this software: + +The GIFLIB distribution is Copyright (c) 1997 Eric S. Raymond + +Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to dealin the Software without restriction, including without limitation the rightsto use, copy, modify, merge, publish, distribute, sublicense, and/or sellcopies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included inall copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THEAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHERLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS INTHE SOFTWARE. + +%% This notice is provided with respect to XML Resolver library, Xalan J2, and StAX API, which may be included with this software: + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, and distribution as defined by Sections 1 through 9 of this document. + "Licensor" shall mean the copyright owner or entity authorized by the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all other entities that control, are controlled by, or are under common control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity. + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, including but not limited to software source code, documentation source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object form, that is based on (or derived from) the Work and for which the editorial revisions, annotations, elaborations, or other modifications represent, as a whole, an original work of authorship. For the purposes of this License, Derivative Works shall not include works that remain separable from, or merely link (or bind by name) to the interfaces of, the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner or by an individual or Legal Entity authorized to submit on behalf of the copyright owner. For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to the Licensor or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, the Licensor for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by the copyright owner as "Not a Contribution." + "Contributor" shall mean Licensor and any individual or Legal Entity on behalf of whom a Contribution has been received by Licensor and subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) with the Work to which such Contribution(s) was submitted. If You institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work or a Contribution incorporated within the Work constitutes direct or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must include a readable copy of the attribution notices contained within such NOTICE file, excluding those notices that do not pertain to any part of the Derivative Works, in at least one of the following places: within a NOTICE text file distributed as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside or as an addendum to the NOTICE text from the Work, provided that such additional attribution notices cannot be construed as modifying the License. + + You may add Your own copyright statement to Your modifications and may provide additional or different license terms and conditions for use, reproduction, or distribution of Your modifications, or for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, any Contribution intentionally submitted for inclusion in the Work by You to the Licensor shall be under the terms and conditions of this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify the terms of any separate license agreement you may have executed with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade names, trademarks, service marks, or product names of the Licensor, except as required for reasonable and customary use in describing the origin of the Work and reproducing the content of the NOTICE file. + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the appropriateness of using or redistributing the Work and assume any risks associated with Your exercise of permissions under this License. + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly negligent acts) or agreed to in writing, shall any Contributor be liable to You for damages, including any direct, indirect, special, incidental, or consequential damages of any character arising as a result of this License or out of the use or inability to use the Work (including but not limited to damages for loss of goodwill, work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, or other liability obligations and/or rights consistent with this License. However, in accepting such obligations, You may act only on Your own behalf and on Your sole responsibility, not on behalf of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + 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. + +%% Some Portions licensed from IBM are available at: +http://www.ibm.com/software/globalization/icu/ + +%% This notice is provided with respect to ICU4J, ICU 1.8.1 and later, which may be included with this software: + +ICU License - ICU 1.8.1 and later COPYRIGHT AND PERMISSION NOTICE Cop +yright (c) +1995-2003 International Business Machines Corporation and others All rightsreserved. Permission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the "Software"), todeal in the Software without restriction, including without limitation therights to use, copy, modify, merge, publish, distribute, and/or sell copies ofthe Software, and to permit persons to whom the Software is furnished to do so,provided that the above copyright notice(s) and this permission notice appear inall copies of the Software and that both the above copyright notice(s) and thispermission notice appear in supporting documentation. THE SOFTWARE IS PROVIDED"AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOTLIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSEAND NONINFRINGEMENT OF THIRD PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHTHOLDER OR HOLDERS INCLUDED IN THIS NOTICE BE LIABLE FOR ANY C + LAIM, OR ANYSPECIAL INDIRECT OR CONSEQUENTIAL DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTINGFROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCEOR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE ORPERFORMANCE OF THIS SOFTWARE. Except as contained in this notice, the name of acopyright holder shall not be used in advertising or otherwise to promote thesale, use or other dealings in this Software without prior written authorizationof the copyright holder. + +%% This notice is provided with respect to Jing, which may be included with this software: + +Jing Copying Conditions + +Copyright (c) 2001-2003 Thai Open Source Software Center Ltd +All rights reserved. + +Redistribution and use in source and binary forms, with or without modification,are permitted provided that the following conditions are met: + + * Redistributions of source code must retain the above copyright notice,this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright notice,this list of conditions and the following disclaimer in the documentation and/orother materials provided with the distribution. + * Neither the name of the Thai Open Source Software Center Ltd nor the namesof its contributors may be used to endorse or promote products derived from thissoftware without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" ANDANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIEDWARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE AREDISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE FOR ANYDIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ONANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THISSOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +%% This notice is provided with respect to RELAX NG Object Model/Parser, which may be included with this software: + + +The MIT License + +Copyright (c) + +Permission is hereby granted, free of charge, to any person obtaining a copy ofthis software and associated documentation files (the "Software"), to deal inthe Software without restriction, including without limitation the rights touse, copy, modify, merge, publish, distribute, sublicense, and/or sell copies ofthe Software, and to permit persons to whom the Software is furnished to do so,subject to the following conditions: + +The above copyright notice and this permission notice shall be included in allcopies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS ORIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESSFOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS ORCOPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHERIN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR INCONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +%% This notice is provided with respect to XFree86-VidMode Extension, which may be included with this software: + +Version 1.1 of XFree86 ProjectLicence. + + Copyright (C) 1994-2004 The XFree86 Project, Inc. All rights reserved. + + Permission is hereby granted, free of charge, to any person obtaining a copyof this software and associated documentation files (the "Software"), to deal inthe Software without restriction, including without limitation the rights touse, copy, modify, merge, publish, distribute, sublicence, and/or sell copies ofthe Software, and to permit persons to whom the Software is furnished to do so,subject to the following conditions: + + 1. Redistributions of source code must retain the above copyright notice,this list of conditions, and the following disclaimer. + 2. Redistributions in binary form must reproduce the above copyrightnotice, this list of conditions and the following disclaimer in the +documentation and/or other materials provided with the distribution, and in thesame place and form as other copyright, license and disclaimer information. 3. The end-user documentation included with the redistribution, if any,must include the following acknowledgment: "This product includes softwaredeveloped by The XFree86 Project, Inc (http://www.xfree86.org/) and itscontributors", in the same place and form as other third-party acknowledgments.Alternately, this acknowledgment may appear in the software itself, in the sameform and location as other such third-party acknowledgments. + 4. Except as contained in this notice, the name of The XFree86 Project,Inc shall not be used in advertising or otherwise to promote the sale, use orother dealings in this Software without prior written authorization from TheXFree86 Project, Inc. + + THIS SOFTWARE IS PROVIDED ``AS IS'' AND ANY EXPRESSED OR IMPLIED WARRANTIES,INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY ANDFITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE XFREE86PROJECT, INC OR ITS CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; ORBUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER INCONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISINGIN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITYOF SUCH DAMAGE. + +%% This notice is provided with respect to XML Security, which may be included with this software: + + The Apache Software License, + Version 1.1 + + + PDF + + + Copyright (C) 2002 The Apache SoftwareFoundation. + All rights reserved. Redistribution anduse in + source and binary forms, with or withoutmodifica- + tion, are permitted provided that thefollowing + conditions are met: 1. Redistributions ofsource + code must retain the above copyrightnotice, this + list of conditions and the followingdisclaimer. + 2. Redistributions in binary form mustreproduce + the above copyright notice, this list of conditions and the following disclaimerin the + documentation and/or other materialsprovided with + the distribution. 3. The end-userdocumentation + included with the redistribution, if any,must + include the following acknowledgment:"This + product includes software developed bythe Apache + Software Foundation +(http://www.apache.org/)." + Alternately, this acknowledgment mayappear in the + software itself, if and wherever suchthird-party + acknowledgments normally appear. 4. Thenames + "Apache Forrest" and "Apache SoftwareFoundation" + must not be used to endorse or promoteproducts + derived from this software without priorwritten + permission. For written permission,please contact + apache@apache.org. 5. Products derivedfrom this + software may not be called "Apache", normay + "Apache" appear in their name, withoutprior + written permission of the Apache Software Foundation. THIS SOFTWARE IS PROVIDED``AS IS'' + AND ANY EXPRESSED OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THEIMPLIED + WARRANTIES OF MERCHANTABILITY AND FITNESSFOR A + PARTICULAR PURPOSE ARE DISCLAIMED. IN NOEVENT + SHALL THE APACHE SOFTWARE FOUNDATION ORITS + CONTRIBUTORS BE LIABLE FOR ANY DIRECT,INDIRECT, + INCIDENTAL, SPECIAL, EXEMPLARY, ORCONSEQUENTIAL + DAMAGES (INCLU- DING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS ORSERVICES; LOSS + OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANYTHEORY OF + LIABILITY, WHETHER IN CONTRACT, STRICTLIABILITY, + OR TORT (INCLUDING NEGLIGENCE OROTHERWISE) + ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THEPOSSIBILITY OF + SUCH DAMAGE. This software consists ofvoluntary + contributions made by many individuals onbehalf + of the Apache Software Foundation. Formore + information on the Apache SoftwareFoundation, + please see . + +%% This notice is provided with respect to Independent JPEG Group's software (libjpeg), which may be included with this software: + +In plain English: + +1. We don't promise that this software works. (But if you find any bugs, + please let us know!) +2. You can use this software for whatever you want. You don't have to pay us. +3. You may not pretend that you wrote this software. If you use it in a program, you must acknowledge somewhere in your documentation that you've used the IJG code. + +In legalese: + +The authors make NO WARRANTY or representation, either express or implied, with respect to this software, its quality, accuracy, merchantability, or fitness for a particular purpose. This software is provided "AS IS", and you, its user, assume the entire risk as to its quality and accuracy. + +This software is copyright (C) 1991-1998, Thomas G. Lane. +All Rights Reserved except as specified below. + +Permission is hereby granted to use, copy, modify, and distribute this software (or portions thereof) for any purpose, without fee, subject to these conditions: + +(1) If any part of the source code for this software is distributed, then this +README file must be included, with this copyright and no-warranty notice unaltered; and any additions, deletions, or changes to the original files must be clearly indicated in accompanying documentation. + +(2) If only executable code is distributed, then the accompanying documentation must state that "this software is based in part on the work of the Independent JPEG Group". + +(3) Permission for use of this software is granted only if the user accepts full responsibility for any undesirable consequences; the authors accept NO LIABILITY for damages of any kind. + +These conditions apply to any software derived from or based on the IJG code, not just to the unmodified library. If you use our work, you ought to acknowledge us. + +Permission is NOT granted for the use of any IJG author's name or company name in advertising or publicity relating to this software or products derived from it. This software may be referred to only as "the Independent JPEG Group's software". + +We specifically permit and encourage the use of this software as the basis of commercial products, provided that all warranty or liability claims are assumed by the product vendor. + +ansi2knr.c is included in this distribution by permission of L. Peter Deutsch, sole proprietor of its copyright holder, Aladdin Enterprises of Menlo Park, CA. ansi2knr.c is NOT covered by the above copyright and conditions, but instead by the usual distribution terms of the Free Software Foundation; principally, that you must include source code if you redistribute it. (See the file ansi2knr.c for full details.) However, since ansi2knr.c is not needed as part of any program generated from the IJG code, this does not limit you more than the foregoing paragraphs do. + +The Unix configuration script "configure" was produced with GNU Autoconf. It is copyright by the Free Software Foundation but is freely distributable. The same holds for its supporting scripts (config.guess, config.sub, ltconfig, ltmain.sh). Another support script, install-sh, is copyright by M.I.T. but is also freely distributable. + +It appears that the arithmetic coding option of the JPEG spec is covered by patents owned by IBM, AT&T, and Mitsubishi. Hence arithmetic coding cannot legally be used without obtaining one or more licenses. For this reason, support for arithmetic coding has been removed from the free JPEG software. (Since arithmetic coding provides only a marginal gain over the unpatented Huffman mode, it is unlikely that very many implementations will support it.) So far as we are aware, there are no patent restrictions on the remaining code. + +The IJG distribution formerly included code to read and write GIF files. To avoid entanglement with the Unisys LZW patent, GIF reading support has been removed altogether, and the GIF writer has been simplified to produce "uncompressed GIFs". This technique does not use the LZW algorithm; the resulting GIF files are larger than usual, but are readable by all standard GIF decoders. + +We are required to state that + "The Graphics Interchange Format(c) is the Copyright property of + CompuServe Incorporated. GIF(sm) is a Service Mark property of + CompuServe Incorporated." + +%% This notice is provided with respect to X Resize and Rotate (Xrandr) Extension, which may be included with this software: +2. XFree86 License + +XFree86 code without an explicit copyright is covered by the following +copyright/license: + +Copyright (C) 1994-2003 The XFree86 Project, Inc. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated documentation files (the "Software"), to deal in +the Software without restriction, including without limitation the rights to +use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of +the Software, and to permit persons to whom the Software is furnished to do so, +subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS +FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 +PROJECT BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN +ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION +WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the XFree86 Project shall not be +used in advertising or otherwise to promote the sale, use or other dealings in +this Software without prior written authorization from the XFree86 Project. + +%% This notice is provided with respect to fontconfig, which may be included with this software: +Id: COPYING,v 1.3 2003/04/04 20:17:40 keithp Exp $ +Copyright 2001,2003 Keith Packard + +Permission to use, copy, modify, distribute, and sell this software and its +documentation for any purpose is hereby granted without fee, provided that +the above copyright notice appear in all copies and that both that +copyright notice and this permission notice appear in supporting +documentation, and that the name of Keith Packard not be used in +advertising or publicity pertaining to distribution of the software without +specific, written prior permission. Keith Packard makes no +representations about the suitability of this software for any purpose. It +is provided "as is" without express or implied warranty. + +KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, +INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO +EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR +CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, +DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER +TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR +PERFORMANCE OF THIS SOFTWARE. +%% This notice is provided with respect to XFree86, which may be included with this software: +Copyright (C) 1994-2002 The XFree86 Project, Inc. All Rights Reserved. + +Permission is hereby granted, free of charge, to any person obtaining a copy of +this software and associated +documentation files (the "Software"), to deal in the Software without +restriction, including without limitation +the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or +sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to the +following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the +Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT +NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR +PURPOSE AND +NONINFRINGEMENT. IN NO EVENT SHALL THE XFREE86 PROJECT BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the XFree86 Project shall not be +used in advertising or otherwise +to promote the sale, use or other dealings in this Software without prior +written authorization from the XFree86 +Project. +%% This notice is provided with respect to Fast Infoset, which may be included with this software: +* Fast Infoset ver. 0.1 software ("Software") +* +* Copyright, 2004-2005 Sun Microsystems, Inc. All Rights Reserved. +* +* Software is 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. +* +* Sun supports and benefits from the global community of open source +* developers, and thanks the community for its important contributions and +* open standards-based technology, which Sun has adopted into many of its +* products. +* +* Please note that portions of Software may be provided with notices and +* open source licenses from such communities and third parties that govern the +* use of those portions, and any licenses granted hereunder do not alter any +* rights and obligations you may have under such open source licenses, +* however, the disclaimer of warranty and limitation of liability provisions +* in this License will apply to all Software in this distribution. +* +* You acknowledge that the Software is not designed, licensed or intended +* for use in the design, construction, operation or maintenance of any nuclear +* facility. +* +* Apache License +* Version 2.0, January 2004 +* http://www.apache.org/licenses/ +* +*/ +/* +* ==================================================================== +* +* This code is subject to the freebxml License, Version 1.1 +* +* Copyright (c) 2001 - 2005 freebxml.org. All rights reserved. +* +* $Header: /cvs/fi/FastInfoset/src/com/sun/xml/internal/fastinfoset/AbstractResourceBundle.java,v 1.2 +*  ==================================================================== +*/ +%% This notice is provided with respect to Kerberos, which may be included with this software: + +/* + * Copyright (C) 1998 by the FundsXpress, INC. + * + * All rights reserved. + * + * Export of this software from the United States of America may require + * a specific license from the United States Government.  It is the + * responsibility of any person or organization contemplating export to + * obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of FundsXpress. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission. FundsXpress makes no representations about the suitability of + * this software for any purpose. It is provided "as is" without express + * or implied warranty. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +%% This notice is provided with respect to Unicode's CLDR data repository, which may be included with this software: + + Unicode Copyright + + For the general privacy policy governing access to this site, see the +Unicode Privacy Policy. For trademark usage, see the the Unicode Consortium +Trademarks and Logo Policy. + Notice to End User: Terms of Use + Carefully read the following legal agreement ("Agreement"). Use or copying +of the software and/or codes provided with this agreement (The "Software") +constitutes your acceptance of these terms + + 1. Unicode Copyright. + 1. Copyright © 1991-2005 Unicode, Inc. All rights reserved. + 2. Certain documents and files on this website contain a legend +indicating that "Modification is permitted." Any person is hereby authorized, +without fee, to modify such documents and files to create derivative works +conforming to the Unicode® Standard, subject to Terms and Conditions herein. + 3. Any person is hereby authorized, without fee, to view, use, +reproduce, and distribute all documents and files solely for informational +purposes in the creation of products supporting the Unicode Standard, subject to +the Terms and Conditions herein. + 4. Further specifications of rights and restrictions pertaining to +the use of the particular set of data files known as the "Unicode Character +Database" can be found in Exhibit 1. + 5. Further specifications of rights and restrictions pertaining to +the use of the particular set of files that constitute the online edition of The +Unicode Standard, Version 4.0, may be found in V4.0 online edition. + 6. No license is granted to "mirror" the Unicode website where a +fee is charged for access to the "mirror" site. + 7. Modification is not permitted with respect to this document. All +copies of this document must be verbatim. + 2. Restricted Rights Legend. Any technical data or software which is +licensed to the United States of America, its agencies and/or instrumentalities +under this Agreement is commercial technical data or commercial computer +software developed exclusively at private expense as defined in FAR 2.101, or +DFARS 252.227-7014 (June 1995), as applicable. For technical data, use, +duplication, or disclosure by the Government is subject to restrictions as set +forth in DFARS 202.227-7015 Technical Data, Commercial and Items (Nov 1995) and +this Agreement. For Software, in accordance with FAR 12-212 or DFARS 227-7202, +as applicable, use, duplication or disclosure by the Government is subject to +the restrictions set forth in this Agreement. + 3. Warranties and Disclaimers. + 1. This publication and/or website may include technical or +typographical errors or other inaccuracies . Changes are periodically added to +the information herein; these changes will be incorporated in new editions of +the publication and/or website. Unicode may make improvements and/or changes in +the product(s) and/or program(s) described in this publication and/or website at +any time. + 2. If this file has been purchased on magnetic or optical media +from Unicode, Inc. the sole and exclusive remedy for any claim will be exchange +of the defective media within ninety (90) days of original purchase. + 3. EXCEPT AS PROVIDED IN SECTION C.2, THIS PUBLICATION AND/OR +SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND EITHER EXPRESS, +IMPLIED, OR STATUTORY, INCLUDING, BUT NOT LIMITED TO, ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. UNICODE +AND ITS LICENSORS ASSUME NO RESPONSIBILITY FOR ERRORS OR OMISSIONS IN THIS +PUBLICATION AND/OR SOFTWARE OR OTHER DOCUMENTS WHICH ARE REFERENCED BY OR LINKED +TO THIS PUBLICATION OR THE UNICODE WEBSITE. + 4. Waiver of Damages. In no event shall Unicode or its licensors be +liable for any special, incidental, indirect or consequential damages of any +kind, or any damages whatsoever, whether or not Unicode was advised of the +possibility of the damage, including, without limitation, those resulting from +the following: loss of use, data or profits, in connection with the use, +modification or distribution of this information or its derivatives. + 5. Trademarks. + 1. Unicode and the Unicode logo are registered trademarks of +Unicode, Inc. + 2. This site contains product names and corporate names of other +companies. All product names and company names and logos mentioned herein are +the trademarks or registered trademarks of their respective owners. Other +products and corporate names mentioned herein which are trademarks of a third +party are used only for explanation and for the owners' benefit and with no +intent to infringe. + 3. Use of third party products or information referred to herein is +at the user's risk. + 6. Miscellaneous. + 1. Jurisdiction and Venue. This server is operated from a location +in the State of California, United States of America. Unicode makes no +representation that the materials are appropriate for use in other locations. If +you access this server from other locations, you are responsible for compliance +with local laws. This Agreement, all use of this site and any claims and damages +resulting from use of this site are governed solely by the laws of the State of +California without regard to any principles which would apply the laws of a +different jurisdiction. The user agrees that any disputes regarding this site +shall be resolved solely in the courts located in Santa Clara County, +California. The user agrees said courts have personal jurisdiction and agree to +waive any right to transfer the dispute to any other forum. + 2. Modification by Unicode Unicode shall have the right to modify +this Agreement at any time by posting it to this site. The user may not assign +any part of this Agreement without Unicode's prior written consent. + 3. Taxes. The user agrees to pay any taxes arising from access to +this website or use of the information herein, except for those based on +Unicode's net income. + 4. Severability. If any provision of this Agreement is declared +invalid or unenforceable, the remaining provisions of this Agreement shall +remain in effect. + 5. Entire Agreement. This Agreement constitutes the entire +agreement between the parties. + +EXHIBIT 1 +UNICODE, INC. LICENSE AGREEMENT - DATA FILES AND SOFTWARE + + Unicode Data Files include all data files under the directories +http://www.unicode.org/Public/ and http://www.unicode.org/reports/. Unicode +Software includes any source code under the directories +http://www.unicode.org/Public/ and http://www.unicode.org/reports/. + + NOTICE TO USER: Carefully read the following legal agreement. BY +DOWNLOADING, INSTALLING, COPYING OR OTHERWISE USING UNICODE INC.'S DATA FILES +("DATA FILES"), AND/OR SOFTWARE ("SOFTWARE"), YOU UNEQUIVOCALLY ACCEPT, AND +AGREE TO BE BOUND BY, ALL OF THE TERMS AND CONDITIONS OF THIS AGREEMENT. IF YOU +DO NOT AGREE, DO NOT DOWNLOAD, INSTALL, COPY, DISTRIBUTE OR USE THE DATA FILES +OR SOFTWARE. + + COPYRIGHT AND PERMISSION NOTICE + + Copyright Ã?Â,Ã,© 1991-2004 Unicode, Inc. All rights reserved. Distributed under +the Terms of Use in http://www.unicode.org/copyright.html. + + Permission is hereby granted, free of charge, to any person obtaining a copy +of the Unicode data files and associated documentation (the "Data Files") or +Unicode software and associated documentation (the "Software") to deal in the +Data Files or Software without restriction, including without limitation the +rights to use, copy, modify, merge, publish, distribute, and/or sell copies of +the Data Files or Software, and to permit persons to whom the Data Files or +Software are furnished to do so, provided that (a) the above copyright notice(s) +and this permission notice appear with all copies of the Data Files or Software, +(b) both the above copyright notice(s) and this permission notice appear in +associated documentation, and (c) there is clear notice in each modified Data +File or in the Software as well as in the documentation associated with the Data +File(s) or Software that the data or software has been modified. + + THE DATA FILES AND SOFTWARE ARE PROVIDED "AS IS", WITHOUT WARRANTY OF ANY +KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT OF THIRD +PARTY RIGHTS. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR HOLDERS INCLUDED IN THIS +NOTICE BE LIABLE FOR ANY CLAIM, OR ANY SPECIAL INDIRECT OR CONSEQUENTIAL +DAMAGES, OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING +OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THE DATA FILES OR SOFTWARE. + + Except as contained in this notice, the name of a copyright holder shall not +be used in advertising or otherwise to promote the sale, use or other dealings +in these Data Files or Software without prior written authorization of the +copyright holder. + + Unicode and the Unicode logo are trademarks of Unicode, Inc., and may be +registered in some jurisdictions. All other trademarks and registered trademarks +mentioned herein are the property of their respective owners. +%% This notice is provided with respect to RSA PKCS#11 Header Files & Specification, which may be included with this software: + +/* + * Copyright (C) 1998 by the FundsXpress, INC. + * + * All rights reserved. + * + * Export of this software from the United States of America may require + * a specific license from the United States Government.  It is the + * responsibility of any person or organization contemplating export to + * obtain such a license before exporting. + * + * WITHIN THAT CONSTRAINT, permission to use, copy, modify, and + * distribute this software and its documentation for any purpose and + * without fee is hereby granted, provided that the above copyright + * notice appear in all copies and that both that copyright notice and + * this permission notice appear in supporting documentation, and that + * the name of FundsXpress. not be used in advertising or publicity pertaining + * to distribution of the software without specific, written prior + * permission.  FundsXpress makes no representations about the suitability of + * this software for any purpose.  It is provided "as is" without express + * or implied warranty. + * + * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR + * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED + * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. + */ + +%% This notice is provided with respect to certain files/code which may included in the implementation of AWT within the software: + +****************************************************** +BEGIN  src/solaris/native/sun/awt/HPkeysym.h +Copyright 1987, 1998  The Open Group + +All Rights Reserved. + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from The Open Group. + +Copyright 1987 by Digital Equipment Corporation, Maynard, Massachusetts, + +All Rights Reserved + +Permission to use, copy, modify, and distribute this software and its +documentation for any purpose and without fee is hereby granted, +provided that the above copyright notice appear in all copies and that +both that copyright notice and this permission notice appear in +supporting documentation, and that the names of Hewlett Packard +or Digital not be +used in advertising or publicity pertaining to distribution of the +software without specific, written prior permission. + +DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING +ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL +DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR +ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, +WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, +ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS +SOFTWARE. + +HEWLETT-PACKARD MAKES NO WARRANTY OF ANY KIND WITH REGARD +TO THIS SOFWARE, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE.  Hewlett-Packard shall not be liable for errors +contained herein or direct, indirect, special, incidental or +consequential damages in connection with the furnishing, +performance, or use of this material. + +END  src/solaris/native/sun/awt/HPkeysym.h +****************************************************** +****************************************************** +BEGIN src/solaris/native/sun/awt/Xrandr.h +/* + * $XFree86: xc/lib/Xrandr/Xrandr.h,v 1.9 2002/09/29 23:39:44 keithp Exp $ + * + * Copyright © 2000 Compaq Computer Corporation, Inc. + * Copyright © 2002 Hewlett-Packard Company, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Compaq not be used in advertising or + * publicity pertaining to distribution of the software without specific, + * written prior permission.  HP makes no representations about the + * suitability of this software for any purpose.  It is provided "as is" + * without express or implied warranty. + * + * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL COMPAQ + * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author:  Jim Gettys, HP Labs, HP. + */ + + +END src/solaris/native/sun/awt/Xrandr.h +****************************************************** +BEGIN src/solaris/native/sun/awt/extutil.h +/* + * $Xorg: extutil.h,v 1.3 2000/08/18 04:05:45 coskrey Exp $ + * +Copyright 1989, 1998  The Open Group + +All Rights Reserved. + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE +OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN +AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN +CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of The Open Group shall not be +used in advertising or otherwise to promote the sale, use or other dealings +in this Software without prior written authorization from The Open Group. + * + * Author:  Jim Fulton, MIT The Open Group + * + *                     Xlib Extension-Writing Utilities + * + * This package contains utilities for writing the client API for various + * protocol extensions.  THESE INTERFACES ARE NOT PART OF THE X STANDARD AND + * ARE SUBJECT TO CHANGE! + */ +/* $XFree86: xc/include/extensions/extutil.h,v 1.5 2001/01/17 17:53:20 dawes Exp $ */ + +END src/solaris/native/sun/awt/extutil.h +****************************************************** +BEGIN   src/solaris/native/sun/awt/fontconfig.h +/* + * $RCSId: xc/lib/fontconfig/fontconfig/fontconfig.h,v 1.30 2002/09/26 00:17:27 +keithp Exp $ + * + * Copyright © 2001 Keith Packard + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Keith Packard not be used in + * advertising or publicity pertaining to distribution of the software without + * specific, written prior permission.  Keith Packard makes no + * representations about the suitability of this software for any purpose.  It + * is provided "as is" without express or implied warranty. + * + * KEITH PACKARD DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, + * INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO + * EVENT SHALL KEITH PACKARD BE LIABLE FOR ANY SPECIAL, INDIRECT OR + * CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, + * DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER + * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR + * PERFORMANCE OF THIS SOFTWARE. + +END   src/solaris/native/sun/awt/fontconfig.h +****************************************************** +BEGIN src/solaris/native/sun/awt/list.c +AND  src/solaris/native/sun/awt/list.h +AND src/solaris/native/sun/awt/multiVis.c +AND  src/solaris/native/sun/awt/multiVis.h +AND  src/solaris/native/sun/awt/wsutils.h + +Copyright (c) 1994 Hewlett-Packard Co. +Copyright (c) 1996  X Consortium + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +"Software"), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be included +in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS +OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR +OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, +ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +OTHER DEALINGS IN THE SOFTWARE. + +Except as contained in this notice, the name of the X Consortium shall +not be used in advertising or otherwise to promote the sale, use or +other dealings in this Software without prior written authorization +from the X Consortium. + +END src/solaris/native/sun/awt/list.c +AND  src/solaris/native/sun/awt/list.h +AND src/solaris/native/sun/awt/multiVis.c +AND  src/solaris/native/sun/awt/multiVis.h +AND  src/solaris/native/sun/awt/wsutils.h + +***************************************************************** +BEGIN src/solaris/native/sun/awt/randr.h + + * + * Copyright © 2000, Compaq Computer Corporation, + * Copyright © 2002, Hewlett Packard, Inc. + * + * Permission to use, copy, modify, distribute, and sell this software and its + * documentation for any purpose is hereby granted without fee, provided that + * the above copyright notice appear in all copies and that both that + * copyright notice and this permission notice appear in supporting + * documentation, and that the name of Compaq or HP not be used in advertising + * or publicity pertaining to distribution of the software without specific, + * written prior permission.  HP makes no representations about the + * suitability of this software for any purpose.  It is provided "as is" + * without express or implied warranty. + * + * HP DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL + * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL HP + * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES + * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION + * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN + * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. + * + * Author:  Jim Gettys, HP Labs, Hewlett-Packard, Inc. + +END src/solaris/native/sun/awt/randr.h +***************************************************** + +BEGIN src/solaris/native/sun/java2d/opengl/J2D_GL/glx.h + * Mesa 3-D graphics library + * Version:  4.1 + * + * Copyright (C) 1999-2002  Brian Paul   All Rights Reserved. + * + * Permission is hereby granted, free of charge, to any person obtaining a + * copy of this software and associated documentation files (the "Software"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included + * in all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL + * BRIAN PAUL BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN + * AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN + * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. + +END src/solaris/native/sun/java2d/opengl/J2D_GL/glx.h diff --git a/langtools/make/Makefile b/langtools/make/Makefile new file mode 100644 index 00000000000..afb845b1b2e --- /dev/null +++ b/langtools/make/Makefile @@ -0,0 +1,180 @@ +# +# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# Makefile for langtools: wrapper around Ant build.xml file + +# +# On Solaris, the 'make' utility from Sun will not work with these makefiles. +# This little rule is only understood by Sun's make, and is harmless +# when seen by the GNU make tool. If using Sun's make, this causes the +# make command to fail. +# +SUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33 + +# +# Minimal platform defs +# Need FullPath because we can't rely on gnumake abspath, until we use v3.81 +# + +SYSTEM_UNAME := $(shell uname) + +ifeq ($(SYSTEM_UNAME), Windows_NT) +DEV_NULL = NUL +else +ifneq (,$(findstring CYGWIN,$(SYSTEM_UNAME))) +DEV_NULL = NUL +USING_CYGWIN = true +else +DEV_NULL = /dev/null +endif +endif + +ifdef USING_CYGWIN +define FullPath +$(shell cygpath -a -s -m $1 2> $(DEV_NULL)) +endef +else +define FullPath +$(shell cd $1 2> $(DEV_NULL) && pwd) +endef +endif + +# +# Makefile args +# + +ifdef QUIET + ANT_OPTIONS += -quiet +endif + +ifdef VERBOSE + ANT_OPTIONS += -verbose -diagnostics +endif + +ifdef JDK_VERSION + ANT_OPTIONS += -Djdk.version=$(JDK_VERSION) +endif + +ifdef FULL_VERSION + ANT_OPTIONS += -Dfull.version='$(FULL_VERSION)' # will contain spaces +endif + +ifdef MILESTONE + ANT_OPTIONS += -Dmilestone=$(MILESTONE) +endif + +ifdef BUILD_NUMBER + ANT_OPTIONS += -Dbuild.number=$(BUILD_NUMBER) +else + ifdef JDK_BUILD_NUMBER + ANT_OPTIONS += -Dbuild.number=$(JDK_BUILD_NUMBER) + endif +endif + +ifeq ($(VARIANT), DBG) + ANT_OPTIONS += -Djavac.debug=true +else + ifeq ($(VARIANT), OPT) + ANT_OPTIONS += -Djavac.debug=false + endif +endif + +# Note: jdk/make/common/Defs.gmk uses LANGUAGE_VERSION (-source NN) +# and the somewhat misnamed CLASS_VERSION (-target NN) +ifdef TARGET_CLASS_VERSION + ANT_OPTIONS += -Djavac.target=$(TARGET_CLASS_VERSION) +else + ifdef JAVAC_TARGET_ARG + ANT_OPTIONS += -Djavac.target=$(JAVAC_TARGET_ARG) + endif +endif + +ifdef ALT_BOOTDIR + ANT_OPTIONS += -Dboot.java.home=$(ALT_BOOTDIR) + ANT_JAVA_HOME = JAVA_HOME=$(ALT_BOOTDIR) +endif + +ifdef ALT_OUTPUTDIR + OUTPUTDIR = $(ALT_OUTPUTDIR) + ANT_OPTIONS += -Dbuild.dir=$(ALT_OUTPUTDIR)/build + ANT_OPTIONS += -Ddist.dir=$(ALT_OUTPUTDIR)/dist +else + OUTPUTDIR = .. +endif +#ABS_OUTPUTDIR = $(abspath $(OUTPUTDIR)) +ABS_OUTPUTDIR = $(call FullPath,$(OUTPUTDIR)) + +ANT_TMPDIR = $(ABS_OUTPUTDIR)/build/ant-tmp +ANT_OPTS = ANT_OPTS=-Djava.io.tmpdir='$(ANT_TMPDIR)' + +ifdef FINDBUGS_HOME + ANT_OPTIONS += -Dfindbugs.home=$(FINDBUGS_HOME) +endif + +ifdef ANT_HOME + ANT = $(ANT_HOME)/bin/ant + ifneq ($(shell test -x $(ANT) && echo OK), OK) + $(error $(ANT) not found -- please update ANT_HOME) + endif +else + ANT = ant + ifneq ($(shell test -x "`which $(ANT)`" && echo OK), OK) + $(error 'ant' not found -- please set ANT_HOME or put 'ant' on your PATH) + endif +endif + +# Default target and expected 'do everything' target +all: build + +# Standard make clobber target +clobber: clean + +# All ant targets of interest +ANT_TARGETS = build clean sanity post-sanity diagnostics # for now + +# Create a make target for each +$(ANT_TARGETS): + @ mkdir -p $(OUTPUTDIR)/build $(ANT_TMPDIR) + $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) -diagnostics > $(OUTPUTDIR)/build/ant-diagnostics.log + $(ANT_JAVA_HOME) $(ANT_OPTS) $(ANT) $(ANT_OPTIONS) $@ + +#------------------------------------------------------------------- +# +# Targets for Sun's internal JPRT build system + +CD = cd +ZIP = zip + +JPRT_ARCHIVE_BUNDLE=$(ABS_OUTPUTDIR)/$(JPRT_BUILD_FLAVOR)-bundle.zip + +jprt_build_product jprt_build_debug jprt_build_fastdebug: all + ( $(CD) $(OUTPUTDIR) && \ + $(ZIP) -q -r $(JPRT_ARCHIVE_BUNDLE) build dist ) + +#------------------------------------------------------------------- + +# Declare these phony (not filenames) +.PHONY: $(ANT_TARGETS) all clobber \ + jprt_build_product jprt_build_debug jprt_build_fastdebug diff --git a/langtools/make/Makefile-classic b/langtools/make/Makefile-classic new file mode 100644 index 00000000000..a26b089f60f --- /dev/null +++ b/langtools/make/Makefile-classic @@ -0,0 +1,419 @@ +# +# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# +# Makefile for building the langtools workspace. +# + +# +# On Solaris, the 'make' utility from Sun will not work with these makefiles. +# This little rule is only understood by Sun's make, and is harmless +# when seen by the GNU make tool. If using Sun's make, this causes the +# make command to fail. +# +SUN_MAKE_TEST:sh = @echo "ERROR: PLEASE USE GNU VERSION OF MAKE"; exit 33 + +#----- cancel implicit rules + +%: %.o +%: %.obj +%: %.dll +%: %.c +%: %.cc +%: %.C +%: %.p +%: %.f +%: %.s +%: %.F +%: %.r +%: %.S +%: %.mod +%: %.sh +%: %,v +%: RCS/%,v + +#----- imports + +ifdef ALT_BOOT_JAVA_HOME + BOOT_JAVA_HOME = $(ALT_BOOT_JAVA_HOME) +else + ifdef ALT_BOOTDIR + BOOT_JAVA_HOME = $(ALT_BOOTDIR) + else + BOOT_JAVA_HOME=/java/re/jdk/1.5.0/archive/fcs/binaries/solaris-sparc + endif +endif + +BOOT_JAVA=$(BOOT_JAVA_HOME)/bin/java +BOOT_JAVAC=$(BOOT_JAVA_HOME)/bin/javac +BOOTJAR=$(BOOT_JAVA_HOME)/bin/jar + +ifdef ALT_TESTJAVA_HOME + TESTJAVA_HOME = $(ALT_TESTJAVA_HOME) +else + TESTJAVA_HOME=/java/re/jdk/1.6.0/archive/fcs/binaries/solaris-sparc +endif + +TESTJAVA=$(TESTJAVA_HOME)/bin/java + +ifdef ALT_FINDBUGS_HOME + FINDBUGS_HOME = $(ALT_FINDBUGS_HOME) +else + FINDBUGS_HOME = /java/devtools/share/findbugs/1.1.2-rc4 +endif + +FINDBUGS = $(FINDBUGS_HOME)/bin/findbugs + +#----- commands + +CHMOD = chmod +CP = cp +ECHO = echo # FIXME +FIND = find +MKDIR = mkdir +SED = sed +ZIP = zip + +#----- locations and deliverables + +TOPDIR = .. +SRC_BIN_DIR = $(TOPDIR)/src/share/bin +SRC_CLASSES_DIR = $(TOPDIR)/src/share/classes + +BUILD_DIR = $(TOPDIR)/build + +CLASSES_DIR = $(BUILD_DIR)/classes +GENSRC_DIR = $(BUILD_DIR)/gensrc + +DIST_DIR = $(TOPDIR)/dist +BIN_DIR = $(DIST_DIR)/bin +LIB_DIR = $(DIST_DIR)/lib + +JAVAC_JAR = $(LIB_DIR)/javac.jar +JAVADOC_JAR = $(LIB_DIR)/javadoc.jar +JAVAH_JAR = $(LIB_DIR)/javah.jar +JAVAP_JAR = $(LIB_DIR)/javap.jar +APT_JAR = $(LIB_DIR)/apt.jar + +CLASSES_JAR = $(DIST_DIR)/classes.jar +SRC_ZIP = $(DIST_DIR)/src.zip + +BUILDTOOLSRC_DIR = tools +BUILDTOOLCLASSES_DIR = $(BUILD_DIR)/toolclasses + +#----- + +ifndef JDK_MAJOR_VERSION + JDK_MAJOR_VERSION = 1 +endif + +ifndef JDK_MINOR_VERSION + JDK_MINOR_VERSION = 7 +endif + +ifndef JDK_MICRO_VERSION + JDK_MICRO_VERSION = 0 +endif + +ifndef JDK_VERSION + JDK_VERSION = $(JDK_MAJOR_VERSION).$(JDK_MINOR_VERSION).$(JDK_MICRO_VERSION) +endif + +ifndef MILESTONE + MILESTONE = internal +endif + +# RELEASE is JDK_VERSION and -MILESTONE if MILESTONE is set +ifneq ($(MILESTONE),fcs) + RELEASE = $(JDK_VERSION)-$(MILESTONE)$(BUILD_VARIANT_RELEASE) +else + RELEASE = $(JDK_VERSION)$(BUILD_VARIANT_RELEASE) +endif + +# FULL_VERSION is RELEASE and -BUILD_NUMBER if BUILD_NUMBER is set +ifdef BUILD_NUMBER + FULL_VERSION = $(RELEASE)-$(BUILD_NUMBER) +else + BUILD_NUMBER = b00 + USER_RELEASE_SUFFIX := $(shell echo $(USER)_`date '+%d_%b_%Y_%H_%M' | tr "A-Z" "a-z"`) + FULL_VERSION = $(RELEASE)-$(USER_RELEASE_SUFFIX)-$(BUILD_NUMBER) +endif + +#----- useful macros + +TOOLS = javac javadoc javah javap apt + +SOURCE_LEVEL = 5 +BOOTSTRAP_TARGET_LEVEL = 5 +TARGET_LEVEL = 6 + +ifndef TARGET_JAVA + TARGET_JAVA = java +endif + +NO_PROPRIETARY_API_WARNINGS = -XDignore.symbol.file=true + +SELF = $(lastword $(MAKEFILE_LIST)) + +#----- + +# the default is to generate the following: +# dist/{bin,lib}: +# lang tools compiled to run on the target JDK + +default: + $(MAKE) -f $(SELF) \ + MILESTONE=bootstrap \ + TARGET_LEVEL=$(BOOTSTRAP_TARGET_LEVEL) \ + TARGET_JAVA=$(BOOT_JAVA_HOME)/bin/java \ + GENSRC_DIR=$(BUILD_DIR)/bootstrap/gensrc \ + CLASSES_DIR=$(BUILD_DIR)/bootstrap/classes \ + BIN_DIR=$(BUILD_DIR)/bootstrap/bin \ + LIB_DIR=$(BUILD_DIR)/bootstrap/lib \ + $(BUILD_DIR)/bootstrap/lib/javac.jar \ + $(BUILD_DIR)/bootstrap/bin/javac + $(MAKE) -f $(SELF) \ + BOOT_JAVAC=$(BUILD_DIR)/bootstrap/bin/javac \ + tools + +# for jdk, we generate the following: +# dist/bootstrap/{bin,lib}: +# lang tools compiled to run on the boot JDK +# dist/lib/classes.jar: +# lang tools recompiled to run on the target JDK, +# ready for inclusion in rt.jar and tools.jar +# dist/lib/src.zip +# .properties and .java files for classes in classes.jar, +# ready for jdk src.zip + +jdk: + $(MAKE) -f $(SELF) \ + MILESTONE=bootstrap \ + TARGET_LEVEL=$(BOOTSTRAP_TARGET_LEVEL) \ + TARGET_JAVA=$(BOOT_JAVA_HOME)/bin/java \ + GENSRC_DIR=$(BUILD_DIR)/bootstrap/gensrc \ + CLASSES_DIR=$(BUILD_DIR)/bootstrap/classes \ + BIN_DIR=$(DIST_DIR)/bootstrap/bin \ + LIB_DIR=$(DIST_DIR)/bootstrap/lib \ + tools + $(MAKE) -f $(SELF) \ + BOOT_JAVAC=$(DIST_DIR)/bootstrap/bin/javac \ + LIB_DIR=$(BUILD_DIR)/jdk/lib \ + $(DIST_DIR)/lib/classes.jar \ + $(DIST_DIR)/lib/src.zip + +tools: $(TOOLS:%=$(LIB_DIR)/%.jar) $(TOOLS:%=$(BIN_DIR)/%) + +clean: + $(RM) -r $(BUILD_DIR) + +really-clean: clean + $(RM) -r $(DIST_DIR) + +jprt_product_build \ +jprt_debug_build \ +jprt_fastdebug_build: lib + +#----- javac + +JAVAC_DIRS = \ + javax/annotation/processing \ + javax/lang/model \ + javax/tools \ + com/sun/source \ + com/sun/tools/javac + +JAVAC_RESOURCE_FILES = \ + $(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVAC_DIRS)) -name SCCS -prune -o -name \*.properties -print ) + +JAVAC_JAVA_FILES = \ + $(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVAC_DIRS)) -name SCCS -prune -o -name \*.java -print ) \ + $(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(JAVAC_RESOURCE_FILES)) \ + $(GENSRC_DIR)/com/sun/tools/javac/resources/version.java + +$(JAVAC_JAR): $(JAVAC_JAVA_FILES) + $(MKDIR) -p $(CLASSES_DIR) $(@D) + $(BOOT_JAVAC) -d $(CLASSES_DIR) -target $(TARGET_LEVEL) $(NO_PROPRIETARY_API_WARNINGS) $(JAVAC_JAVA_FILES) + ( $(ECHO) Main-Class: com.sun.tools.javac.Main ) > $(BUILD_DIR)/javac.mf + $(BOOTJAR) -cfm $@ $(BUILD_DIR)/javac.mf $(patsubst %,-C $(CLASSES_DIR) %, $(JAVAC_DIRS)) + +#----- javadoc + +### FIXME -- javadoc has a couple of extra non-property resource files +### that need to be included + +JAVADOC_DIRS = \ + com/sun/javadoc \ + com/sun/tools/doclets \ + com/sun/tools/javadoc + +JAVADOC_RESOURCE_FILES = \ + $(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVADOC_DIRS)) -name SCCS -prune -o -name \*.properties -print ) + +JAVADOC_JAVA_FILES = \ + $(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVADOC_DIRS)) -name SCCS -prune -o -name \*.java -print ) \ + $(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(JAVADOC_RESOURCE_FILES)) + +$(JAVADOC_JAR): $(JAVADOC_JAVA_FILES) $(JAVAC_JAR) + $(MKDIR) -p $(CLASSES_DIR) $(@D) + $(BOOT_JAVAC) -sourcepath "" -classpath $(JAVAC_JAR) -d $(CLASSES_DIR) -target $(TARGET_LEVEL) $(JAVADOC_JAVA_FILES) + ( $(ECHO) Main-Class: com.sun.tools.javadoc.Main ; $(ECHO) Class-Path: javac.jar ) > $(BUILD_DIR)/javadoc.mf + $(BOOTJAR) -cfm $@ $(BUILD_DIR)/javadoc.mf $(patsubst %,-C $(CLASSES_DIR) %, $(JAVADOC_DIRS)) + +#----- javah + +JAVAH_DIRS = \ + com/sun/tools/javah + +JAVAH_RESOURCE_FILES = \ + $(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVAH_DIRS)) -name SCCS -prune -o -name \*.properties -print ) + +JAVAH_JAVA_FILES = \ + $(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVAH_DIRS)) -name SCCS -prune -o -name \*.java -print ) \ + $(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(JAVAH_RESOURCE_FILES)) + +$(JAVAH_JAR): $(JAVAH_JAVA_FILES) $(JAVADOC_JAR) + $(MKDIR) -p $(CLASSES_DIR) $(@D) + $(BOOT_JAVAC) -sourcepath "" -classpath $(CLASSES_DIR) -d $(CLASSES_DIR) -target $(TARGET_LEVEL) $(JAVAH_JAVA_FILES) + ( $(ECHO) Main-Class: com.sun.tools.javah.Main ; $(ECHO) Class-Path: javadoc.jar ) > $(BUILD_DIR)/javah.mf + $(BOOTJAR) -cfm $@ $(BUILD_DIR)/javah.mf $(patsubst %,-C $(CLASSES_DIR) %, $(JAVAH_DIRS)) + +#----- javap + +JAVAP_DIRS = \ + sun/tools/javap + +JAVAP_RESOURCE_FILES = \ + $(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVAP_DIRS)) -name SCCS -prune -o -name \*.properties -print ) + +JAVAP_JAVA_FILES = \ + $(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(JAVAP_DIRS)) -name SCCS -prune -o -name \*.java -print ) \ + $(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(JAVAP_RESOURCE_FILES)) + +$(JAVAP_JAR): $(JAVAP_JAVA_FILES) \ + $(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(JAVAP_RESOURCE_FILES)) + $(MKDIR) -p $(CLASSES_DIR) + $(BOOT_JAVAC) -sourcepath "" -classpath $(CLASSES_DIR) -d $(CLASSES_DIR) -target $(TARGET_LEVEL) $(JAVAP_JAVA_FILES) + ( $(ECHO) Main-Class: sun.tools.javap.Main ) > $(BUILD_DIR)/javap.mf + $(BOOTJAR) -cfm $@ $(BUILD_DIR)/javap.mf $(patsubst %,-C $(CLASSES_DIR) %, $(JAVAP_DIRS)) + +#----- apt + +APT_DIRS = \ + com/sun/mirror \ + com/sun/tools/apt + +APT_RESOURCE_FILES = \ + $(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(APT_DIRS)) -name SCCS -prune -o -name \*.properties -print ) + +APT_JAVA_FILES = \ + $(shell find $(patsubst %,$(SRC_CLASSES_DIR)/%,$(APT_DIRS)) -name SCCS -prune -o -name \*.java -print ) \ + $(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(APT_RESOURCE_FILES)) + +$(APT_JAR): $(APT_JAVA_FILES) $(JAVAC_JAR) \ + $(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(APT_RESOURCE_FILES)) + $(MKDIR) -p $(CLASSES_DIR) $(@D) + $(BOOT_JAVAC) -sourcepath "" -classpath $(CLASSES_DIR) -d $(CLASSES_DIR) -target $(TARGET_LEVEL) $(NO_PROPRIETARY_API_WARNINGS) \ + $(APT_JAVA_FILES) \ + $(patsubst $(SRC_CLASSES_DIR)/%.properties,$(GENSRC_DIR)/%.java,$(APT_RESOURCE_FILES)) + ( $(ECHO) Main-Class: com.sun.tools.apt.Main ; $(ECHO) Class-Path: javac.jar ) > $(BUILD_DIR)/apt.mf + $(BOOTJAR) -cfm $@ $(BUILD_DIR)/apt.mf $(patsubst %,-C $(CLASSES_DIR) %, $(APT_DIRS)) + +#----- + +build-tools: $(BUILDTOOLCLASSES_DIR)/CompileProperties/CompileProperties.class + +$(GENSRC_DIR)/%.java: $(SRC_CLASSES_DIR)/%.properties $(BUILDTOOLCLASSES_DIR)/CompileProperties/CompileProperties.class + $(MKDIR) -p $(@D) + $(BOOT_JAVA) -cp $(BUILDTOOLCLASSES_DIR)/CompileProperties CompileProperties $< $(patsubst $(CLASSES_DIR)/%.class,$(GENSRC_DIR)/%.java,$@) + +$(GENSRC_DIR)/%.java: $(GENSRC_DIR)/%.properties $(BUILDTOOLCLASSES_DIR)/CompileProperties/CompileProperties.class + $(MKDIR) -p $(@D) + $(BOOT_JAVA) -cp $(BUILDTOOLCLASSES_DIR)/CompileProperties CompileProperties $< $(patsubst $(CLASSES_DIR)/%.class,$(GENSRC_DIR)/%.java,$@) + +$(GENSRC_DIR)/%.properties: $(SRC_CLASSES_DIR)/%.properties-template + $(MKDIR) -p $(@D) + $(SED) -e 's/$$(JDK_VERSION)/$(JDK_VERSION)/' \ + -e 's/$$(FULL_VERSION)/$(FULL_VERSION)/' \ + -e 's/$$(RELEASE)/$(RELEASE)/' \ + < $< > $@ + +$(BUILDTOOLCLASSES_DIR)/%.class : $(BUILDTOOLSRC_DIR)/%.java + $(MKDIR) -p $(@D) + $(BOOT_JAVAC) -d $(@D) $< + +#----- all classes + +$(DIST_DIR)/%/classes.jar: $(JAVAC_JAR) $(JAVADOC_JAR) $(JAVAH_JAR) $(JAVAP_JAR) $(APT_JAR) + $(MKDIR) -p $(@D) + $(BOOTJAR) -cf $@ -C $(CLASSES_DIR) . + +#----- src.zip + +SRC_ZIP_FILES = $(shell $(FIND) $(SRC_CLASSES_DIR) \( -name SCCS -o -name \*-template \) -prune -o -type f -print ) + +$(DIST_DIR)/%/src.zip: $(SRC_ZIP_FILES) + abs_src_zip=`cd $(@D) ; pwd`/$(@F) ; \ + ( cd $(SRC_CLASSES_DIR) ; $(FIND) . \( -name SCCS -o -name \*-template \) -prune -o -type f -print | $(ZIP) -q $$abs_src_zip -@ ) ; \ + ( cd $(SRC_CLASSES_DIR) ; $(FIND) . -name SCCS -prune -o -name \*-template -print | $(SED) -e 's/-template//' ) | ( cd $(GENSRC_DIR) ; $(ZIP) -q $$abs_src_zip -@ ) + +#----- bin files + +$(BIN_DIR)/%: $(SRC_BIN_DIR)/launcher.sh-template + $(MKDIR) -p $(@D) + $(SED) -e 's|#PROGRAM#|$(@F)|' -e 's|#TARGET_JAVA#|$(TARGET_JAVA)|' $< > $@ + $(CHMOD) +x $@ + +#----- + +findbugs: $(BUILD_DIR)/findbugs.txt + +$(BUILD_DIR)/findbugs.txt: $(CLASSES_JAR) + $(MKDIR) -p $(@D) + $(FINDBUGS) -textui -javahome $(BOOT_JAVA_HOME) -high -emacs -outputFile $@ $< + +#----- + +quick-check: $(patsubst %, $(DIST_LIB_DIR)/%.jar, $(TOOLS)) + $(TESTJAVA) -jar $(JAVAC_JAR) -version + - $(TESTJAVA) -jar $(JAVADOC_JAR) -version + $(TESTJAVA) -jar $(JAVAH_JAR) -version + - $(TESTJAVA) -jar $(JAVAP_JAR) -version + $(TESTJAVA) -jar $(APT_JAR) -version + +#----- + +.PHONY: \ + all \ + build \ + build-tools \ + clean \ + default \ + findbugs \ + jprt_product_build \ + jprt_debug_build \ + jprt_fastdebug_build \ + tools + diff --git a/langtools/make/README b/langtools/make/README new file mode 100644 index 00000000000..466426d8ad6 --- /dev/null +++ b/langtools/make/README @@ -0,0 +1,43 @@ +Building the "langtools" workspace. + +The "langtools" workspace can be built from the command line with Ant. +The build file is make/build.xml, in conjunction with make/build.properties. +Some additional user-specific properties files are also read, to allow +you to customize selected properties as needed. + +Individual tools within the workspace can also be built and worked on +with NetBeans, using the projects in the make/netbeans directory. + +The "langtools" workspace can also be built from the command line with +GNU Make, although the Makefile is simply a wrapper around the Ant +build file. This is provided for systems (such as the full OpenJDK build) +that expect to be able to build this workspace with GNU Make. + +System Requirements: + Ant: version 1.6.5 or later + NetBeans: version 5.0 or later (optional) + JDK: currently version 1.5.0, although 1.6.0 is recommended + OS: any system supporting the above tools + +For more information: + Ant: http://ant.apache.org/ + GNU Make: http://www.gnu.org/software/make/ + NetBeans: http://www.netbeans.org/ + + +Testing the "langtools" workspace. + +The primary set of tests for the compiler is the compiler TCK. This +tests that the compiler performs according to the specifications in +JLS and JVMS. + +In addition, there is a substantial collection of regression and unit +tests for all the tools in the maain langtools test/ directory. + +Finally, there is a small set of tests to do basic validation of a build +of the langtools workspace for use by JDK. These tests check the contents +of the dist/ directory generated by the build, and verify that the various +tools can do basic "Hello World"-style processing. These tests should be +run by jtreg, with the -jdk option set a version of JDK capable of running +the default output of the javac compiler in this workspace. Currently, +this means JDK 6 or better. diff --git a/langtools/make/build.properties b/langtools/make/build.properties new file mode 100644 index 00000000000..949e91d90a0 --- /dev/null +++ b/langtools/make/build.properties @@ -0,0 +1,135 @@ +# +# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# This is the JDK used to build and run the bootstrap version of javac. +# The bootstrap javac is used to compile both boostrap versions of the +# other tools, and product versions of all the tools. +# Override this path as needed, either on the command line or in +# one of the standard user build.properties files (see build.xml) + +# boot.java.home = /opt/jdk/1.5.0 +boot.java = ${boot.java.home}/bin/java +boot.javac = ${boot.java.home}/bin/javac +boot.javac.target = 5 + +# This is the JDK used to run the product version of the tools, +# for example, for testing. If you're building a complete JDK, specify that. +# Override this path as needed, either on the command line or in +# one of the standard user build.properties files (see build.xml) + +# target.java.home = /opt/jdk/1.6.0 +target.java = ${target.java.home}/bin/java + +# Version info -- override as needed +jdk.version = 1.7.0 +build.number = b00 +milestone = internal + +# FIXME -- these need to match the standard values +# If we include date in full.version (ie for developer build) +# we will need to make sure the build is idempotent (i.e. +# repeated builds don't rebuild the tools, because of new +# timestamps +# FIXME -- need to include openjdk as needed +release = ${jdk.version}-${milestone} +bootstrap.release = ${release}_bootstrap +full.version = ${release}-${build.number} +bootstrap.full.version = ${bootstrap.release}-${build.number} + +# options for the tasks used to compile the tools +javac.target = 6 +javac.debug = true +javac.debuglevel = source,lines +javac.no.jdk.warnings = -XDignore.symbol.file=true +# set the following to -version to verify the versions of javac being used +javac.version.opt = +# in time, there should be no exceptions to -Xlint:all +javac.lint.opts = -Xlint:all,-unchecked,-deprecation,-fallthrough,-cast,-serial -Werror + +# options for the task for javac +javadoc.jls3.url=http://java.sun.com/docs/books/jls/ +javadoc.jls3.cite=<a href="${javadoc.jls3.url}">The Java Language Specification, Third Edition</a> +javadoc.jls3.option=-tag "jls3:a:See <cite>${javadoc.jls3.cite}</cite>:" + +# jtreg, used to run the JDK regression tests +# Override this path as needed, either on the command line or in +# one of the standard user build.properties files (see build.xml) + +# jtreg.home = /opt/jtreg/3.2.2_02 + +# findbugs +# Override this path as needed, either on the command line or in +# one of the standard user build.properties files (see build.xml) + +# findbugs.home = /opt/findbugs/1.2.1 + +#------------------------------------------------------------ + +# The following properties define the packages for each of the tools. +# Syntactically, they should be suitable as arguments for the "includes" +# parameter of Ant filesets. In particular, note the trailing '/'. + +javac.includes = \ + javax/annotation/processing/ \ + javax/lang/model/ \ + javax/tools/ \ + com/sun/source/ com/sun/tools/javac/ + +javac.tests = \ + tools/javac + +javadoc.includes = \ + com/sun/javadoc/ \ + com/sun/tools/javadoc/ + +javadoc.tests = \ + tools/javadoc/ + +doclets.includes = \ + com/sun/tools/doclets/ + +doclets.tests = \ + com/sun/javadoc/ + +javah.includes = \ + com/sun/tools/javah/ + +javah.tests = \ + tools/javah/ + +javap.includes = \ + sun/tools/javap/ + +javap.tests = \ + tools/javap/ + +apt.includes = \ + com/sun/mirror/ \ + com/sun/tools/apt/ + +apt.tests = \ + tools/apt/ + + diff --git a/langtools/make/build.xml b/langtools/make/build.xml new file mode 100644 index 00000000000..b2d8b1b6380 --- /dev/null +++ b/langtools/make/build.xml @@ -0,0 +1,759 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
Unofficial Javadoc generated from developer sources for preview purposes only]]>
+ + + + + + + + + + + + + + + + + + + + + +
+
+
+
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ant.home = ${ant.home} + boot.java.home = ${boot.java.home} + target.java.home = ${target.java.home} + jtreg.home = ${jtreg.home} + findbugs.home = ${findbugs.home} + + + + + + + + + + + + +
+ diff --git a/langtools/make/jprt.config b/langtools/make/jprt.config new file mode 100644 index 00000000000..b112bcb1eda --- /dev/null +++ b/langtools/make/jprt.config @@ -0,0 +1,241 @@ +#!echo "This is not a shell script" +############################################################################# +# +# Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# +############################################################################# +# +# JPRT shell configuration for building. +# +# Input environment variables: +# ALT_BOOTDIR +# ALT_SLASH_JAVA +# ALT_JDK_IMPORT_PATH +# Windows Only: +# PATH +# PROCESSOR_IDENTIFIER +# ROOTDIR +# +# Output variable settings: +# make Full path to GNU make +# +# Output environment variables: +# PATH +# Windows Only: +# ALT_DEVTOOLS_PATH (To avoid the C:/UTILS default) +# +# After JDK6, most settings will be found via ALT_SLASH_JAVA or +# by way of other system environment variables. If this was JDK5 +# or an older JDK, you might need to export more ALT_* variables. +# +############################################################################# + +############################################################################# +# Error +error() # message +{ + echo "ERROR: $1" + exit 6 +} +# Directory must exist +dirMustExist() # dir name +{ + if [ ! -d "$1" ] ; then + error "Directory for $2 does not exist: $1" + fi +} +# File must exist +fileMustExist() # dir name +{ + if [ ! -f "$1" ] ; then + error "File for $2 does not exist: $1" + fi +} +############################################################################# + +# Should be set by JPRT as the 3 basic inputs +bootdir="${ALT_BOOTDIR}" +slashjava="${ALT_SLASH_JAVA}" +jdk_import="${ALT_JDK_IMPORT_PATH}" + +# Check input +dirMustExist "${bootdir}" ALT_BOOTDIR +dirMustExist "${slashjava}" ALT_SLASH_JAVA +dirMustExist "${jdk_import}" ALT_JDK_IMPORT_PATH + +# Uses 'uname -s', but only expect SunOS or Linux, assume Windows otherwise. +osname=`uname -s` +if [ "${osname}" = SunOS ] ; then + + # SOLARIS: Sparc or X86 + osarch=`uname -p` + if [ "${osarch}" = sparc ] ; then + solaris_arch=sparc + else + solaris_arch=i386 + fi + + # Add basic solaris system paths + path4sdk=/usr/ccs/bin:/usr/ccs/lib:/usr/bin:/bin:/usr/sfw/bin + + # Get the previous JDK to be used to bootstrap the build + path4sdk=${bootdir}/bin:${path4sdk} + + # Ant + ANT_HOME=${slashjava}/devtools/share/ant/1.7.0 + export ANT_HOME + antbindir=${ANT_HOME}/bin + fileMustExist "${antbindir}/ant" ant + path4sdk=${antbindir}:${path4sdk} + + # Find GNU make + make=/usr/sfw/bin/gmake + if [ ! -f ${make} ] ; then + make=/opt/sfw/bin/gmake + if [ ! -f ${make} ] ; then + make=${slashjava}/devtools/${solaris_arch}/bin/gnumake + fi + fi + fileMustExist "${make}" make + + # File creation mask + umask 002 + +elif [ "${osname}" = Linux ] ; then + + # LINUX: X86, AMD64 + osarch=`uname -m` + if [ "${osarch}" = i686 ] ; then + linux_arch=i586 + elif [ "${osarch}" = x86_64 ] ; then + linux_arch=amd64 + fi + + # Add basic paths + path4sdk=/usr/bin:/bin:/usr/sbin:/sbin + + # Get the previous JDK to be used to bootstrap the build + path4sdk=${bootdir}/bin:${path4sdk} + + # Ant + ANT_HOME=${slashjava}/devtools/share/ant/1.7.0 + export ANT_HOME + antbindir=${ANT_HOME}/bin + fileMustExist "${antbindir}/ant" ant + path4sdk=${antbindir}:${path4sdk} + + # Find GNU make + make=/usr/bin/make + fileMustExist "${make}" make + + umask 002 + +else + + # Windows: Differs on CYGWIN vs. MKS + # Also, blanks in pathnames gives GNU make headaches, so anything placed + # in any ALT_* variable should be the short windows dosname. + + # WINDOWS: Install and use MKS or CYGWIN (should have already been done) + # Assumption here is that you are in a shell window via MKS or cygwin. + # MKS install should have defined the environment variable ROOTDIR. + # We also need to figure out which one we have: X86, AMD64 + if [ "`echo ${PROCESSOR_IDENTIFIER} | fgrep AMD64`" != "" ] ; then + windows_arch=amd64 + else + windows_arch=i586 + fi + + # We need to determine if we are running a CYGWIN shell or an MKS shell + # (if uname isn't available, then it will be unix_toolset=unknown) + unix_toolset=unknown + if [ "`uname -a | fgrep Cygwin`" = "" -a -d "${ROOTDIR}" ] ; then + # We kind of assume ROOTDIR is where MKS is and it's ok + unix_toolset=MKS + mkshome=`dosname -s "${ROOTDIR}"` + # Utility to convert to short pathnames without spaces + dosname="${mkshome}/mksnt/dosname -s" + # Most unix utilities are in the mksnt directory of ROOTDIR + unixcommand_path="${mkshome}/mksnt" + path4sdk="${unixcommand_path}" + dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH + devtools_path="${slashjava}/devtools/win32/bin" + path4sdk="${devtools_path};${path4sdk}" + # Normally this need not be set, but on Windows it's default is C:/UTILS + ALT_DEVTOOLS_PATH="${devtools_path}" + export ALT_DEVTOOLS_PATH + dirMustExist "${devtools_path}" ALT_DEVTOOLS_PATH + # Find GNU make + make="${devtools_path}/gnumake.exe" + fileMustExist "${make}" make + elif [ "`uname -a | fgrep Cygwin`" != "" -a -f /bin/cygpath ] ; then + # For CYGWIN, uname will have "Cygwin" in it, and /bin/cygpath should exist + unix_toolset=CYGWIN + # Utility to convert to short pathnames without spaces + dosname="/usr/bin/cygpath -a -m -s" + # Most unix utilities are in the /usr/bin + unixcommand_path="/usr/bin" + path4sdk="${unixcommand_path}" + dirMustExist "${unixcommand_path}" ALT_UNIXCOMMAND_PATH + # Find GNU make + make="${unixcommand_path}/make.exe" + fileMustExist "${make}" make + else + echo "WARNING: Cannot figure out if this is MKS or CYGWIN" + fi + + # WINDOWS: Get the previous JDK to be used to bootstrap the build + path4sdk="${bootdir}/bin;${path4sdk}" + + # Ant + ANT_HOME=${slashjava}/devtools/share/ant/1.7.0 + export ANT_HOME + antbindir=${ANT_HOME}/bin + fileMustExist "${antbindir}/ant" ant + path4sdk="${antbindir};${path4sdk}" + + # Turn all \\ into /, remove duplicates and trailing / + slash_path="`echo ${path4sdk} | sed -e 's@\\\\@/@g' -e 's@//@/@g' -e 's@/$@@' -e 's@/;@;@g'`" + + # For windows, it's hard to know where the system is, so we just add this + # to PATH. + path4sdk="${slash_path};${PATH}" + + # Convert path4sdk to cygwin style + if [ "${unix_toolset}" = CYGWIN ] ; then + path4sdk="`/usr/bin/cygpath -p ${path4sdk}`" + fi + +fi + +# Export PATH setting +PATH="${path4sdk}" +export PATH + +# Things we need to unset +unset LD_LIBRARY_PATH +unset LD_LIBRARY_PATH_32 +unset LD_LIBRARY_PATH_64 +unset JAVA_HOME + diff --git a/langtools/make/jprt.properties b/langtools/make/jprt.properties new file mode 100644 index 00000000000..26ffd61a5b5 --- /dev/null +++ b/langtools/make/jprt.properties @@ -0,0 +1,55 @@ +# +# Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# Properties for jprt +jprt.tools.default.release=jdk1.7.0 + +# Specific platform list +jprt.build.platforms=\ +solaris_sparc_5.10,\ +solaris_sparcv9_5.10,\ +solaris_i586_5.10,\ +solaris_x64_5.10,\ +linux_i586,\ +linux_x64,\ +windows_i586,\ +windows_x64 + +# The different build flavors we want +jprt.build.flavors=product + +# Explicitly designate what the 32bit match is for the 64bit build +jprt.solaris_sparcv9.build.platform.match32=solaris_sparc_5.10 +jprt.solaris_sparcv9_5.10.build.platform.match32=solaris_sparc_5.10 +jprt.solaris_x64.build.platform.match32=solaris_i586_5.10 +jprt.solaris_x64_5.10.build.platform.match32=solaris_i586_5.10 + +# Standard list of jprt test targets for this workspace +jprt.test.targets= + +# Directories needed to build +jprt.bundle.src.dirs=make src +jprt.bundle.exclude.src.dirs=build dist + diff --git a/langtools/make/netbeans/README b/langtools/make/netbeans/README new file mode 100644 index 00000000000..7208e598e6a --- /dev/null +++ b/langtools/make/netbeans/README @@ -0,0 +1,28 @@ +Working on the "langtools" workspace using NetBeans. + +This directory (make/netbeans) contains NetBeans projects that +allow you to work on the various tools using the NetBeans IDE. + +NetBeans 5.0 or later is required and sufficient to use these +projects. This is different from other projects in OpenJDK, +which requires version 6.0 or later. + +The following projects are provided: + +compiler: for working on the compiler, javac +javadoc: for working on the documentation tool, javadoc +doclets: for working on the standard doclets used by the + documentation tool, javadoc +javah: for working on the C header tool, javah +javap: for working on the disassembler, javap +apt: for working on the annotation processing tool, apt. + Note that this is just provided for completeness; + the tool has been superceded by new features in javac, + and work on apt itself is discouraged. + +However, any tool can be worked on from any project; the only difference +between these projects is the behavior of the standard NetBeans actions, +so that "Build" in the compiler project will build the compiler, etc. + + + diff --git a/langtools/make/netbeans/apt/README b/langtools/make/netbeans/apt/README new file mode 100644 index 00000000000..6fa70ee080e --- /dev/null +++ b/langtools/make/netbeans/apt/README @@ -0,0 +1,15 @@ +"apt" project README. + +This project is for working on the annotation processing tool (apt) +in the OpenJDK langtools component. + +The tool was provided in Java 1.5, but has been superceded by new +features in the compiler (javac) in Java 6. apt itself is now +deprecated, and any further devlopment on it is strongly discouraged. + +The main class for the tool is com.sun.tools.apt.Main. + +NetBeans 5.0 or later is required and sufficient to use this +project, and others in the OpenJDK langtools component. +This is different from other projects in OpenJDK, which +require version 6.0 or later. diff --git a/langtools/make/netbeans/apt/build.xml b/langtools/make/netbeans/apt/build.xml new file mode 100644 index 00000000000..6b4a72e3a4a --- /dev/null +++ b/langtools/make/netbeans/apt/build.xml @@ -0,0 +1,62 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/langtools/make/netbeans/apt/nbproject/project.xml b/langtools/make/netbeans/apt/nbproject/project.xml new file mode 100644 index 00000000000..6987228768f --- /dev/null +++ b/langtools/make/netbeans/apt/nbproject/project.xml @@ -0,0 +1,108 @@ + + + + + +]> + + org.netbeans.modules.ant.freeform + + + + apt + + ../../.. + + + + + ${root} + + + + java + ${root}/src/share/classes + + + + tests + ${root}/test + + + + build + ${root}/make + + + + &standard-ide-actions-no-javadoc; + + + folder + ${root}/build/classes + build + + + + + + ${root}/src/share/classes + + + + ${root}/test + + + + ${root}/make + + + + README + + + + &standard-context-menu-items-no-javadoc; + + + + + + + ${root}/src/share/classes + ${root}/build/classes + 1.5 + + + + diff --git a/langtools/make/netbeans/common/shared.xml b/langtools/make/netbeans/common/shared.xml new file mode 100644 index 00000000000..015a08c8b77 --- /dev/null +++ b/langtools/make/netbeans/common/shared.xml @@ -0,0 +1,186 @@ + + + + + + + + + + + + + + + + + Must set property 'includes' + + + + + + + + + + + + + Must set property 'run.classname' + + + + + + + + Some tests failed; see report for details. + + + + + + + + + + + + + Must set property 'debug.classname' + + + + + + + + Must set property 'jtreg.tests' + + + + + + + + Must set property 'class' + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/langtools/make/netbeans/common/standard-context-menu-items-no-javadoc.ent b/langtools/make/netbeans/common/standard-context-menu-items-no-javadoc.ent new file mode 100644 index 00000000000..c40ee69c213 --- /dev/null +++ b/langtools/make/netbeans/common/standard-context-menu-items-no-javadoc.ent @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + diff --git a/langtools/make/netbeans/common/standard-context-menu-items.ent b/langtools/make/netbeans/common/standard-context-menu-items.ent new file mode 100644 index 00000000000..f6e1a96bb84 --- /dev/null +++ b/langtools/make/netbeans/common/standard-context-menu-items.ent @@ -0,0 +1,57 @@ + + + + + + + + + + + + + + + + + + diff --git a/langtools/make/netbeans/common/standard-ide-actions-no-javadoc.ent b/langtools/make/netbeans/common/standard-ide-actions-no-javadoc.ent new file mode 100644 index 00000000000..8f91bbe2544 --- /dev/null +++ b/langtools/make/netbeans/common/standard-ide-actions-no-javadoc.ent @@ -0,0 +1,161 @@ + + + + + + + build + + + + clean + + + + clean + build + + + + compile-single + ${root}/src/share/classes + + includes + ${root}/src/share/classes + \.java$ + relative-path + + , + + + + + + run + + + + run-single + + run.classname + ${root}/src/share/classes + \.java$ + java-name + + + + + + + + + + jtreg + + jtreg.tests + ${root}/test + \.(java|sh)$ + relative-path + + , + + + + + + jtreg + + + + debug-nb + + + + debug-single-nb + + debug.classname + ${root}/src/share/classes + \.java$ + java-name + + + + + + + + + + debug-jtreg-nb + + jtreg.tests + ${root}/test + \.(java|sh)$ + relative-path + + + + + + + + debug-fix + ${root}/src/share/classes + + class + ${root}/src/share/classes + \.java$ + relative-path-noext + + + + + + + + javadoc-nb + diff --git a/langtools/make/netbeans/common/standard-ide-actions.ent b/langtools/make/netbeans/common/standard-ide-actions.ent new file mode 100644 index 00000000000..8f91bbe2544 --- /dev/null +++ b/langtools/make/netbeans/common/standard-ide-actions.ent @@ -0,0 +1,161 @@ + + + + + + + build + + + + clean + + + + clean + build + + + + compile-single + ${root}/src/share/classes + + includes + ${root}/src/share/classes + \.java$ + relative-path + + , + + + + + + run + + + + run-single + + run.classname + ${root}/src/share/classes + \.java$ + java-name + + + + + + + + + + jtreg + + jtreg.tests + ${root}/test + \.(java|sh)$ + relative-path + + , + + + + + + jtreg + + + + debug-nb + + + + debug-single-nb + + debug.classname + ${root}/src/share/classes + \.java$ + java-name + + + + + + + + + + debug-jtreg-nb + + jtreg.tests + ${root}/test + \.(java|sh)$ + relative-path + + + + + + + + debug-fix + ${root}/src/share/classes + + class + ${root}/src/share/classes + \.java$ + relative-path-noext + + + + + + + + javadoc-nb + diff --git a/langtools/make/netbeans/compiler/README b/langtools/make/netbeans/compiler/README new file mode 100644 index 00000000000..9dc7ff11888 --- /dev/null +++ b/langtools/make/netbeans/compiler/README @@ -0,0 +1,11 @@ +"compiler" project README. + +This project is for working on the compiler tool (javac) +in the OpenJDK langtools component. + +The main class for the tool is com.sun.tools.javac.Main. + +NetBeans 5.0 or later is required and sufficient to use this +project, and others in the OpenJDK langtools component. +This is different from other projects in OpenJDK, which +require version 6.0 or later. diff --git a/langtools/make/netbeans/compiler/build.xml b/langtools/make/netbeans/compiler/build.xml new file mode 100644 index 00000000000..1c1df801a52 --- /dev/null +++ b/langtools/make/netbeans/compiler/build.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/langtools/make/netbeans/compiler/nbproject/project.xml b/langtools/make/netbeans/compiler/nbproject/project.xml new file mode 100644 index 00000000000..ac52705ef99 --- /dev/null +++ b/langtools/make/netbeans/compiler/nbproject/project.xml @@ -0,0 +1,108 @@ + + + + + +]> + + org.netbeans.modules.ant.freeform + + + + compiler + + ../../.. + + + + + ${root} + + + + java + ${root}/src/share/classes + + + + tests + ${root}/test + + + + build + ${root}/make + + + + &standard-ide-actions; + + + folder + ${root}/build/classes + build + + + + + + ${root}/src/share/classes + + + + ${root}/test + + + + ${root}/make + + + + README + + + + &standard-context-menu-items; + + + + + + + ${root}/src/share/classes + ${root}/build/classes + 1.5 + + + + diff --git a/langtools/make/netbeans/doclets/README b/langtools/make/netbeans/doclets/README new file mode 100644 index 00000000000..eb7e61b6524 --- /dev/null +++ b/langtools/make/netbeans/doclets/README @@ -0,0 +1,16 @@ +"doclets" project README. + +This project is for working on the standard doclets used by +the documentation tool (javadoc) in the OpenJDK langtools component. + +The doclets are invoked as part of the documentation tool (javadoc). +Using this project, you can also browse javadoc and any tools in langtools. +If you build the doclets, javadoc will be built automatically as well, +if necessary. + +The doclets are found in com.sun.tools.doclets. + +NetBeans 5.0 or later is required and sufficient to use this +project, and others in the OpenJDK langtools component. +This is different from other projects in OpenJDK, which +require version 6.0 or later. diff --git a/langtools/make/netbeans/doclets/build.xml b/langtools/make/netbeans/doclets/build.xml new file mode 100644 index 00000000000..a390161c14d --- /dev/null +++ b/langtools/make/netbeans/doclets/build.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/langtools/make/netbeans/doclets/nbproject/project.xml b/langtools/make/netbeans/doclets/nbproject/project.xml new file mode 100644 index 00000000000..f0fa2f45d74 --- /dev/null +++ b/langtools/make/netbeans/doclets/nbproject/project.xml @@ -0,0 +1,108 @@ + + + + + +]> + + org.netbeans.modules.ant.freeform + + + + doclets + + ../../.. + + + + + ${root} + + + + java + ${root}/src/share/classes + + + + tests + ${root}/test + + + + build + ${root}/make + + + + &standard-ide-actions-no-javadoc; + + + folder + ${root}/build/classes + build + + + + + + ${root}/src/share/classes + + + + ${root}/test + + + + ${root}/make + + + + README + + + + &standard-context-menu-items-no-javadoc; + + + + + + + ${root}/src/share/classes + ${root}/build/classes + 1.5 + + + + diff --git a/langtools/make/netbeans/javadoc/README b/langtools/make/netbeans/javadoc/README new file mode 100644 index 00000000000..e0027ccb397 --- /dev/null +++ b/langtools/make/netbeans/javadoc/README @@ -0,0 +1,16 @@ +"javadoc" project README. + +This project is for working on the documentation tool (javadoc) +in the OpenJDK langtools component. + +javadoc is built on top of the compiler (javac). Using this +project, you can also browse javac and any tools in langtools. +If you build javadoc, javac will be built automatically as well, +if necessary. + +The main class for the tool is com.sun.tools.javadoc.Main. + +NetBeans 5.0 or later is required and sufficient to use this +project, and others in the OpenJDK langtools component. +This is different from other projects in OpenJDK, which +require version 6.0 or later. diff --git a/langtools/make/netbeans/javadoc/build.xml b/langtools/make/netbeans/javadoc/build.xml new file mode 100644 index 00000000000..ba565a6bc58 --- /dev/null +++ b/langtools/make/netbeans/javadoc/build.xml @@ -0,0 +1,63 @@ + + + + + + + + + + + + + + + + + + + + + + + diff --git a/langtools/make/netbeans/javadoc/nbproject/project.xml b/langtools/make/netbeans/javadoc/nbproject/project.xml new file mode 100644 index 00000000000..61ebeb3b7af --- /dev/null +++ b/langtools/make/netbeans/javadoc/nbproject/project.xml @@ -0,0 +1,108 @@ + + + + + +]> + + org.netbeans.modules.ant.freeform + + + + javadoc + + ../../.. + + + + + ${root} + + + + java + ${root}/src/share/classes + + + + tests + ${root}/test + + + + build + ${root}/make + + + + &standard-ide-actions; + + + folder + ${root}/build/classes + build + + + + + + ${root}/src/share/classes + + + + ${root}/test + + + + ${root}/make + + + + README + + + + &standard-context-menu-items; + + + + + + + ${root}/src/share/classes + ${root}/build/classes + 1.5 + + + + diff --git a/langtools/make/netbeans/javah/README b/langtools/make/netbeans/javah/README new file mode 100644 index 00000000000..6e94fb1f68d --- /dev/null +++ b/langtools/make/netbeans/javah/README @@ -0,0 +1,21 @@ +"javah" project README. + +This project is for working on the native header tool (javah) +in the OpenJDK langtools component. + +javah is built on top of the documentation tool (javadoc). Using this +project, you can also browse javadoc and any other tools in langtools. +If you build javah, javadoc will be built automatically as well, +if necessary. + +javah is in the process of being converted so that it runs directly on +top of the compiler, javac, using the annotation processing API, +instead of on top of the documentation tool, javadoc, using the +Doclet API. + +The main class for the tool is com.sun.tools.javah.Main. + +NetBeans 5.0 or later is required and sufficient to use this +project, and others in the OpenJDK langtools component. +This is different from other projects in OpenJDK, which +require version 6.0 or later. diff --git a/langtools/make/netbeans/javah/build.xml b/langtools/make/netbeans/javah/build.xml new file mode 100644 index 00000000000..578cd1458a9 --- /dev/null +++ b/langtools/make/netbeans/javah/build.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/langtools/make/netbeans/javah/nbproject/project.xml b/langtools/make/netbeans/javah/nbproject/project.xml new file mode 100644 index 00000000000..d4db76f39be --- /dev/null +++ b/langtools/make/netbeans/javah/nbproject/project.xml @@ -0,0 +1,108 @@ + + + + + +]> + + org.netbeans.modules.ant.freeform + + + + javah + + ../../.. + + + + + ${root} + + + + java + ${root}/src/share/classes + + + + tests + ${root}/test + + + + build + ${root}/make + + + + &standard-ide-actions-no-javadoc; + + + folder + ${root}/build/classes + build + + + + + + ${root}/src/share/classes + + + + ${root}/test + + + + ${root}/make + + + + README + + + + &standard-context-menu-items-no-javadoc; + + + + + + + ${root}/src/share/classes + ${root}/build/classes + 1.5 + + + + diff --git a/langtools/make/netbeans/javap/README b/langtools/make/netbeans/javap/README new file mode 100644 index 00000000000..fb08ece3ee7 --- /dev/null +++ b/langtools/make/netbeans/javap/README @@ -0,0 +1,11 @@ +"javap" project README. + +This project is for working on the disassembler tool (javap) +in the OpenJDK langtools component. + +The main class for the tool is sun.tools.javap.Main. + +NetBeans 5.0 or later is required and sufficient to use this +project, and others in the OpenJDK langtools component. +This is different from other projects in OpenJDK, which +require version 6.0 or later. diff --git a/langtools/make/netbeans/javap/build.xml b/langtools/make/netbeans/javap/build.xml new file mode 100644 index 00000000000..818a933d5e4 --- /dev/null +++ b/langtools/make/netbeans/javap/build.xml @@ -0,0 +1,60 @@ + + + + + + + + + + + + + + + + + + + + diff --git a/langtools/make/netbeans/javap/nbproject/project.xml b/langtools/make/netbeans/javap/nbproject/project.xml new file mode 100644 index 00000000000..692e6726cf8 --- /dev/null +++ b/langtools/make/netbeans/javap/nbproject/project.xml @@ -0,0 +1,108 @@ + + + + + +]> + + org.netbeans.modules.ant.freeform + + + + javap + + ../../.. + + + + + ${root} + + + + java + ${root}/src/share/classes + + + + tests + ${root}/test + + + + build + ${root}/make + + + + &standard-ide-actions-no-javadoc; + + + folder + ${root}/build/classes + build + + + + + + ${root}/src/share/classes + + + + ${root}/test + + + + ${root}/make + + + + README + + + + &standard-context-menu-items-no-javadoc; + + + + + + + ${root}/src/share/classes + ${root}/build/classes + 1.5 + + + + diff --git a/langtools/make/test/HelloWorld.apt.gold.txt b/langtools/make/test/HelloWorld.apt.gold.txt new file mode 100644 index 00000000000..57318e06df5 --- /dev/null +++ b/langtools/make/test/HelloWorld.apt.gold.txt @@ -0,0 +1,19 @@ + +/** + * This class is used to test the results of the langtools build. + */ +public class HelloWorld { + + public HelloWorld(); + + /** + * The old standby! + * @param args The parameters are ignored. + */ + public static void main(java.lang.String... args); + + /** + * This declaration is for the benefit of javah tests. + */ + public native void test(); +} diff --git a/langtools/make/test/HelloWorld.gold.h b/langtools/make/test/HelloWorld.gold.h new file mode 100644 index 00000000000..3dbba25662a --- /dev/null +++ b/langtools/make/test/HelloWorld.gold.h @@ -0,0 +1,21 @@ +/* DO NOT EDIT THIS FILE - it is machine generated */ +#include +/* Header for class HelloWorld */ + +#ifndef _Included_HelloWorld +#define _Included_HelloWorld +#ifdef __cplusplus +extern "C" { +#endif +/* + * Class: HelloWorld + * Method: test + * Signature: ()V + */ +JNIEXPORT void JNICALL Java_HelloWorld_test + (JNIEnv *, jobject); + +#ifdef __cplusplus +} +#endif +#endif diff --git a/langtools/make/test/HelloWorld.java b/langtools/make/test/HelloWorld.java new file mode 100644 index 00000000000..2ba92287ad6 --- /dev/null +++ b/langtools/make/test/HelloWorld.java @@ -0,0 +1,45 @@ +/* + * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +// NOTE: The javadoc comments are used by the apt tests. + +/** + * This class is used to test the results of the langtools build. + */ +public class HelloWorld +{ + /** + * The old standby! + * @param args The parameters are ignored. + */ + public static void main(String... args) { + System.out.println("Hello World!"); + } + + /** + * This declaration is for the benefit of javah tests. + */ + public native void test(); +} diff --git a/langtools/make/test/HelloWorld.javadoc.gold.txt b/langtools/make/test/HelloWorld.javadoc.gold.txt new file mode 100644 index 00000000000..276b2056802 --- /dev/null +++ b/langtools/make/test/HelloWorld.javadoc.gold.txt @@ -0,0 +1,15 @@ +./HelloWorld.html +./allclasses-frame.html +./allclasses-noframe.html +./constant-values.html +./deprecated-list.html +./help-doc.html +./index-all.html +./index.html +./overview-tree.html +./package-frame.html +./package-list +./package-summary.html +./package-tree.html +./resources/inherit.gif +./stylesheet.css diff --git a/langtools/make/test/HelloWorld.javap.gold.txt b/langtools/make/test/HelloWorld.javap.gold.txt new file mode 100644 index 00000000000..5a38739e434 --- /dev/null +++ b/langtools/make/test/HelloWorld.javap.gold.txt @@ -0,0 +1,7 @@ +Compiled from "HelloWorld.java" +public class HelloWorld extends java.lang.Object{ + public HelloWorld(); + public static void main(java.lang.String[]); + public native void test(); +} + diff --git a/langtools/make/test/README b/langtools/make/test/README new file mode 100644 index 00000000000..08a141f5d4d --- /dev/null +++ b/langtools/make/test/README @@ -0,0 +1,4 @@ +This is a small quick test suite to (provide a framework to) +verify the output of a JDK build of the langtools component. + +It verifies the contents exist and are minimally functional. diff --git a/langtools/make/test/TEST.ROOT b/langtools/make/test/TEST.ROOT new file mode 100644 index 00000000000..e69de29bb2d diff --git a/langtools/make/test/bootstrap/javac.sh b/langtools/make/test/bootstrap/javac.sh new file mode 100644 index 00000000000..01419313320 --- /dev/null +++ b/langtools/make/test/bootstrap/javac.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +# +# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# @test +# @summary Verify basic execution of the bootstrap javac compiler. + +TESTSRC=${TESTSRC:-.} +TOPDIR=${TESTSRC}/../../.. +TESTJAVAEXE="${TESTJAVA:+${TESTJAVA}/bin/}java" + +${TOPDIR}/dist/bootstrap/bin/javac -d . "${TESTSRC}"/../HelloWorld.java + +"${TESTJAVAEXE}" -classpath . HelloWorld > HelloWorld.tmp + +if [ "`cat HelloWorld.tmp`" = "Hello World!" ]; then + echo "Test passed." +else + echo "Test failed." + exit 1 +fi diff --git a/langtools/make/test/bootstrap/javadoc.sh b/langtools/make/test/bootstrap/javadoc.sh new file mode 100644 index 00000000000..69ef141a993 --- /dev/null +++ b/langtools/make/test/bootstrap/javadoc.sh @@ -0,0 +1,43 @@ +#!/bin/sh + +# +# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# @test +# @summary Verify the basic execution of the bootstrap javadoc tool. + +TESTSRC=${TESTSRC:-.} +TOPDIR=${TESTSRC}/../../.. + +rm -rf doc +mkdir doc +${TOPDIR}/dist/bootstrap/bin/javadoc -d doc "${TESTSRC}"/../HelloWorld.java + +( cd doc ; find . -type f -print | LANG=C sort) > javadoc.tmp + +if diff ${TESTSRC}/../HelloWorld.javadoc.gold.txt javadoc.tmp ; then + echo "Test passed." +else + echo "Test failed." + exit 1 +fi diff --git a/langtools/make/test/bootstrap/javah.sh b/langtools/make/test/bootstrap/javah.sh new file mode 100644 index 00000000000..f85977558af --- /dev/null +++ b/langtools/make/test/bootstrap/javah.sh @@ -0,0 +1,40 @@ +#!/bin/sh + +# +# Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# @test +# @summary Verify the basic execution of the bootstrap javah tool. + +TESTSRC=${TESTSRC:-.} +TOPDIR=${TESTSRC}/../../.. + +${TOPDIR}/dist/bootstrap/bin/javac -d . "${TESTSRC}"/../HelloWorld.java +${TOPDIR}/dist/bootstrap/bin/javah -classpath . -d . HelloWorld + +if diff ${TESTSRC}/../HelloWorld.gold.h HelloWorld.h ; then + echo "Test passed." +else + echo "Test failed." + exit 1 +fi diff --git a/langtools/make/test/contents.gold.txt b/langtools/make/test/contents.gold.txt new file mode 100644 index 00000000000..145e888a03a --- /dev/null +++ b/langtools/make/test/contents.gold.txt @@ -0,0 +1,9 @@ +./bootstrap/bin/javac +./bootstrap/bin/javadoc +./bootstrap/bin/javah +./bootstrap/lib/doclets.jar +./bootstrap/lib/javac.jar +./bootstrap/lib/javadoc.jar +./bootstrap/lib/javah.jar +./lib/classes.jar +./lib/src.zip diff --git a/langtools/make/test/contents.sh b/langtools/make/test/contents.sh new file mode 100644 index 00000000000..0eb9db2b272 --- /dev/null +++ b/langtools/make/test/contents.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +# +# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# @test +# @summary +# Verify the contents of the dist directory by name, +# to make sure all necessary files are present. + +TESTSRC=${TESTSRC:-.} +TOPDIR=${TESTSRC}/../.. + +( cd ${TOPDIR}/dist ; find . -type f -print | LANG=C sort ) > contents.tmp + +if diff ${TESTSRC}/contents.gold.txt contents.tmp ; then + echo "Test passed." +else + echo "Test failed." + exit 1 +fi + diff --git a/langtools/make/test/lib/apt.sh b/langtools/make/test/lib/apt.sh new file mode 100644 index 00000000000..224eb94d86a --- /dev/null +++ b/langtools/make/test/lib/apt.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +# +# Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# @test +# @summary Verify the basic execution of the apt classes in classes.jar. + +TESTSRC=${TESTSRC:-.} +TOPDIR=${TESTSRC}/../../.. +TESTJAVAEXE="${TESTJAVA:+${TESTJAVA}/bin/}java" + +"${TESTJAVAEXE}" -Xbootclasspath/p:${TOPDIR}/dist/lib/classes.jar \ + com.sun.tools.apt.Main \ + -print "${TESTSRC}"/../HelloWorld.java > apt.tmp + +if diff ${TESTSRC}/../HelloWorld.apt.gold.txt apt.tmp ; then + echo "Test passed." +else + echo "Test failed." + exit 1 +fi diff --git a/langtools/make/test/lib/classes.gold.txt b/langtools/make/test/lib/classes.gold.txt new file mode 100644 index 00000000000..05c1d81d0f4 --- /dev/null +++ b/langtools/make/test/lib/classes.gold.txt @@ -0,0 +1,38 @@ +META-INF/MANIFEST.MF +com/sun/tools/apt/Main.class +com/sun/tools/apt/main/Main.class +com/sun/tools/apt/resources/apt.class +com/sun/tools/apt/resources/apt_ja.class +com/sun/tools/apt/resources/apt_zh_CN.class +com/sun/tools/doclets/formats/html/resources/standard.class +com/sun/tools/doclets/formats/html/resources/standard_ja.class +com/sun/tools/doclets/formats/html/resources/standard_zh_CN.class +com/sun/tools/doclets/internal/toolkit/resources/doclet.xml +com/sun/tools/doclets/internal/toolkit/resources/doclets.class +com/sun/tools/doclets/internal/toolkit/resources/doclets_ja.class +com/sun/tools/doclets/internal/toolkit/resources/doclets_zh_CN.class +com/sun/tools/doclets/internal/toolkit/resources/inherit.gif +com/sun/tools/javac/Main.class +com/sun/tools/javac/main/Main.class +com/sun/tools/javac/resources/compiler.class +com/sun/tools/javac/resources/compiler_ja.class +com/sun/tools/javac/resources/compiler_zh_CN.class +com/sun/tools/javac/resources/javac.class +com/sun/tools/javac/resources/javac_ja.class +com/sun/tools/javac/resources/javac_zh_CN.class +com/sun/tools/javac/resources/legacy.class +com/sun/tools/javac/resources/version.class +com/sun/tools/javadoc/Main.class +com/sun/tools/javadoc/resources/javadoc.class +com/sun/tools/javadoc/resources/javadoc_ja.class +com/sun/tools/javadoc/resources/javadoc_zh_CN.class +com/sun/tools/javah/Main.class +com/sun/tools/javah/resources/Linux_ppc.class +com/sun/tools/javah/resources/Linux_sparc.class +com/sun/tools/javah/resources/SunOS_sparc.class +com/sun/tools/javah/resources/SunOS_sparcv9.class +com/sun/tools/javah/resources/l10n.class +com/sun/tools/javah/resources/l10n_ja.class +com/sun/tools/javah/resources/l10n_zh_CN.class +com/sun/tools/javah/resources/win32_x86.class +sun/tools/javap/Main.class diff --git a/langtools/make/test/lib/classes.sh b/langtools/make/test/lib/classes.sh new file mode 100644 index 00000000000..ed225e16486 --- /dev/null +++ b/langtools/make/test/lib/classes.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +# +# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# @test +# @summary verify that selected files exist in classes.jar + +# It would be too brittle to check the complete contents of classes.jar, +# so instead, we check for the following +# - Main classes +# - contents of resource directories +# - any other non-.class files + +TESTSRC=${TESTSRC:-.} +TOPDIR=${TESTSRC}/../../.. +TESTJAREXE="${TESTJAVA:+${TESTJAVA}/bin/}jar" + +${TESTJAREXE} -tf ${TOPDIR}/dist/lib/classes.jar | grep -v '/$' > files.lst +egrep 'Main\.class$|resources' files.lst > expect1.lst +grep -v '.class$' files.lst > expect2.lst + +LANG=C sort -u expect1.lst expect2.lst > expect.lst + +if diff ${TESTSRC}/classes.gold.txt expect.lst ; then + echo "Test passed." +else + echo "Test failed." + exit 1 +fi diff --git a/langtools/make/test/lib/javac.sh b/langtools/make/test/lib/javac.sh new file mode 100644 index 00000000000..c4c44c986ad --- /dev/null +++ b/langtools/make/test/lib/javac.sh @@ -0,0 +1,44 @@ +#!/bin/sh + +# +# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# @test +# @summary Verify basic execution of the javac classes in classes.jar. + +TESTSRC=${TESTSRC:-.} +TOPDIR=${TESTSRC}/../../.. +TESTJAVAEXE="${TESTJAVA:+${TESTJAVA}/bin/}java" + +"${TESTJAVAEXE}" -Xbootclasspath/p:${TOPDIR}/dist/lib/classes.jar \ + com.sun.tools.javac.Main \ + -d . "${TESTSRC}"/../HelloWorld.java + +"${TESTJAVAEXE}" -classpath . HelloWorld > HelloWorld.tmp + +if [ "`cat HelloWorld.tmp`" = "Hello World!" ]; then + echo "Test passed." +else + echo "Test failed." + exit 1 +fi diff --git a/langtools/make/test/lib/javadoc.sh b/langtools/make/test/lib/javadoc.sh new file mode 100644 index 00000000000..a261e7c008a --- /dev/null +++ b/langtools/make/test/lib/javadoc.sh @@ -0,0 +1,47 @@ +#!/bin/sh + +# +# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# @test +# @summary Verify the basic execution of the javadoc classes in classes.jar. + +TESTSRC=${TESTSRC:-.} +TOPDIR=${TESTSRC}/../../.. +TESTJAVAEXE="${TESTJAVA:+${TESTJAVA}/bin/}java" + +rm -rf doc +mkdir doc + +"${TESTJAVAEXE}" -Xbootclasspath/p:${TOPDIR}/dist/lib/classes.jar \ + com.sun.tools.javadoc.Main \ + -d doc "${TESTSRC}"/../HelloWorld.java + +( cd doc ; find . -type f -print | LANG=C sort ) > javadoc.tmp + +if diff ${TESTSRC}/../HelloWorld.javadoc.gold.txt javadoc.tmp ; then + echo "Test passed." +else + echo "Test failed." + exit 1 +fi diff --git a/langtools/make/test/lib/javah.sh b/langtools/make/test/lib/javah.sh new file mode 100644 index 00000000000..2e4139de52c --- /dev/null +++ b/langtools/make/test/lib/javah.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +# +# Copyright 2002-2007 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# @test +# @summary Verify the basic execution of the javah classes in classes.jar. + +TESTSRC=${TESTSRC:-.} +TOPDIR=${TESTSRC}/../../.. +TESTJAVAEXE="${TESTJAVA:+${TESTJAVA}/bin/}java" + +"${TESTJAVAEXE}" -Xbootclasspath/p:${TOPDIR}/dist/lib/classes.jar \ + com.sun.tools.javac.Main \ + -d . "${TESTSRC}"/../HelloWorld.java + +"${TESTJAVAEXE}" -Xbootclasspath/p:${TOPDIR}/dist/lib/classes.jar \ + com.sun.tools.javah.Main \ + -classpath . -d . HelloWorld + +if diff ${TESTSRC}/../HelloWorld.gold.h HelloWorld.h ; then + echo "Test passed." +else + echo "Test failed." + exit 1 +fi diff --git a/langtools/make/test/lib/javap.sh b/langtools/make/test/lib/javap.sh new file mode 100644 index 00000000000..50f9060c27c --- /dev/null +++ b/langtools/make/test/lib/javap.sh @@ -0,0 +1,46 @@ +#!/bin/sh + +# +# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# @test +# @summary Verify the basic execution of the javap classes in classes.jar. + +TESTSRC=${TESTSRC:-.} +TOPDIR=${TESTSRC}/../../.. +TESTJAVAEXE="${TESTJAVA:+${TESTJAVA}/bin/}java" + +"${TESTJAVAEXE}" -Xbootclasspath/p:${TOPDIR}/dist/lib/classes.jar \ + com.sun.tools.javac.Main \ + -d . "${TESTSRC}"/../HelloWorld.java + +"${TESTJAVAEXE}" -Xbootclasspath/p:${TOPDIR}/dist/lib/classes.jar \ + sun.tools.javap.Main \ + -classpath . HelloWorld > javap.tmp + +if diff ${TESTSRC}/../HelloWorld.javap.gold.txt javap.tmp ; then + echo "Test passed." +else + echo "Test failed." + exit 1 +fi diff --git a/langtools/make/test/lib/src.gold.txt b/langtools/make/test/lib/src.gold.txt new file mode 100644 index 00000000000..921d5e2c954 --- /dev/null +++ b/langtools/make/test/lib/src.gold.txt @@ -0,0 +1,53 @@ +com/sun/javadoc/package.html +com/sun/mirror/apt/package.html +com/sun/mirror/declaration/package.html +com/sun/mirror/overview.html +com/sun/mirror/type/package.html +com/sun/mirror/util/package.html +com/sun/tools/apt/Main.java +com/sun/tools/apt/main/Main.java +com/sun/tools/apt/resources/apt.properties +com/sun/tools/apt/resources/apt_ja.properties +com/sun/tools/apt/resources/apt_zh_CN.properties +com/sun/tools/doclets/formats/html/markup/package.html +com/sun/tools/doclets/formats/html/package.html +com/sun/tools/doclets/formats/html/resources/standard.properties +com/sun/tools/doclets/formats/html/resources/standard_ja.properties +com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties +com/sun/tools/doclets/internal/toolkit/builders/package.html +com/sun/tools/doclets/internal/toolkit/package.html +com/sun/tools/doclets/internal/toolkit/resources/doclet.xml +com/sun/tools/doclets/internal/toolkit/resources/doclets.properties +com/sun/tools/doclets/internal/toolkit/resources/doclets_ja.properties +com/sun/tools/doclets/internal/toolkit/resources/doclets_zh_CN.properties +com/sun/tools/doclets/internal/toolkit/resources/inherit.gif +com/sun/tools/doclets/internal/toolkit/taglets/package.html +com/sun/tools/doclets/internal/toolkit/util/links/package.html +com/sun/tools/doclets/internal/toolkit/util/package.html +com/sun/tools/doclets/package.html +com/sun/tools/javac/Main.java +com/sun/tools/javac/main/Main.java +com/sun/tools/javac/resources/compiler.properties +com/sun/tools/javac/resources/compiler_ja.properties +com/sun/tools/javac/resources/compiler_zh_CN.properties +com/sun/tools/javac/resources/javac.properties +com/sun/tools/javac/resources/javac_ja.properties +com/sun/tools/javac/resources/javac_zh_CN.properties +com/sun/tools/javac/resources/legacy.properties +com/sun/tools/javac/services/javax.tools.JavaCompilerTool +com/sun/tools/javadoc/Main.java +com/sun/tools/javadoc/resources/javadoc.properties +com/sun/tools/javadoc/resources/javadoc_ja.properties +com/sun/tools/javadoc/resources/javadoc_zh_CN.properties +com/sun/tools/javah/Main.java +com/sun/tools/javah/resources/Linux_ppc.properties +com/sun/tools/javah/resources/Linux_sparc.properties +com/sun/tools/javah/resources/SunOS_sparc.properties +com/sun/tools/javah/resources/SunOS_sparcv9.properties +com/sun/tools/javah/resources/l10n.properties +com/sun/tools/javah/resources/l10n_ja.properties +com/sun/tools/javah/resources/l10n_zh_CN.properties +com/sun/tools/javah/resources/win32_x86.properties +javax/lang/model/overview.html +javax/tools/overview.html +sun/tools/javap/Main.java diff --git a/langtools/make/test/lib/src.sh b/langtools/make/test/lib/src.sh new file mode 100644 index 00000000000..0176daba49c --- /dev/null +++ b/langtools/make/test/lib/src.sh @@ -0,0 +1,50 @@ +#!/bin/sh + +# +# Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +# @test +# @summary verify that selected files exist in src.zip + +# It would be too brittle to check the complete contents of src.zip, +# so instead, we check for the following +# - Main classes +# - contents of resource directories +# - any other non-.class files + +TESTSRC=${TESTSRC:-.} +TOPDIR=${TESTSRC}/../../.. +TESTJAREXE="${TESTJAVA:+${TESTJAVA}/bin/}jar" + +unzip -l ${TOPDIR}/dist/lib/src.zip | awk '{print $4}' | egrep -v '^$|/$|^Name$|-' > files.lst +egrep 'Main\.java$|resources' files.lst > expect1.lst +grep -v '.java$' files.lst > expect2.lst + +LANG=C sort -u expect1.lst expect2.lst > expect.lst + +if diff ${TESTSRC}/src.gold.txt expect.lst ; then + echo "Test passed." +else + echo "Test failed." + exit 1 +fi diff --git a/langtools/make/tools/CompileProperties/CompileProperties.java b/langtools/make/tools/CompileProperties/CompileProperties.java new file mode 100644 index 00000000000..f498815ddf2 --- /dev/null +++ b/langtools/make/tools/CompileProperties/CompileProperties.java @@ -0,0 +1,403 @@ +/* + * Copyright 2002-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.io.BufferedWriter; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileNotFoundException; +import java.io.FileOutputStream; +import java.io.IOException; +import java.io.OutputStreamWriter; +import java.io.Writer; +import java.text.MessageFormat; +import java.util.ArrayList; +import java.util.Collections; +import java.util.Iterator; +import java.util.List; +import java.util.Properties; + +/** Translates a .properties file into a .java file containing the + * definition of a java.util.Properties subclass which can then be + * compiled with javac.

+ * + * Usage: java CompileProperties [path to .properties file] [path to .java file to be output] [super class] + * + * Infers the package by looking at the common suffix of the two + * inputs, eliminating "classes" from it. + * + * @author Scott Violet + * @author Kenneth Russell + */ + +public class CompileProperties { + + public static void main(String[] args) { + CompileProperties cp = new CompileProperties(); + boolean ok = cp.run(args); + if ( !ok ) { + System.exit(1); + } + } + + static interface Log { + void info(String msg); + void verbose(String msg); + void error(String msg, Exception e); + } + + private String propfiles[]; + private String outfiles[] ; + private String supers[] ; + private int compileCount = 0; + private boolean quiet = false; + private Log log; + + public void setLog(Log log) { + this.log = log; + } + + public boolean run(String[] args) { + if (log == null) { + log = new Log() { + public void error(String msg, Exception e) { + System.err.println("ERROR: CompileProperties: " + msg); + if ( e != null ) { + System.err.println("EXCEPTION: " + e.toString()); + e.printStackTrace(); + } + } + public void info(String msg) { + System.out.println(msg); + } + public void verbose(String msg) { + if (!quiet) + System.out.println(msg); + } + }; + } + + boolean ok = true; + /* Original usage */ + if (args.length == 2 && args[0].charAt(0) != '-' ) { + ok = createFile(args[0], args[1], "ListResourceBundle"); + } else if (args.length == 3) { + ok = createFile(args[0], args[1], args[2]); + } else if (args.length == 0) { + usage(log); + ok = false; + } else { + /* New batch usage */ + ok = parseOptions(args); + if ( ok && compileCount == 0 ) { + log.error("options parsed but no files to compile", null); + ok = false; + } + /* Need at least one file. */ + if ( !ok ) { + usage(log); + } else { + /* Process files */ + for ( int i = 0; i < compileCount && ok ; i++ ) { + ok = createFile(propfiles[i], outfiles[i], supers[i]); + } + } + } + return ok; + } + + private boolean parseOptions(String args[]) { + boolean ok = true; + if ( compileCount > 0 ) { + String new_propfiles[] = new String[compileCount + args.length]; + String new_outfiles[] = new String[compileCount + args.length]; + String new_supers[] = new String[compileCount + args.length]; + System.arraycopy(propfiles, 0, new_propfiles, 0, compileCount); + System.arraycopy(outfiles, 0, new_outfiles, 0, compileCount); + System.arraycopy(supers, 0, new_supers, 0, compileCount); + propfiles = new_propfiles; + outfiles = new_outfiles; + supers = new_supers; + } else { + propfiles = new String[args.length]; + outfiles = new String[args.length]; + supers = new String[args.length]; + } + + for ( int i = 0; i < args.length ; i++ ) { + if ( "-compile".equals(args[i]) && i+3 < args.length ) { + propfiles[compileCount] = args[++i]; + outfiles[compileCount] = args[++i]; + supers[compileCount] = args[++i]; + compileCount++; + } else if ( "-optionsfile".equals(args[i]) && i+1 < args.length ) { + String filename = args[++i]; + FileInputStream finput = null; + byte contents[] = null; + try { + finput = new FileInputStream(filename); + int byteCount = finput.available(); + if ( byteCount <= 0 ) { + log.error("The -optionsfile file is empty", null); + ok = false; + } else { + contents = new byte[byteCount]; + int bytesRead = finput.read(contents); + if ( byteCount != bytesRead ) { + log.error("Cannot read all of -optionsfile file", null); + ok = false; + } + } + } catch ( IOException e ) { + log.error("cannot open " + filename, e); + ok = false; + } + if ( finput != null ) { + try { + finput.close(); + } catch ( IOException e ) { + ok = false; + log.error("cannot close " + filename, e); + } + } + if ( ok = true && contents != null ) { + String tokens[] = (new String(contents)).split("\\s+"); + if ( tokens.length > 0 ) { + ok = parseOptions(tokens); + } + } + if ( !ok ) { + break; + } + } else if ( "-quiet".equals(args[i]) ) { + quiet = true; + } else { + log.error("argument error", null); + ok = false; + } + } + return ok; + } + + private boolean createFile(String propertiesPath, String outputPath, + String superClass) { + boolean ok = true; + log.verbose("parsing: " + propertiesPath); + Properties p = new Properties(); + try { + p.load(new FileInputStream(propertiesPath)); + } catch ( FileNotFoundException e ) { + ok = false; + log.error("Cannot find file " + propertiesPath, e); + } catch ( IOException e ) { + ok = false; + log.error("IO error on file " + propertiesPath, e); + } + if ( ok ) { + String packageName = inferPackageName(propertiesPath, outputPath); + log.verbose("inferred package name: " + packageName); + List sortedKeys = new ArrayList(); + for ( Object key : p.keySet() ) { + sortedKeys.add((String)key); + } + Collections.sort(sortedKeys); + Iterator keys = sortedKeys.iterator(); + + StringBuffer data = new StringBuffer(); + + while (keys.hasNext()) { + Object key = keys.next(); + data.append(" { \"" + escape((String)key) + "\", \"" + + escape((String)p.get(key)) + "\" },\n"); + } + + // Get class name from java filename, not the properties filename. + // (zh_TW properties might be used to create zh_HK files) + File file = new File(outputPath); + String name = file.getName(); + int dotIndex = name.lastIndexOf('.'); + String className; + if (dotIndex == -1) { + className = name; + } else { + className = name.substring(0, dotIndex); + } + + String packageString = ""; + if (packageName != null && !packageName.equals("")) { + packageString = "package " + packageName + ";\n\n"; + } + + Writer writer = null; + try { + writer = new BufferedWriter( + new OutputStreamWriter(new FileOutputStream(outputPath), "8859_1")); + MessageFormat format = new MessageFormat(FORMAT); + writer.write(format.format(new Object[] { packageString, className, superClass, data })); + } catch ( IOException e ) { + ok = false; + log.error("IO error writing to file " + outputPath, e); + } + if ( writer != null ) { + try { + writer.flush(); + } catch ( IOException e ) { + ok = false; + log.error("IO error flush " + outputPath, e); + } + try { + writer.close(); + } catch ( IOException e ) { + ok = false; + log.error("IO error close " + outputPath, e); + } + } + log.verbose("wrote: " + outputPath); + } + return ok; + } + + private static void usage(Log log) { + log.info("usage:"); + log.info(" java CompileProperties path_to_properties_file path_to_java_output_file [super_class]"); + log.info(" -OR-"); + log.info(" java CompileProperties {-compile path_to_properties_file path_to_java_output_file super_class} -or- -optionsfile filename"); + log.info(""); + log.info("Example:"); + log.info(" java CompileProperties -compile test.properties test.java ListResourceBundle"); + log.info(" java CompileProperties -optionsfile option_file"); + log.info("option_file contains: -compile test.properties test.java ListResourceBundle"); + } + + private static String escape(String theString) { + // This is taken from Properties.saveConvert with changes for Java strings + int len = theString.length(); + StringBuffer outBuffer = new StringBuffer(len*2); + + for(int x=0; x 0x007e)) { + outBuffer.append('\\'); + outBuffer.append('u'); + outBuffer.append(toHex((aChar >> 12) & 0xF)); + outBuffer.append(toHex((aChar >> 8) & 0xF)); + outBuffer.append(toHex((aChar >> 4) & 0xF)); + outBuffer.append(toHex( aChar & 0xF)); + } else { + if (specialSaveChars.indexOf(aChar) != -1) { + outBuffer.append('\\'); + } + outBuffer.append(aChar); + } + } + } + return outBuffer.toString(); + } + + private static String inferPackageName(String inputPath, String outputPath) { + // Normalize file names + inputPath = new File(inputPath).getPath(); + outputPath = new File(outputPath).getPath(); + // Split into components + String sep; + if (File.separatorChar == '\\') { + sep = "\\\\"; + } else { + sep = File.separator; + } + String[] inputs = inputPath.split(sep); + String[] outputs = outputPath.split(sep); + // Match common names, eliminating first "classes" entry from + // each if present + int inStart = 0; + int inEnd = inputs.length - 2; + int outEnd = outputs.length - 2; + int i = inEnd; + int j = outEnd; + while (i >= 0 && j >= 0) { + if (!inputs[i].equals(outputs[j]) || + (inputs[i].equals("gensrc") && inputs[j].equals("gensrc"))) { + ++i; + ++j; + break; + } + --i; + --j; + } + String result; + if (i < 0 || j < 0 || i >= inEnd || j >= outEnd) { + result = ""; + } else { + if (inputs[i].equals("classes") && outputs[j].equals("classes")) { + ++i; + } + inStart = i; + StringBuffer buf = new StringBuffer(); + for (i = inStart; i <= inEnd; i++) { + buf.append(inputs[i]); + if (i < inEnd) { + buf.append('.'); + } + } + result = buf.toString(); + } + return result; + } + + private static final String FORMAT = + "{0}" + + "import java.util.ListResourceBundle;\n\n" + + "public final class {1} extends {2} '{'\n" + + " protected final Object[][] getContents() '{'\n" + + " return new Object[][] '{'\n" + + "{3}" + + " };\n" + + " }\n" + + "}\n"; + + // This comes from Properties + private static char toHex(int nibble) { + return hexDigit[(nibble & 0xF)]; + } + + // This comes from Properties + private static final char[] hexDigit = { + '0','1','2','3','4','5','6','7','8','9','A','B','C','D','E','F' + }; + + // Note: different from that in Properties + private static final String specialSaveChars = "\""; +} diff --git a/langtools/make/tools/CompileProperties/CompilePropertiesTask.java b/langtools/make/tools/CompileProperties/CompilePropertiesTask.java new file mode 100644 index 00000000000..e7a0be1751d --- /dev/null +++ b/langtools/make/tools/CompileProperties/CompilePropertiesTask.java @@ -0,0 +1,96 @@ +/* + * Copyright 2007 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +import java.io.File; +import java.util.ArrayList; +import java.util.List; + +import org.apache.tools.ant.BuildException; +import org.apache.tools.ant.DirectoryScanner; +import org.apache.tools.ant.Project; +import org.apache.tools.ant.taskdefs.MatchingTask; + +public class CompilePropertiesTask extends MatchingTask { + public void setSrcDir(File srcDir) { + this.srcDir = srcDir; + } + + public void setDestDir(File destDir) { + this.destDir = destDir; + } + + public void setSuperclass(String superclass) { + this.superclass = superclass; + } + + public void execute() { + CompileProperties.Log log = new CompileProperties.Log() { + public void error(String msg, Exception e) { + log(msg, Project.MSG_ERR); + } + public void info(String msg) { + log(msg, Project.MSG_INFO); + } + public void verbose(String msg) { + log(msg, Project.MSG_VERBOSE); + } + }; + List mainOpts = new ArrayList(); + int count = 0; + DirectoryScanner s = getDirectoryScanner(srcDir); + for (String path: s.getIncludedFiles()) { + if (path.endsWith(".properties")) { + String destPath = + path.substring(0, path.length() - ".properties".length()) + + ".java"; + File srcFile = new File(srcDir, path); + File destFile = new File(destDir, destPath); + // Arguably, the comparison in the next line should be ">", not ">=" + // but that assumes the resolution of the last modified time is fine + // grained enough; in practice, it is better to use ">=". + if (destFile.exists() && destFile.lastModified() >= srcFile.lastModified()) + continue; + destFile.getParentFile().mkdirs(); + mainOpts.add("-compile"); + mainOpts.add(srcFile.getPath()); + mainOpts.add(destFile.getPath()); + mainOpts.add(superclass); + count++; + } + } + if (mainOpts.size() > 0) { + log("Generating " + count + " resource files to " + destDir, Project.MSG_INFO); + CompileProperties cp = new CompileProperties(); + cp.setLog(log); + boolean ok = cp.run((String[])mainOpts.toArray(new String[mainOpts.size()])); + if (!ok) + throw new BuildException("CompileProperties failed."); + } + } + + private File srcDir; + private File destDir; + private String superclass = "java.util.ListResourceBundle"; +} diff --git a/langtools/src/share/bin/launcher.sh-template b/langtools/src/share/bin/launcher.sh-template new file mode 100644 index 00000000000..da2f912f757 --- /dev/null +++ b/langtools/src/share/bin/launcher.sh-template @@ -0,0 +1,50 @@ +#!/bin/sh + +# +# Copyright 2006-2007 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +mydir="`dirname $0`" +mylib="`dirname $mydir`"/lib + +# By default, put the jar file and its dependencies on the bootclasspath. +# This is always required on a Mac, because the system langtools classes +# are always on the main class path; in addition, it may be required on +# standard versions of JDK (i.e. using rt.jar and tools.jar) because some +# langtools interfaces are in rt.jar. +# Assume that the jar file being invoked lists all the necessary langtools +# jar files in its Class-Path manifest entry, so there is no need to search +# dependent jar files for additional dependencies. + +if [ "$LANGTOOLS_USE_BOOTCLASSPATH" != "no" ]; then + cp=`unzip -c $mylib/#PROGRAM#.jar META-INF/MANIFEST.MF | + grep "Class-Path:" | + sed -e 's|Class-Path: *||' -e 's|\([a-z]*\.jar\) *|'"$mylib"'/\1:|g'` + bcp="$mylib/#PROGRAM#.jar":$cp +fi + +# javac currently assumes that assertions are enabled in the launcher +ea=-ea:com.sun.tools + +"#TARGET_JAVA#" ${bcp:+-Xbootclasspath/p:"$bcp"} ${ea} -jar "${mydir}"/../lib/#PROGRAM#.jar "$@" diff --git a/langtools/src/share/classes/com/sun/javadoc/AnnotationDesc.java b/langtools/src/share/classes/com/sun/javadoc/AnnotationDesc.java new file mode 100644 index 00000000000..4218b334110 --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/AnnotationDesc.java @@ -0,0 +1,79 @@ +/* + * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + + +/** + * Represents an annotation. + * An annotation associates a value with each element of an annotation type. + * + * @author Scott Seligman + * @since 1.5 + */ +public interface AnnotationDesc { + + /** + * Returns the annotation type of this annotation. + * + * @return the annotation type of this annotation. + */ + AnnotationTypeDoc annotationType(); + + /** + * Returns this annotation's elements and their values. + * Only those explicitly present in the annotation are + * included, not those assuming their default values. + * Returns an empty array if there are none. + * + * @return this annotation's elements and their values. + */ + ElementValuePair[] elementValues(); + + + /** + * Represents an association between an annotation type element + * and one of its values. + * + * @author Scott Seligman + * @since 1.5 + */ + public interface ElementValuePair { + + /** + * Returns the annotation type element. + * + * @return the annotation type element. + */ + AnnotationTypeElementDoc element(); + + /** + * Returns the value associated with the annotation type element. + * + * @return the value associated with the annotation type element. + */ + AnnotationValue value(); + } +} diff --git a/langtools/src/share/classes/com/sun/javadoc/AnnotationTypeDoc.java b/langtools/src/share/classes/com/sun/javadoc/AnnotationTypeDoc.java new file mode 100644 index 00000000000..3b3aa1b75aa --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/AnnotationTypeDoc.java @@ -0,0 +1,44 @@ +/* + * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + + +/** + * Represents an annotation type. + * + * @author Scott Seligman + * @since 1.5 + */ +public interface AnnotationTypeDoc extends ClassDoc { + + /** + * Returns the elements of this annotation type. + * Returns an empty array if there are none. + * + * @return the elements of this annotation type. + */ + AnnotationTypeElementDoc[] elements(); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/AnnotationTypeElementDoc.java b/langtools/src/share/classes/com/sun/javadoc/AnnotationTypeElementDoc.java new file mode 100644 index 00000000000..178c4529549 --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/AnnotationTypeElementDoc.java @@ -0,0 +1,44 @@ +/* + * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + + +/** + * Represents an element of an annotation type. + * + * @author Scott Seligman + * @since 1.5 + */ +public interface AnnotationTypeElementDoc extends MethodDoc { + + /** + * Returns the default value of this element. + * Returns null if this element has no default. + * + * @return the default value of this element. + */ + AnnotationValue defaultValue(); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/AnnotationValue.java b/langtools/src/share/classes/com/sun/javadoc/AnnotationValue.java new file mode 100644 index 00000000000..c55c65d6fc3 --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/AnnotationValue.java @@ -0,0 +1,59 @@ +/* + * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + + +/** + * Represents a value of an annotation type element. + * + * @author Scott Seligman + * @since 1.5 + */ +public interface AnnotationValue { + + /** + * Returns the value. + * The type of the returned object is one of the following: + *

  • a wrapper class for a primitive type + *
  • String + *
  • Type (representing a class literal) + *
  • FieldDoc (representing an enum constant) + *
  • AnnotationDesc + *
  • AnnotationValue[] + *
+ * + * @return the value. + */ + Object value(); + + /** + * Returns a string representation of the value. + * + * @return the text of a Java language annotation value expression + * whose value is the value of this element. + */ + String toString(); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/ClassDoc.java b/langtools/src/share/classes/com/sun/javadoc/ClassDoc.java new file mode 100644 index 00000000000..ff3a4b5becb --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/ClassDoc.java @@ -0,0 +1,340 @@ +/* + * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + + +/** + * Represents a java class or interface and provides access to + * information about the class, the class's comment and tags, and the + * members of the class. A ClassDoc only exists if it was + * processed in this run of javadoc. References to classes + * which may or may not have been processed in this run are + * referred to using Type (which can be converted to ClassDoc, + * if possible). + * + * @see Type + * + * @since 1.2 + * @author Kaiyang Liu (original) + * @author Robert Field (rewrite) + */ +public interface ClassDoc extends ProgramElementDoc, Type { + + /** + * Return true if this class is abstract. Return true + * for all interfaces. + */ + boolean isAbstract(); + + /** + * Return true if this class implements or interface extends + * java.io.Serializable. + * + * Since java.io.Externalizable extends + * java.io.Serializable, + * Externalizable objects are also Serializable. + */ + boolean isSerializable(); + + /** + * Return true if this class implements or interface extends + * java.io.Externalizable. + */ + boolean isExternalizable(); + + /** + * Return the serialization methods for this class or + * interface. + * + * @return an array of MethodDoc objects that represents + * the serialization methods for this class or interface. + */ + MethodDoc[] serializationMethods(); + + /** + * Return the Serializable fields of this class or interface. + *

+ * Return either a list of default fields documented by + * serial tag
+ * or return a single FieldDoc for + * serialPersistentField member. + * There should be a serialField tag for + * each Serializable field defined by an ObjectStreamField + * array component of serialPersistentField. + * + * @return an array of FieldDoc objects for the Serializable + * fields of this class or interface. + * + * @see #definesSerializableFields() + * @see SerialFieldTag + */ + FieldDoc[] serializableFields(); + + /** + * Return true if Serializable fields are explicitly defined with + * the special class member serialPersistentFields. + * + * @see #serializableFields() + * @see SerialFieldTag + */ + boolean definesSerializableFields(); + + /** + * Return the superclass of this class. Return null if this is an + * interface. + * + *

This method cannot accommodate certain generic type constructs. + * The superclassType method should be used instead. + * + * @return the ClassDoc for the superclass of this class, null if + * there is no superclass. + * @see #superclassType + */ + ClassDoc superclass(); + + /** + * Return the superclass of this class. Return null if this is an + * interface. A superclass is represented by either a + * ClassDoc or a ParametrizedType. + * + * @return the superclass of this class, or null if there is no superclass. + * @since 1.5 + */ + Type superclassType(); + + /** + * Test whether this class is a subclass of the specified class. + * If this is an interface, return false for all classes except + * java.lang.Object (we must keep this unexpected + * behavior for compatibility reasons). + * + * @param cd the candidate superclass. + * @return true if cd is a superclass of this class. + */ + boolean subclassOf(ClassDoc cd); + + /** + * Return interfaces implemented by this class or interfaces extended + * by this interface. Includes only directly-declared interfaces, not + * inherited interfaces. + * Return an empty array if there are no interfaces. + * + *

This method cannot accommodate certain generic type constructs. + * The interfaceTypes method should be used instead. + * + * @return an array of ClassDoc objects representing the interfaces. + * @see #interfaceTypes + */ + ClassDoc[] interfaces(); + + /** + * Return interfaces implemented by this class or interfaces extended + * by this interface. Includes only directly-declared interfaces, not + * inherited interfaces. + * Return an empty array if there are no interfaces. + * + * @return an array of interfaces, each represented by a + * ClassDoc or a ParametrizedType. + * @since 1.5 + */ + Type[] interfaceTypes(); + + /** + * Return the formal type parameters of this class or interface. + * Return an empty array if there are none. + * + * @return the formal type parameters of this class or interface. + * @since 1.5 + */ + TypeVariable[] typeParameters(); + + /** + * Return the type parameter tags of this class or interface. + * Return an empty array if there are none. + * + * @return the type parameter tags of this class or interface. + * @since 1.5 + */ + ParamTag[] typeParamTags(); + + /** + * Return + * included + * fields in this class or interface. + * Excludes enum constants if this is an enum type. + * + * @return an array of FieldDoc objects representing the included + * fields in this class or interface. + */ + FieldDoc[] fields(); + + /** + * Return fields in this class or interface, filtered to the specified + * access + * modifier option. + * Excludes enum constants if this is an enum type. + * + * @param filter Specify true to filter according to the specified access + * modifier option. + * Specify false to include all fields regardless of + * access modifier option. + * @return an array of FieldDoc objects representing the included + * fields in this class or interface. + */ + FieldDoc[] fields(boolean filter); + + /** + * Return the enum constants if this is an enum type. + * Return an empty array if there are no enum constants, or if + * this is not an enum type. + * + * @return the enum constants if this is an enum type. + */ + FieldDoc[] enumConstants(); + + /** + * Return + * included + * methods in this class or interface. + * Same as methods(true). + * + * @return an array of MethodDoc objects representing the included + * methods in this class or interface. Does not include + * constructors or annotation type elements. + */ + MethodDoc[] methods(); + + /** + * Return methods in this class or interface, filtered to the specified + * access + * modifier option. Does not include constructors or annotation + * type elements. + * + * @param filter Specify true to filter according to the specified access + * modifier option. + * Specify false to include all methods regardless of + * access modifier option. + * @return an array of MethodDoc objects representing the included + * methods in this class or interface. + */ + MethodDoc[] methods(boolean filter); + + /** + * Return + * included + * constructors in this class. An array containing the default + * no-arg constructor is returned if no other constructors exist. + * Return empty array if this is an interface. + * + * @return an array of ConstructorDoc objects representing the included + * constructors in this class. + */ + ConstructorDoc[] constructors(); + + /** + * Return constructors in this class, filtered to the specified + * access + * modifier option. Return an array containing the default + * no-arg constructor if no other constructors exist. + * + * @param filter Specify true to filter according to the specified access + * modifier option. + * Specify false to include all constructors regardless of + * access modifier option. + * @return an array of ConstructorDoc objects representing the included + * constructors in this class. + */ + ConstructorDoc[] constructors(boolean filter); + + + /** + * Return + * included + * nested classes and interfaces within this class or interface. + * This includes both static and non-static nested classes. + * (This method should have been named nestedClasses(), + * as inner classes are technically non-static.) Anonymous and local classes + * or interfaces are not included. + * + * @return an array of ClassDoc objects representing the included classes + * and interfaces defined in this class or interface. + */ + ClassDoc[] innerClasses(); + + /** + * Return nested classes and interfaces within this class or interface + * filtered to the specified + * access + * modifier option. + * This includes both static and non-static nested classes. + * Anonymous and local classes are not included. + * + * @param filter Specify true to filter according to the specified access + * modifier option. + * Specify false to include all nested classes regardless of + * access modifier option. + * @return a filtered array of ClassDoc objects representing the included + * classes and interfaces defined in this class or interface. + */ + ClassDoc[] innerClasses(boolean filter); + + /** + * Find the specified class or interface within the context of this class doc. + * Search order: 1) qualified name, 2) nested in this class or interface, + * 3) in this package, 4) in the class imports, 5) in the package imports. + * Return the ClassDoc if found, null if not found. + */ + ClassDoc findClass(String className); + + /** + * Get the list of classes and interfaces declared as imported. + * These are called "single-type-import declarations" in the + * Java Language Specification. + * + * @return an array of ClassDoc representing the imported classes. + * + * @deprecated Import declarations are implementation details that + * should not be exposed here. In addition, not all imported + * classes are imported through single-type-import declarations. + */ + @Deprecated + ClassDoc[] importedClasses(); + + /** + * Get the list of packages declared as imported. + * These are called "type-import-on-demand declarations" in the + * Java Language Specification. + * + * @return an array of PackageDoc representing the imported packages. + * + * @deprecated Import declarations are implementation details that + * should not be exposed here. In addition, this method's + * return type does not allow for all type-import-on-demand + * declarations to be returned. + */ + @Deprecated + PackageDoc[] importedPackages(); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/ConstructorDoc.java b/langtools/src/share/classes/com/sun/javadoc/ConstructorDoc.java new file mode 100644 index 00000000000..6d815ed633a --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/ConstructorDoc.java @@ -0,0 +1,35 @@ +/* + * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + +/** + * Represents a constructor of a java class. + * + * @since 1.2 + * @author Robert Field + */ +public interface ConstructorDoc extends ExecutableMemberDoc { +} diff --git a/langtools/src/share/classes/com/sun/javadoc/Doc.java b/langtools/src/share/classes/com/sun/javadoc/Doc.java new file mode 100644 index 00000000000..936659ebb05 --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/Doc.java @@ -0,0 +1,265 @@ +/* + * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + +import java.text.BreakIterator; +import java.util.Locale; + +/** + * Represents Java language constructs (package, class, constructor, + * method, field) which have comments and have been processed by this + * run of javadoc. All Doc objects are unique, that is, they + * are == comparable. + * + * @since 1.2 + * @author Robert Field + * @author Scott Seligman (generics, enums, annotations) + */ +public interface Doc extends Comparable { + + /** + * Return the text of the comment for this doc item. + * Tags have been removed. + */ + String commentText(); + + /** + * Return all tags in this Doc item. + * + * @return an array of {@link Tag} objects containing all tags on + * this Doc item. + */ + Tag[] tags(); + + /** + * Return tags of the specified {@linkplain Tag#kind() kind} in + * this Doc item. + * + * For example, if 'tagname' has value "@serial", all tags in + * this Doc item of kind "@serial" will be returned. + * + * @param tagname name of the tag kind to search for. + * @return an array of Tag containing all tags whose 'kind()' + * matches 'tagname'. + */ + Tag[] tags(String tagname); + + /** + * Return the see also tags in this Doc item. + * + * @return an array of SeeTag containing all @see tags. + */ + SeeTag[] seeTags(); + + /** + * Return comment as an array of tags. Includes inline tags + * (i.e. {@link reference} tags) but not + * block tags. + * Each section of plain text is represented as a {@link Tag} + * of {@linkplain Tag#kind() kind} "Text". + * Inline tags are represented as a {@link SeeTag} of kind "@see" + * and name "@link". + * + * @return an array of {@link Tag}s representing the comment + */ + Tag[] inlineTags(); + + /** + * Return the first sentence of the comment as an array of tags. + * Includes inline tags + * (i.e. {@link reference} tags) but not + * block tags. + * Each section of plain text is represented as a {@link Tag} + * of {@linkplain Tag#kind() kind} "Text". + * Inline tags are represented as a {@link SeeTag} of kind "@see" + * and name "@link". + *

+ * If the locale is English language, the first sentence is + * determined by the rules described in the Java Language + * Specification (first version): "This sentence ends + * at the first period that is followed by a blank, tab, or + * line terminator or at the first tagline.", in + * addition a line will be terminated by block + * HTML tags: <p> </p> <h1> + * <h2> <h3> <h4> <h5> <h6> + * <hr> <pre> or </pre>. + * If the locale is not English, the sentence end will be + * determined by + * {@link BreakIterator#getSentenceInstance(Locale)}. + + * @return an array of {@link Tag}s representing the + * first sentence of the comment + */ + Tag[] firstSentenceTags(); + + /** + * Return the full unprocessed text of the comment. Tags + * are included as text. Used mainly for store and retrieve + * operations like internalization. + */ + String getRawCommentText(); + + /** + * Set the full unprocessed text of the comment. Tags + * are included as text. Used mainly for store and retrieve + * operations like internalization. + */ + void setRawCommentText(String rawDocumentation); + + /** + * Returns the non-qualified name of this Doc item. + * + * @return the name + */ + String name(); + + /** + * Compares this doc object with the specified object for order. Returns a + * negative integer, zero, or a positive integer as this doc object is less + * than, equal to, or greater than the given object. + *

+ * This method satisfies the {@link java.lang.Comparable} interface. + * + * @param obj the Object to be compared. + * @return a negative integer, zero, or a positive integer as this Object + * is less than, equal to, or greater than the given Object. + * @exception ClassCastException the specified Object's type prevents it + * from being compared to this Object. + */ + int compareTo(Object obj); + + /** + * Is this Doc item a field (but not an enum constant)? + * + * @return true if it represents a field + */ + boolean isField(); + + /** + * Is this Doc item an enum constant? + * + * @return true if it represents an enum constant + * @since 1.5 + */ + boolean isEnumConstant(); + + /** + * Is this Doc item a constructor? + * + * @return true if it represents a constructor + */ + boolean isConstructor(); + + /** + * Is this Doc item a method (but not a constructor or annotation + * type element)? + * + * @return true if it represents a method + */ + boolean isMethod(); + + /** + * Is this Doc item an annotation type element? + * + * @return true if it represents an annotation type element + * @since 1.5 + */ + boolean isAnnotationTypeElement(); + + /** + * Is this Doc item an interface (but not an annotation type)? + * + * @return true if it represents an interface + */ + boolean isInterface(); + + /** + * Is this Doc item an exception class? + * + * @return true if it represents an exception + */ + boolean isException(); + + /** + * Is this Doc item an error class? + * + * @return true if it represents a error + */ + boolean isError(); + + /** + * Is this Doc item an enum type? + * + * @return true if it represents an enum type + * @since 1.5 + */ + boolean isEnum(); + + /** + * Is this Doc item an annotation type? + * + * @return true if it represents an annotation type + * @since 1.5 + */ + boolean isAnnotationType(); + + /** + * Is this Doc item an + * ordinary + * class? + * (i.e. not an interface, annotation type, enum, exception, or error)? + * + * @return true if it represents an ordinary class + */ + boolean isOrdinaryClass(); + + /** + * Is this Doc item a + * class + * (and not an interface or annotation type)? + * This includes ordinary classes, enums, errors and exceptions. + * + * @return true if it represents a class + */ + boolean isClass(); + + /** + * Return true if this Doc item is + * included + * in the result set. + */ + boolean isIncluded(); + + /** + * Return the source position of the first line of the + * corresponding declaration, or null if + * no position is available. A default constructor returns + * null because it has no location in the source file. + * + * @since 1.4 + */ + SourcePosition position(); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/DocErrorReporter.java b/langtools/src/share/classes/com/sun/javadoc/DocErrorReporter.java new file mode 100644 index 00000000000..ce6b39aef13 --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/DocErrorReporter.java @@ -0,0 +1,83 @@ +/* + * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + +/** + * This interface provides error, warning and notice printing. + * + * @since 1.2 + * @author Robert Field + */ +public interface DocErrorReporter { + + /** + * Print error message and increment error count. + * + * @param msg message to print + */ + void printError(String msg); + + /** + * Print an error message and increment error count. + * + * @param pos the position item where the error occurs + * @param msg message to print + * @since 1.4 + */ + void printError(SourcePosition pos, String msg); + + /** + * Print warning message and increment warning count. + * + * @param msg message to print + */ + void printWarning(String msg); + + /** + * Print warning message and increment warning count. + * + * @param pos the position item where the warning occurs + * @param msg message to print + * @since 1.4 + */ + void printWarning(SourcePosition pos, String msg); + + /** + * Print a message. + * + * @param msg message to print + */ + void printNotice(String msg); + + /** + * Print a message. + * + * @param pos the position item where the message occurs + * @param msg message to print + * @since 1.4 + */ + void printNotice(SourcePosition pos, String msg); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/Doclet.java b/langtools/src/share/classes/com/sun/javadoc/Doclet.java new file mode 100644 index 00000000000..4f763027cb5 --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/Doclet.java @@ -0,0 +1,111 @@ +/* + * Copyright 1997-2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + +/** + * This is an example of a starting class for a doclet, + * showing the entry-point methods. A starting class must + * import com.sun.javadoc.* and implement the + * start(RootDoc) method, as described in the + * package + * description. If the doclet takes command line options, + * it must also implement optionLength and + * validOptions. + * + *

A doclet supporting the language features added since 1.1 + * (such as generics and annotations) should indicate this + * by implementing languageVersion. In the absence of + * this the doclet should not invoke any of the Doclet API methods + * added since 1.5, and + * the results of several other methods are modified so as + * to conceal the new constructs (such as type parameters) from + * the doclet. + * + *

To start the doclet, pass + * -doclet followed by the fully-qualified + * name of the starting class on the javadoc tool command line. + */ +public abstract class Doclet { + + /** + * Generate documentation here. + * This method is required for all doclets. + * + * @return true on success. + */ + public static boolean start(RootDoc root) { + return true; + } + + /** + * Check for doclet-added options. Returns the number of + * arguments you must specify on the command line for the + * given option. For example, "-d docs" would return 2. + *

+ * This method is required if the doclet contains any options. + * If this method is missing, Javadoc will print an invalid flag + * error for every option. + * + * @return number of arguments on the command line for an option + * including the option name itself. Zero return means + * option not known. Negative value means error occurred. + */ + public static int optionLength(String option) { + return 0; // default is option unknown + } + + /** + * Check that options have the correct arguments. + *

+ * This method is not required, but is recommended, + * as every option will be considered valid if this method + * is not present. It will default gracefully (to true) + * if absent. + *

+ * Printing option related error messages (using the provided + * DocErrorReporter) is the responsibility of this method. + * + * @return true if the options are valid. + */ + public static boolean validOptions(String options[][], + DocErrorReporter reporter) { + return true; // default is options are valid + } + + /** + * Return the version of the Java Programming Language supported + * by this doclet. + *

+ * This method is required by any doclet supporting a language version + * newer than 1.1. + * + * @return the language version supported by this doclet. + * @since 1.5 + */ + public static LanguageVersion languageVersion() { + return LanguageVersion.JAVA_1_1; + } +} diff --git a/langtools/src/share/classes/com/sun/javadoc/ExecutableMemberDoc.java b/langtools/src/share/classes/com/sun/javadoc/ExecutableMemberDoc.java new file mode 100644 index 00000000000..b83b6f14a27 --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/ExecutableMemberDoc.java @@ -0,0 +1,140 @@ +/* + * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + +/** + * Represents a method or constructor of a java class. + * + * @since 1.2 + * @author Robert Field + */ +public interface ExecutableMemberDoc extends MemberDoc { + + /** + * Return exceptions this method or constructor throws. + * If the type of the exception is a type variable, return the + * ClassDoc of its erasure. + * + *

The thrownExceptions method cannot + * accommodate certain generic type constructs. The + * thrownExceptionTypes method should be used + * instead. + * + * @return an array of ClassDoc[] representing the exceptions + * thrown by this method. + * @see #thrownExceptionTypes + */ + ClassDoc[] thrownExceptions(); + + /** + * Return exceptions this method or constructor throws. + * + * @return an array representing the exceptions thrown by this method. + * Each array element is either a ClassDoc or a + * TypeVariable. + * @since 1.5 + */ + Type[] thrownExceptionTypes(); + + /** + * Return true if this method is native + */ + boolean isNative(); + + /** + * Return true if this method is synchronized + */ + boolean isSynchronized(); + + /** + * Return true if this method was declared to take a variable number + * of arguments. + * + * @since 1.5 + */ + public boolean isVarArgs(); + + /** + * Get argument information. + * + * @see Parameter + * + * @return an array of Parameter, one element per argument + * in the order the arguments are present. + */ + Parameter[] parameters(); + + /** + * Return the throws tags in this method. + * + * @return an array of ThrowTag containing all @exception + * and @throws tags. + */ + ThrowsTag[] throwsTags(); + + /** + * Return the param tags in this method, excluding the type + * parameter tags. + * + * @return an array of ParamTag containing all @param tags + * corresponding to the parameters of this method. + */ + ParamTag[] paramTags(); + + /** + * Return the type parameter tags in this method. + * + * @return an array of ParamTag containing all @param tags + * corresponding to the type parameters of this method. + * @since 1.5 + */ + ParamTag[] typeParamTags(); + + /** + * Get the signature. It is the parameter list, type is qualified. + * For instance, for a method mymethod(String x, int y), + * it will return (java.lang.String,int). + */ + String signature(); + + /** + * get flat signature. all types are not qualified. + * return a String, which is the flat signiture of this member. + * It is the parameter list, type is not qualified. + * For instance, for a method mymethod(String x, int y), + * it will return (String, int). + */ + String flatSignature(); + + /** + * Return the formal type parameters of this method or constructor. + * Return an empty array if this method or constructor is not generic. + * + * @return the formal type parameters of this method or constructor. + * @since 1.5 + */ + TypeVariable[] typeParameters(); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/FieldDoc.java b/langtools/src/share/classes/com/sun/javadoc/FieldDoc.java new file mode 100644 index 00000000000..cdd9d26d3d1 --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/FieldDoc.java @@ -0,0 +1,79 @@ +/* + * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + +/** + * Represents a field in a java class. + * + * @see MemberDoc + * + * @since 1.2 + * @author Robert Field + */ +public interface FieldDoc extends MemberDoc { + + /** + * Get type of this field. + */ + Type type(); + + /** + * Return true if this field is transient + */ + boolean isTransient(); + + /** + * Return true if this field is volatile + */ + boolean isVolatile(); + + /** + * Return the serialField tags in this FieldDoc item. + * + * @return an array of SerialFieldTag objects containing + * all @serialField tags. + */ + SerialFieldTag[] serialFieldTags(); + + /** + * Get the value of a constant field. + * + * @return the value of a constant field. The value is + * automatically wrapped in an object if it has a primitive type. + * If the field is not constant, returns null. + */ + Object constantValue(); + + /** + * Get the value of a constant field. + * + * @return the text of a Java language expression whose value + * is the value of the constant. The expression uses no identifiers + * other than primitive literals. If the field is + * not constant, returns null. + */ + String constantValueExpression(); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/LanguageVersion.java b/langtools/src/share/classes/com/sun/javadoc/LanguageVersion.java new file mode 100644 index 00000000000..4098c06f62c --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/LanguageVersion.java @@ -0,0 +1,47 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + + +/** + * Java Programming Language version. The constants of this enum + * identify the JDK and J2SE releases containing language changes + * relevant to doclets. + *

+ * All doclets support at least the 1.1 language version. + * The first release subsequent to this with language changes + * affecting doclets is 1.5. + * + * @since 1.5 + */ +public enum LanguageVersion { + + /** 1.1 added nested classes and interfaces. */ + JAVA_1_1, + + /** 1.5 added generic types, annotations, enums, and varArgs. */ + JAVA_1_5 +} diff --git a/langtools/src/share/classes/com/sun/javadoc/MemberDoc.java b/langtools/src/share/classes/com/sun/javadoc/MemberDoc.java new file mode 100644 index 00000000000..45d6eba727a --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/MemberDoc.java @@ -0,0 +1,47 @@ +/* + * Copyright 1998 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + +/** + * Represents a member of a java class: field, constructor, or method. + * This is an abstract class dealing with information common to + * method, constructor and field members. Class members of a class + * (innerclasses) are represented instead by ClassDoc. + * + * @see MethodDoc + * @see FieldDoc + * @see ClassDoc + * + * @author Kaiyang Liu (original) + * @author Robert Field (rewrite) + */ +public interface MemberDoc extends ProgramElementDoc { + + /** + * Returns true if this member was synthesized by the compiler. + */ + boolean isSynthetic(); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/MethodDoc.java b/langtools/src/share/classes/com/sun/javadoc/MethodDoc.java new file mode 100644 index 00000000000..122ac747ad5 --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/MethodDoc.java @@ -0,0 +1,94 @@ +/* + * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + +/** + * Represents a method of a java class. + * + * @since 1.2 + * @author Robert Field + */ +public interface MethodDoc extends ExecutableMemberDoc { + + /** + * Return true if this method is abstract + */ + boolean isAbstract(); + + /** + * Get return type. + * + * @return the return type of this method, null if it + * is a constructor. + */ + Type returnType(); + + /** + * Return the class containing the method that this method overrides. + * + *

The overriddenClass method cannot + * accommodate certain generic type constructs. The + * overriddenType method should be used instead. + * + * @return a ClassDoc representing the superclass + * defining a method that this method overrides, or null if + * this method does not override. + */ + ClassDoc overriddenClass(); + + /** + * Return the type containing the method that this method overrides. + * It may be a ClassDoc or a ParameterizedType. + * + * @return the supertype whose method is overridden, or null if this + * method does not override another in a superclass + * @since 1.5 + */ + Type overriddenType(); + + /** + * Return the method that this method overrides. + * + * @return a MethodDoc representing a method definition + * in a superclass this method overrides, null if + * this method does not override. + */ + MethodDoc overriddenMethod(); + + /** + * Tests whether this method overrides another. + * The overridden method may be one declared in a superclass or + * a superinterface (unlike {@link #overriddenMethod()}). + * + *

When a non-abstract method overrides an abstract one, it is + * also said to implement the other. + * + * @param meth the other method to examine + * @return true if this method overrides the other + * @since 1.5 + */ + boolean overrides(MethodDoc meth); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/PackageDoc.java b/langtools/src/share/classes/com/sun/javadoc/PackageDoc.java new file mode 100644 index 00000000000..5f532a76daf --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/PackageDoc.java @@ -0,0 +1,129 @@ +/* + * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + +/** + * Represents a java package. Provides access to information + * about the package, the package's comment and tags, and the + * classes in the package. + *

+ * Each method whose return type is an array will return an empty + * array (never null) when there are no objects in the result. + * + * @since 1.2 + * @author Kaiyang Liu (original) + * @author Robert Field (rewrite) + */ +public interface PackageDoc extends Doc { + + /** + * Get all classes and interfaces in the package, filtered to the specified + * access + * modifier option. + * + * @return filtered classes and interfaces in this package + * @param filter Specifying true filters according to the specified access + * modifier option. + * Specifying false includes all classes and interfaces + * regardless of access modifier option. + * @since 1.4 + */ + ClassDoc[] allClasses(boolean filter); + + /** + * Get all + * included + * classes and interfaces in the package. Same as allClasses(true). + * + * @return all included classes and interfaces in this package. + */ + ClassDoc[] allClasses(); + + /** + * Get included + * ordinary + * classes (that is, exclude exceptions, errors, enums, interfaces, and + * annotation types) + * in this package. + * + * @return included ordinary classes in this package. + */ + ClassDoc[] ordinaryClasses(); + + /** + * Get included Exception classes in this package. + * + * @return included Exceptions in this package. + */ + ClassDoc[] exceptions(); + + /** + * Get included Error classes in this package. + * + * @return included Errors in this package. + */ + ClassDoc[] errors(); + + /** + * Get included enum types in this package. + * + * @return included enum types in this package. + * @since 1.5 + */ + ClassDoc[] enums(); + + /** + * Get included interfaces in this package, omitting annotation types. + * + * @return included interfaces in this package. + */ + ClassDoc[] interfaces(); + + /** + * Get included annotation types in this package. + * + * @return included annotation types in this package. + * @since 1.5 + */ + AnnotationTypeDoc[] annotationTypes(); + + /** + * Get the annotations of this package. + * Return an empty array if there are none. + * + * @return the annotations of this package. + * @since 1.5 + */ + AnnotationDesc[] annotations(); + + /** + * Lookup a class or interface within this package. + * + * @return ClassDoc of found class or interface, + * or null if not found. + */ + ClassDoc findClass(String className); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/ParamTag.java b/langtools/src/share/classes/com/sun/javadoc/ParamTag.java new file mode 100644 index 00000000000..797e75b4e6a --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/ParamTag.java @@ -0,0 +1,67 @@ +/* + * Copyright 1998-2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + +/** + * Represents an @param documentation tag. + * Stores the name and comment parts of the parameter tag. + * An @param tag may represent either a method or constructor parameter, + * or a type parameter. + * + * @author Robert Field + * + */ +public interface ParamTag extends Tag { + + /** + * Return the name of the parameter or type parameter + * associated with this ParamTag. + * The angle brackets delimiting a type parameter are not part of + * its name. + * + * @return the parameter name. + */ + String parameterName(); + + /** + * Return the parameter comment + * associated with this ParamTag. + * + * @return the parameter comment. + */ + String parameterComment(); + + /** + * Return true if this ParamTag corresponds to a type + * parameter. Return false if it corresponds to an ordinary parameter + * of a method or constructor. + * + * @return true if this ParamTag corresponds to a type + * parameter. + * @since 1.5 + */ + boolean isTypeParameter(); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/Parameter.java b/langtools/src/share/classes/com/sun/javadoc/Parameter.java new file mode 100644 index 00000000000..58b18d9e050 --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/Parameter.java @@ -0,0 +1,74 @@ +/* + * Copyright 1998-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + +/** + * Parameter information. + * This includes a parameter type and parameter name. + * + * @author Robert Field + */ +public interface Parameter { + + /** + * Get the type of this parameter. + */ + Type type(); + + /** + * Get local name of this parameter. + * For example if parameter is the short 'index', returns "index". + */ + String name(); + + /** + * Get type name of this parameter. + * For example if parameter is the short 'index', returns "short". + *

+ * This method returns a complete string + * representation of the type, including the dimensions of arrays and + * the type arguments of parameterized types. Names are qualified. + */ + String typeName(); + + /** + * Returns a string representation of the parameter. + *

+ * For example if parameter is the short 'index', returns "short index". + * + * @return type and parameter name of this parameter. + */ + String toString(); + + /** + * Get the annotations of this parameter. + * Return an empty array if there are none. + * + * @return the annotations of this parameter. + * @since 1.5 + */ + AnnotationDesc[] annotations(); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/ParameterizedType.java b/langtools/src/share/classes/com/sun/javadoc/ParameterizedType.java new file mode 100644 index 00000000000..7eee3fe7ea6 --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/ParameterizedType.java @@ -0,0 +1,108 @@ +/* + * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + + +/** + * Represents an invocation of a generic class or interface. For example, + * given the generic interface {@code List}, possible invocations + * include: + *

+ *      {@code List}
+ *      {@code List}
+ *      {@code List}
+ * 
+ * A generic inner class {@code Outer.Inner} might be invoked as: + *
+ *      {@code Outer.Inner}
+ * 
+ * + * @author Scott Seligman + * @since 1.5 + */ +public interface ParameterizedType extends Type { + + /** + * Return the generic class or interface that declared this type. + * + * @return the generic class or interface that declared this type. + */ + ClassDoc asClassDoc(); + + /** + * Return the actual type arguments of this type. + * For a generic type that is nested within some other generic type + * (such as {@code Outer.Inner}), + * only the type arguments of the innermost type are included. + * + * @return the actual type arguments of this type. + */ + Type[] typeArguments(); + + /** + * Return the class type that is a direct supertype of this one. + * This is the superclass of this type's declaring class, + * with type arguments substituted in. + * Return null if this is an interface type. + * + *

For example, if this parameterized type is + * {@code java.util.ArrayList}, the result will be + * {@code java.util.AbstractList}. + * + * @return the class type that is a direct supertype of this one. + */ + Type superclassType(); + + /** + * Return the interface types directly implemented by or extended by this + * parameterized type. + * These are the interfaces directly implemented or extended + * by this type's declaring class or interface, + * with type arguments substituted in. + * Return an empty array if there are no interfaces. + * + *

For example, the interface extended by + * {@code java.util.Set} is {@code java.util.Collection}. + * + * @return the interface types directly implemented by or extended by this + * parameterized type. + */ + Type[] interfaceTypes(); + + /** + * Return the type that contains this type as a member. + * Return null is this is a top-level type. + * + *

For example, the containing type of + * {@code AnInterface.Nested} is the ClassDoc + * representing {@code AnInterface}, and the containing type of + * {@code Outer.Inner} is the + * ParameterizedType representing {@code Outer}. + * + * @return the type that contains this type as a member. + */ + Type containingType(); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/ProgramElementDoc.java b/langtools/src/share/classes/com/sun/javadoc/ProgramElementDoc.java new file mode 100644 index 00000000000..87e6597cf6a --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/ProgramElementDoc.java @@ -0,0 +1,125 @@ +/* + * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + +/** + * Represents a java program element: class, interface, field, + * constructor, or method. + * This is an abstract class dealing with information common to + * these elements. + * + * @see MemberDoc + * @see ClassDoc + * + * @author Robert Field + */ +public interface ProgramElementDoc extends Doc { + + /** + * Get the containing class or interface of this program element. + * + * @return a ClassDoc for this element's containing class or interface. + * If this is a top-level class or interface, return null. + */ + ClassDoc containingClass(); + + /** + * Get the package that this program element is contained in. + * + * @return a PackageDoc for this element containing package. + * If in the unnamed package, this PackageDoc will have the + * name "". + */ + PackageDoc containingPackage(); + + /** + * Get the fully qualified name of this program element. + * For example, for the class java.util.Hashtable, + * return "java.util.Hashtable". + *

+ * For the method bar() in class Foo + * in the unnamed package, return "Foo.bar". + * + * @return the qualified name of the program element as a String. + */ + String qualifiedName(); + + /** + * Get the modifier specifier integer. + * + * @see java.lang.reflect.Modifier + */ + int modifierSpecifier(); + + /** + * Get modifiers string. + * For example, for: + *

+     *   public abstract int foo() { ... }
+     * 
+ * return "public abstract". + * Annotations are not included. + */ + String modifiers(); + + /** + * Get the annotations of this program element. + * Return an empty array if there are none. + * + * @return the annotations of this program element. + * @since 1.5 + */ + AnnotationDesc[] annotations(); + + /** + * Return true if this program element is public. + */ + boolean isPublic(); + + /** + * Return true if this program element is protected. + */ + boolean isProtected(); + + /** + * Return true if this program element is private. + */ + boolean isPrivate(); + + /** + * Return true if this program element is package private. + */ + boolean isPackagePrivate(); + /** + * Return true if this program element is static. + */ + boolean isStatic(); + + /** + * Return true if this program element is final. + */ + boolean isFinal(); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/RootDoc.java b/langtools/src/share/classes/com/sun/javadoc/RootDoc.java new file mode 100644 index 00000000000..b54cd72a3c7 --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/RootDoc.java @@ -0,0 +1,109 @@ +/* + * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + +/** + * Represents the root of the program structure information + * for one run of javadoc. From this root all other program + * structure information can be extracted. + * Also represents the command line information -- the + * packages, classes and options specified by the user. + * + * @since 1.2 + * @author Robert Field + */ +public interface RootDoc extends Doc, DocErrorReporter { + + /** + * Command line options. + *

+ * For example, given: + *

+     *     javadoc -foo this that -bar other ...
+ * + * this method will return: + *
+     *      options()[0][0] = "-foo"
+     *      options()[0][1] = "this"
+     *      options()[0][2] = "that"
+     *      options()[1][0] = "-bar"
+     *      options()[1][1] = "other"
+ * + * @return an array of arrays of String. + */ + String[][] options(); + + /** + * Return the packages + * specified + * on the command line. + * If -subpackages and -exclude options + * are used, return all the non-excluded packages. + * + * @return packages specified on the command line. + */ + PackageDoc[] specifiedPackages(); + + /** + * Return the classes and interfaces + * specified + * as source file names on the command line. + * + * @return classes and interfaces specified on the command line. + */ + ClassDoc[] specifiedClasses(); + + /** + * Return the + * included + classes and interfaces in all packages. + * + * @return included classes and interfaces in all packages. + */ + ClassDoc[] classes(); + + /** + * Return a PackageDoc for the specified package name. + * + * @param name package name + * + * @return a PackageDoc holding the specified package, null if + * this package is not referenced. + */ + PackageDoc packageNamed(String name); + + /** + * Return a ClassDoc for the specified class or interface name. + * + * @param qualifiedName + * qualified + * class or package name + * + * @return a ClassDoc holding the specified class, null if + * this class is not referenced. + */ + ClassDoc classNamed(String qualifiedName); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/SeeTag.java b/langtools/src/share/classes/com/sun/javadoc/SeeTag.java new file mode 100644 index 00000000000..be9a492c6d8 --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/SeeTag.java @@ -0,0 +1,126 @@ +/* + * Copyright 1998-2002 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + +/** + * Represents a user-defined cross-reference to related documentation. + * The tag can reference a package, class or member, or can hold + * plain text. (The plain text might be a reference + * to something not online, such as a printed book, or be a hard-coded + * HTML link.) The reference can either be inline with the comment, + * using {@link}, or a separate block comment, + * using @see. + * Method name() returns "@link" (no curly braces) or + * "@see", depending on the tag. + * Method kind() returns "@see" for both tags. + * + * @author Kaiyang Liu (original) + * @author Robert Field (rewrite) + * @author Atul M Dambalkar + * + */ +public interface SeeTag extends Tag { + + /** + * Get the label of the @see tag. + * Return null if no label is present. + * For example, for: + *

+ *   @see String#trim() the trim method + *

+ * return "the trim method". + */ + String label(); + + /** + * Get the package doc when @see references only a package. + * Return null if the package cannot be found, or if + * @see references any other element (class, + * interface, field, constructor, method) or non-element. + * For example, for: + *

+ *   @see java.lang + *

+ * return the PackageDoc for java.lang. + */ + public PackageDoc referencedPackage(); + + /** + * Get the class or interface name of the @see reference. + * The name is fully qualified if the name specified in the + * original @see tag was fully qualified, or if the class + * or interface can be found; otherwise it is unqualified. + * If @see references only a package name, then return + * the package name instead. + * For example, for: + *

+ *   @see String#valueOf(java.lang.Object) + *

+ * return "java.lang.String". + * For "@see java.lang", return "java.lang". + * Return null if @see references a non-element, such as + * @see <a href="java.sun.com">. + */ + String referencedClassName(); + + /** + * Get the class doc referenced by the class name part of @see. + * Return null if the class cannot be found. + * For example, for: + *

+ *   @see String#valueOf(java.lang.Object) + *

+ * return the ClassDoc for java.lang.String. + */ + ClassDoc referencedClass(); + + /** + * Get the field, constructor or method substring of the @see + * reference. Return null if the reference is to any other + * element or to any non-element. + * References to member classes (nested classes) return null. + * For example, for: + *

+ *   @see String#startsWith(String) + *

+ * return "startsWith(String)". + */ + String referencedMemberName(); + + /** + * Get the member doc for the field, constructor or method + * referenced by @see. Return null if the member cannot + * be found or if the reference is to any other element or to any + * non-element. + * References to member classes (nested classes) return null. + * For example, for: + *

+ *   @see String#startsWith(java.lang.String) + *

+ * return the MethodDoc for startsWith. + */ + MemberDoc referencedMember(); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/SerialFieldTag.java b/langtools/src/share/classes/com/sun/javadoc/SerialFieldTag.java new file mode 100644 index 00000000000..2222d90773c --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/SerialFieldTag.java @@ -0,0 +1,87 @@ +/* + * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + +/** + * Documents a Serializable field defined by an ObjectStreamField. + *
+ * The class parses and stores the three serialField tag parameters:
+ *
+ * - field name
+ * - field type name
+ *      (fully-qualified or visible from the current import context)
+ * - description of the valid values for the field
+
+ * 
+ * This tag is only allowed in the javadoc for the special member + * serialPersistentFields. + * + * @author Joe Fialli + * + * @see java.io.ObjectStreamField + */ +public interface SerialFieldTag extends Tag, Comparable { + + /** + * Return the serialziable field name. + */ + public String fieldName(); + + /** + * Return the field type string. + */ + public String fieldType(); + + /** + * Return the ClassDoc for field type. + * + * @return null if no ClassDoc for field type is visible from + * containingClass context. + */ + public ClassDoc fieldTypeDoc(); + + /** + * Return the field comment. If there is no serialField comment, return + * javadoc comment of corresponding FieldDoc. + */ + public String description(); + + /** + * Compares this Object with the specified Object for order. Returns a + * negative integer, zero, or a positive integer as this Object is less + * than, equal to, or greater than the given Object. + *

+ * Included to make SerialFieldTag items java.lang.Comparable. + * + * @param obj the Object to be compared. + * @return a negative integer, zero, or a positive integer as this Object + * is less than, equal to, or greater than the given Object. + * @exception ClassCastException the specified Object's type prevents it + * from being compared to this Object. + * @since 1.2 + */ + public int compareTo(Object obj); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/SourcePosition.java b/langtools/src/share/classes/com/sun/javadoc/SourcePosition.java new file mode 100644 index 00000000000..a59b5e63a38 --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/SourcePosition.java @@ -0,0 +1,55 @@ +/* + * Copyright 2001-2002 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + +import java.io.File; + +/** + * This interface describes a source position: filename, line number, + * and column number. + * + * @since 1.4 + * @author Neal M Gafter + */ +public interface SourcePosition { + /** The source file. Returns null if no file information is + * available. */ + File file(); + + /** The line in the source file. The first line is numbered 1; + * 0 means no line number information is available. */ + int line(); + + /** The column in the source file. The first column is + * numbered 1; 0 means no column information is available. + * Columns count characters in the input stream; a tab + * advances the column number to the next 8-column tab stop. + */ + int column(); + + /** Convert the source position to the form "Filename:line". */ + String toString(); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/Tag.java b/langtools/src/share/classes/com/sun/javadoc/Tag.java new file mode 100644 index 00000000000..2a4557b8500 --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/Tag.java @@ -0,0 +1,158 @@ +/* + * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + +import java.text.BreakIterator; +import java.util.Locale; + +/** + * Represents a simple documentation tag, such as @since, @author, @version. + * Given a tag (e.g. "@since 1.2"), holds tag name (e.g. "@since") + * and tag text (e.g. "1.2"). Tags with structure or which require + * special processing are handled by subclasses such as ParamTag + * (for @param), SeeTag (for @see and {@link}), and ThrowsTag + * (for @throws). + * + * @author Robert Field + * @author Atul M Dambalkar + * @see SeeTag + * @see ParamTag + * @see ThrowsTag + * @see SerialFieldTag + * @see Doc#tags() + * + */ +public interface Tag { + + /** + * Return the name of this tag. The name is the string + * starting with "@" that is used in a doc comment, such as + * @return. For inline tags, such as + * {@link}, the curly brackets + * are not part of the name, so in this example the name + * would be simply @link. + */ + String name(); + + /** + * Return the containing {@link Doc} of this Tag element. + */ + Doc holder(); + + /** + * Return the kind of this tag. + * similar or synonymous tags. For most tags, + * kind() == name(); + * the following table lists those cases where there is more + * than one tag of a given kind: + *

+ * + * + * + * + * + * + * + * + * + *
kind() name()
@throws @throws
@throws @exception
@see @see
@see @link
@see @linkplain
@serial @serial
@serial @serialData
+ */ + String kind(); + + /** + * Return the text of this tag, that is, portion beyond tag name. + */ + String text(); + + /** + * Convert this object to a string. + */ + String toString(); + + /** + * For a documentation comment with embedded {@link} + * tags, return an array of Tag objects. The entire + * doc comment is broken down into strings separated by + * {@link} tags, where each successive element + * of the array represents either a string or + * {@link} tag, in order, from start to end. + * Each string is represented by a Tag object of + * name "Text", where {@link #text()} returns the string. Each + * {@link} tag is represented by a + * {@link SeeTag} of name "@link" and kind "@see". + * For example, given the following comment + * tag: + *

+ * This is a {@link Doc commentlabel} example. + *

+ * return an array of Tag objects: + *

    + *
  • tags[0] is a {@link Tag} with name "Text" and text consisting + * of "This is a " + *
  • tags[1] is a {@link SeeTag} with name "@link", referenced + * class Doc and label "commentlabel" + *
  • tags[2] is a {@link Tag} with name "Text" and text consisting + * of " example." + *
+ * + * @return Tag[] array of tags + * @see ParamTag + * @see ThrowsTag + */ + Tag[] inlineTags(); + + /** + * Return the first sentence of the comment as an array of tags. + * Includes inline tags + * (i.e. {@link reference} tags) but not + * block tags. + * Each section of plain text is represented as a {@link Tag} + * of kind "Text". + * Inline tags are represented as a {@link SeeTag} of kind "@link". + * If the locale is English language, the first sentence is + * determined by the rules described in the Java Language + * Specification (first version): "This sentence ends + * at the first period that is followed by a blank, tab, or + * line terminator or at the first tagline.", in + * addition a line will be terminated by paragraph and + * section terminating HTML tags: <p> </p> <h1> + * <h2> <h3> <h4> <h5> <h6> + * <hr> <pre> or </pre>. + * If the locale is not English, the sentence end will be + * determined by + * {@link BreakIterator#getSentenceInstance(Locale)}. + * + * @return an array of {@link Tag} objects representing the + * first sentence of the comment + */ + Tag[] firstSentenceTags(); + + /** + * Return the source position of this tag. + * @return the source position of this tag. + */ + public SourcePosition position(); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/ThrowsTag.java b/langtools/src/share/classes/com/sun/javadoc/ThrowsTag.java new file mode 100644 index 00000000000..b308f631c90 --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/ThrowsTag.java @@ -0,0 +1,79 @@ +/* + * Copyright 1998-2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + +/** + * Represents a @throws or @exception documentation tag. + * Parses and holds the exception name and exception comment. + * Note: @exception is a backwards compatible synonymy for @throws. + * + * @author Robert Field + * @author Atul M Dambalkar + * @see ExecutableMemberDoc#throwsTags() + * + */ +public interface ThrowsTag extends Tag { + + /** + * Return the name of the exception + * associated with this ThrowsTag. + * + * @return name of the exception. + */ + String exceptionName(); + + /** + * Return the exception comment + * associated with this ThrowsTag. + * + * @return exception comment. + */ + String exceptionComment(); + + /** + * Return a ClassDoc that represents the exception. + * If the type of the exception is a type variable, return the + * ClassDoc of its erasure. + * + *

This method cannot accommodate certain generic type + * constructs. The exceptionType method + * should be used instead. + * + * @return ClassDoc that represents the exception. + * @see #exceptionType + */ + ClassDoc exception(); + + /** + * Return the type of the exception + * associated with this ThrowsTag. + * This may be a ClassDoc or a TypeVariable. + * + * @return the type of the exception. + * @since 1.5 + */ + Type exceptionType(); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/Type.java b/langtools/src/share/classes/com/sun/javadoc/Type.java new file mode 100644 index 00000000000..1f164fa74b3 --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/Type.java @@ -0,0 +1,153 @@ +/* + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + +/** + * Represents a type. A type can be a class or interface, an + * invocation (like {@code List}) of a generic class or interface, + * a type variable, a wildcard type ("?"), + * or a primitive data type (like char). + * + * @since 1.2 + * @author Kaiyang Liu (original) + * @author Robert Field (rewrite) + * @author Scott Seligman (generics) + */ +public interface Type { + + /** + * Return unqualified name of type excluding any dimension information. + *

+ * For example, a two dimensional array of String returns + * "String". + */ + String typeName(); + + /** + * Return qualified name of type excluding any dimension information. + *

+ * For example, a two dimensional array of String + * returns "java.lang.String". + */ + String qualifiedTypeName(); + + /** + * Return the simple name of this type excluding any dimension information. + * This is the unqualified name of the type, except that for nested types + * only the identifier of the innermost type is included. + *

+ * For example, the class {@code Outer.Inner} returns + * "Inner". + * + * @since 1.5 + */ + String simpleTypeName(); + + /** + * Return the type's dimension information, as a string. + *

+ * For example, a two dimensional array of String returns + * "[][]". + */ + String dimension(); + + /** + * Return a string representation of the type. + * This includes any dimension information and type arguments. + *

+ * For example, a two dimensional array of String may return + * "java.lang.String[][]", + * and the parameterized type {@code List} may return + * "{@code java.util.List}". + * + * @return a string representation of the type. + */ + String toString(); + + /** + * Return true if this type represents a primitive type. + * + * @return true if this type represents a primitive type. + * @since 1.5 + */ + boolean isPrimitive(); + + /** + * Return this type as a ClassDoc if it represents a class + * or interface. Array dimensions are ignored. + * If this type is a ParameterizedType, + * TypeVariable, or WildcardType, return + * the ClassDoc of the type's erasure. If this is an + * AnnotationTypeDoc, return this as a ClassDoc + * (but see {@link #asAnnotationTypeDoc()}). + * If this is a primitive type, return null. + * + * @return the ClassDoc of this type, + * or null if it is a primitive type. + */ + ClassDoc asClassDoc(); + + /** + * Return this type as a ParameterizedType if it represents + * an invocation of a generic class or interface. Array dimensions + * are ignored. + * + * @return a ParameterizedType if the type is an + * invocation of a generic type, or null if it is not. + * @since 1.5 + */ + ParameterizedType asParameterizedType(); + + /** + * Return this type as a TypeVariable if it represents + * a type variable. Array dimensions are ignored. + * + * @return a TypeVariable if the type is a type variable, + * or null if it is not. + * @since 1.5 + */ + TypeVariable asTypeVariable(); + + /** + * Return this type as a WildcardType if it represents + * a wildcard type. + * + * @return a WildcardType if the type is a wildcard type, + * or null if it is not. + * @since 1.5 + */ + WildcardType asWildcardType(); + + /** + * Return this type as an AnnotationTypeDoc if it represents + * an annotation type. Array dimensions are ignored. + * + * @return an AnnotationTypeDoc if the type is an annotation + * type, or null if it is not. + * @since 1.5 + */ + AnnotationTypeDoc asAnnotationTypeDoc(); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/TypeVariable.java b/langtools/src/share/classes/com/sun/javadoc/TypeVariable.java new file mode 100644 index 00000000000..93317ed60f0 --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/TypeVariable.java @@ -0,0 +1,58 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + + +/** + * Represents a type variable. + * For example, the generic interface {@code List} has a single + * type variable {@code E}. + * A type variable may have explicit bounds, as in + * {@code C}. + * + * @author Scott Seligman + * @since 1.5 + */ +public interface TypeVariable extends Type { + + /** + * Return the bounds of this type variable. + * These are the types given by the extends clause. + * Return an empty array if there are no explicit bounds. + * + * @return the bounds of this type variable. + */ + Type[] bounds(); + + /** + * Return the class, interface, method, or constructor within + * which this type variable is declared. + * + * @return the class, interface, method, or constructor within + * which this type variable is declared. + */ + ProgramElementDoc owner(); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/WildcardType.java b/langtools/src/share/classes/com/sun/javadoc/WildcardType.java new file mode 100644 index 00000000000..fb36afd6eda --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/WildcardType.java @@ -0,0 +1,61 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.javadoc; + + +/** + * Represents a wildcard type argument. + * Examples include:

+ * {@code }
+ * {@code }
+ * {@code }
+ * 
+ * A wildcard type can have explicit extends bounds + * or explicit super bounds or neither, but not both. + * + * @author Scott Seligman + * @since 1.5 + */ +public interface WildcardType extends Type { + + /** + * Return the upper bounds of this wildcard type argument + * as given by the extends clause. + * Return an empty array if no such bounds are explicitly given. + * + * @return the extends bounds of this wildcard type argument + */ + Type[] extendsBounds(); + + /** + * Return the lower bounds of this wildcard type argument + * as given by the super clause. + * Return an empty array if no such bounds are explicitly given. + * + * @return the super bounds of this wildcard type argument + */ + Type[] superBounds(); +} diff --git a/langtools/src/share/classes/com/sun/javadoc/package.html b/langtools/src/share/classes/com/sun/javadoc/package.html new file mode 100644 index 00000000000..914c6240c72 --- /dev/null +++ b/langtools/src/share/classes/com/sun/javadoc/package.html @@ -0,0 +1,152 @@ + + +Doclet API Package + + + + +The Doclet API (also called the Javadoc API) provides a mechanism +for clients to inspect the source-level structure of programs and +libraries, including javadoc comments embedded in the source. +This is useful for documentation, program checking, automatic +code generation and many other tools. +

+ +Doclets are invoked by javadoc and use this API to write out +program information to files. For example, the standard doclet is called +by default and writes out documentation to HTML files. +

+ +The invocation is defined by the abstract {@link com.sun.javadoc.Doclet} class +-- the entry point is the {@link com.sun.javadoc.Doclet#start(RootDoc) start} method: +

+    public static boolean start(RootDoc root)
+
+The {@link com.sun.javadoc.RootDoc} instance holds the root of the program structure +information. From this root all other program structure +information can be extracted. +

+ + +

Terminology

+ + +When calling javadoc, you pass in package names and source file names -- +these are called the specified packages and classes. +You also pass in Javadoc options; the access control Javadoc options +(-public, -protected, -package, +and -private) filter program elements, producing a +result set, called the included set, or "documented" set. +(The unfiltered set is also available through +{@link com.sun.javadoc.PackageDoc#allClasses(boolean) allClasses(false)}.) +

+ + +Throughout this API, the term class is normally a +shorthand for "class or interface", as in: {@link com.sun.javadoc.ClassDoc}, +{@link com.sun.javadoc.PackageDoc#allClasses() allClasses()}, and +{@link com.sun.javadoc.PackageDoc#findClass(String) findClass(String)}. +In only a couple of other places, it means "class, as opposed to interface", +as in: {@link com.sun.javadoc.Doc#isClass()}. +In the second sense, this API calls out four kinds of classes: +{@linkplain com.sun.javadoc.Doc#isOrdinaryClass() ordinary classes}, +{@linkplain com.sun.javadoc.Doc#isEnum() enums}, +{@linkplain com.sun.javadoc.Doc#isError() errors} and +{@linkplain com.sun.javadoc.Doc#isException() exceptions}. +Throughout the API, the detailed description of each program element +describes explicitly which meaning is being used. +

+ + +A qualified class or interface name is one that has its package +name prepended to it, such as java.lang.String. A non-qualified +name has no package name, such as String. +

+ + +

Example

+ +The following is an example doclet that +displays information in the @param tags of the processed +classes: +
+import com.sun.javadoc.*;
+
+public class ListParams extends Doclet {
+
+    public static boolean start(RootDoc root) {
+        ClassDoc[] classes = root.classes();
+        for (int i = 0; i < classes.length; ++i) {
+            ClassDoc cd = classes[i];
+            printMembers(cd.constructors());
+            printMembers(cd.methods());
+        }
+        return true;
+    }
+
+    static void printMembers(ExecutableMemberDoc[] mems) {
+        for (int i = 0; i < mems.length; ++i) {
+            ParamTag[] params = mems[i].paramTags();
+            System.out.println(mems[i].qualifiedName());
+            for (int j = 0; j < params.length; ++j) {
+                System.out.println("   " + params[j].parameterName()
+                    + " - " + params[j].parameterComment());
+            }
+        }
+    }        
+}
+
+Interfaces and methods from the Javadoc API are marked in +red. +{@link com.sun.javadoc.Doclet Doclet} is an abstract class that specifies +the invocation interface for doclets, +{@link com.sun.javadoc.Doclet Doclet} holds class or interface information, +{@link com.sun.javadoc.ExecutableMemberDoc} is a +superinterface of {@link com.sun.javadoc.MethodDoc} and +{@link com.sun.javadoc.ConstructorDoc}, +and {@link com.sun.javadoc.ParamTag} holds information +from "@param" tags. +

+This doclet when invoked with a command line like: +

+    javadoc -doclet ListParams -sourcepath <source-location> java.util
+
+producing output like: +
+    ...
+    java.util.ArrayList.add
+       index - index at which the specified element is to be inserted.
+       element - element to be inserted.
+    java.util.ArrayList.remove
+       index - the index of the element to removed.
+    ...
+
+
+@see com.sun.javadoc.Doclet +@see com.sun.javadoc.RootDoc + + diff --git a/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessor.java b/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessor.java new file mode 100644 index 00000000000..591793d8e0a --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessor.java @@ -0,0 +1,64 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.apt; + + +import java.io.IOException; +import java.util.Collection; + + +/** + * An annotation processor, used to examine and process the + * annotations of program elements. An annotation processor may, + * for example, create new source files and XML documents to be used + * in conjunction with the original code. + * + *

An annotation processor is constructed by a + * {@linkplain AnnotationProcessorFactory factory}, which provides it with an + * {@linkplain AnnotationProcessorEnvironment environment} that + * encapsulates the state it needs. + * Messages regarding warnings and errors encountered during processing + * should be directed to the environment's {@link Messager}, + * and new files may be created using the environment's {@link Filer}. + * + *

Each annotation processor is created to process annotations + * of a particular annotation type or set of annotation types. + * It may use its environment to find the program elements with + * annotations of those types. It may freely examine any other program + * elements in the course of its processing. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface AnnotationProcessor { + + /** + * Process all program elements supported by this annotation processor. + */ + void process(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorEnvironment.java b/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorEnvironment.java new file mode 100644 index 00000000000..bdd8277da88 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorEnvironment.java @@ -0,0 +1,177 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.apt; + + +import java.util.Collection; +import java.util.Map; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.util.*; + + +/** + * The environment encapsulating the state needed by an annotation processor. + * An annotation processing tool makes this environment available + * to all annotation processors. + * + *

When an annotation processing tool is invoked, it is given a + * set of type declarations on which to operate. These + * are refered to as the specified types. + * The type declarations said to be included in this invocation + * consist of the specified types and any types nested within them. + * + *

{@link DeclarationFilter} + * provides a simple way to select just the items of interest + * when a method returns a collection of declarations. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface AnnotationProcessorEnvironment { + + /** + * Returns the options passed to the annotation processing tool. + * Options are returned in the form of a map from option name + * (such as "-encoding") to option value. + * For an option with no value (such as "-help"), the + * corresponding value in the map is null. + * + *

Options beginning with "-A" are processor-specific. + * Such options are unrecognized by the tool, but intended to be used by + * some annotation processor. + * + * @return the options passed to the tool + */ + Map getOptions(); + + /** + * Returns the messager used to report errors, warnings, and other + * notices. + * + * @return the messager + */ + Messager getMessager(); + + /** + * Returns the filer used to create new source, class, or auxiliary + * files. + * + * @return the filer + */ + Filer getFiler(); + + + + /** + * Returns the declarations of the types specified when the + * annotation processing tool was invoked. + * + * @return the types specified when the tool was invoked, or an + * empty collection if there were none + */ + Collection getSpecifiedTypeDeclarations(); + + /** + * Returns the declaration of a package given its fully qualified name. + * + * @param name fully qualified package name, or "" for the unnamed package + * @return the declaration of the named package, or null if it cannot + * be found + */ + PackageDeclaration getPackage(String name); + + /** + * Returns the declaration of a type given its fully qualified name. + * + * @param name fully qualified type name + * @return the declaration of the named type, or null if it cannot be + * found + */ + TypeDeclaration getTypeDeclaration(String name); + + /** + * A convenience method that returns the declarations of the types + * {@linkplain AnnotationProcessorEnvironment included} + * in this invocation of the annotation processing tool. + * + * @return the declarations of the types included in this invocation + * of the tool, or an empty collection if there are none + */ + Collection getTypeDeclarations(); + + /** + * Returns the declarations annotated with the given annotation type. + * Only declarations of the types + * {@linkplain AnnotationProcessorEnvironment included} + * in this invocation of the annotation processing tool, or + * declarations of members, parameters, or type parameters + * declared within those, are returned. + * + * @param a annotation type being requested + * @return the declarations annotated with the given annotation type, + * or an empty collection if there are none + */ + Collection getDeclarationsAnnotatedWith( + AnnotationTypeDeclaration a); + + /** + * Returns an implementation of some utility methods for + * operating on declarations. + * + * @return declaration utilities + */ + Declarations getDeclarationUtils(); + + /** + * Returns an implementation of some utility methods for + * operating on types. + * + * @return type utilities + */ + Types getTypeUtils(); + + /** + * Add a listener. If the listener is currently registered to listen, + * adding it again will have no effect. + * + * @param listener The listener to add. + * @throws NullPointerException if the listener is null + */ + void addListener(AnnotationProcessorListener listener); + + + /** + * Remove a listener. If the listener is not currently listening, + * the method call does nothing. + * + * @param listener The listener to remove. + * @throws NullPointerException if the listener is null + */ + void removeListener(AnnotationProcessorListener listener); +} diff --git a/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorFactory.java b/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorFactory.java new file mode 100644 index 00000000000..a2169b1117c --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorFactory.java @@ -0,0 +1,103 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.apt; + + +import java.util.Collection; +import java.util.Set; + +import com.sun.mirror.declaration.AnnotationTypeDeclaration; + + +/** + * A factory for creating annotation processors. + * Each factory is responsible for creating processors for one or more + * annotation types. + * The factory is said to support these types. + * + *

Each implementation of an AnnotationProcessorFactory + * must provide a public no-argument constructor to be used by tools to + * instantiate the factory. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface AnnotationProcessorFactory { + + /** + * Returns the options recognized by this factory or by any of the + * processors it may create. + * Only {@linkplain AnnotationProcessorEnvironment#getOptions() + * processor-specific} options are included, each of which begins + * with "-A". For example, if this factory recognizes + * options such as -Adebug -Aloglevel=3, it will + * return the strings "-Adebug" and "-Aloglevel". + * + *

A tool might use this information to determine if any + * options provided by a user are unrecognized by any processor, + * in which case it may wish to report an error. + * + * @return the options recognized by this factory or by any of the + * processors it may create, or an empty collection if none + */ + Collection supportedOptions(); + + /** + * Returns the names of the annotation types supported by this factory. + * An element of the result may be the canonical (fully qualified) name + * of a supported annotation type. Alternately it may be of the form + * "name.*" + * representing the set of all annotation types + * with canonical names beginning with "name." + * Finally, "*" by itself represents the set of all + * annotation types. + * + * @return the names of the annotation types supported by this factory + */ + Collection supportedAnnotationTypes(); + + /** + * Returns an annotation processor for a set of annotation + * types. The set will be empty if the factory supports + * "*" and the specified type declarations have + * no annotations. Note that the set of annotation types may be + * empty for other reasons, such as giving the factory an + * opportunity to register a listener. An + * AnnotationProcessorFactory must gracefully handle an + * empty set of annotations; an appropriate response to an empty + * set will often be returning {@link AnnotationProcessors#NO_OP}. + * + * @param atds type declarations of the annotation types to be processed + * @param env environment to use during processing + * @return an annotation processor for the given annotation types, + * or null if the types are not supported or the + * processor cannot be created + */ + AnnotationProcessor getProcessorFor(Set atds, + AnnotationProcessorEnvironment env); +} diff --git a/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorListener.java b/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorListener.java new file mode 100644 index 00000000000..89b1e82a168 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessorListener.java @@ -0,0 +1,35 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.apt; + +/** + * Superinterface for all annotation processor event listeners. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ +public interface AnnotationProcessorListener extends java.util.EventListener {} diff --git a/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessors.java b/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessors.java new file mode 100644 index 00000000000..c3e8f9496e2 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/apt/AnnotationProcessors.java @@ -0,0 +1,117 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.apt; + +import com.sun.mirror.apt.*; +import java.util.*; + +/** + * Utilities to create specialized annotation processors. + * + * @since 1.5 + * @author Joseph D. Darcy + * @author Scott Seligman + */ +public class AnnotationProcessors { + static class NoOpAP implements AnnotationProcessor { + NoOpAP() {} + public void process(){} + } + + /** + * Combines multiple annotation processors into a simple composite + * processor. + * The composite processor functions by invoking each of its component + * processors in sequence. + */ + static class CompositeAnnotationProcessor implements AnnotationProcessor { + + private List aps = + new LinkedList(); + + /** + * Constructs a new composite annotation processor. + * @param aps the component annotation processors + */ + public CompositeAnnotationProcessor(Collection aps) { + this.aps.addAll(aps); + } + + /** + * Constructs a new composite annotation processor. + * @param aps the component annotation processors + */ + public CompositeAnnotationProcessor(AnnotationProcessor... aps) { + for(AnnotationProcessor ap: aps) + this.aps.add(ap); + } + + /** + * Invokes the process method of each component processor, + * in the order in which the processors were passed to the constructor. + */ + public void process() { + for(AnnotationProcessor ap: aps) + ap.process(); + } + } + + + /** + * An annotation processor that does nothing and has no state. + * May be used multiple times. + * + * @since 1.5 + */ + public final static AnnotationProcessor NO_OP = new NoOpAP(); + + /** + * Constructs a new composite annotation processor. A composite + * annotation processor combines multiple annotation processors + * into one and functions by invoking each of its component + * processors' process methods in sequence. + * + * @param aps The processors to create a composite of + * @since 1.5 + */ + public static AnnotationProcessor getCompositeAnnotationProcessor(AnnotationProcessor... aps) { + return new CompositeAnnotationProcessor(aps); + } + + /** + * Constructs a new composite annotation processor. A composite + * annotation processor combines multiple annotation processors + * into one and functions by invoking each of its component + * processors' process methods in the sequence the processors are + * returned by the collection's iterator. + * + * @param aps A collection of processors to create a composite of + * @since 1.5 + */ + public static AnnotationProcessor getCompositeAnnotationProcessor(Collection aps) { + return new CompositeAnnotationProcessor(aps); + } +} diff --git a/langtools/src/share/classes/com/sun/mirror/apt/Filer.java b/langtools/src/share/classes/com/sun/mirror/apt/Filer.java new file mode 100644 index 00000000000..4053a0e0dc6 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/apt/Filer.java @@ -0,0 +1,150 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.apt; + + +import java.io.*; + + +/** + * This interface supports the creation of new files by an + * annotation processor. + * Files created in this way will be known to the annotation processing + * tool implementing this interface, better enabling the tool to manage them. + * Four kinds of files are distinguished: + * source files, class files, other text files, and other binary files. + * The latter two are collectively referred to as auxiliary files. + * + *

There are two distinguished locations (subtrees within the + * file system) where newly created files are placed: + * one for new source files, and one for new class files. + * (These might be specified on a tool's command line, for example, + * using flags such as -s and -d.) + * Auxiliary files may be created in either location. + * + *

During each run of an annotation processing tool, a file + * with a given pathname may be created only once. If that file already + * exists before the first attempt to create it, the old contents will + * be deleted. Any subsequent attempt to create the same file during + * a run will fail. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface Filer { + + /** + * Creates a new source file and returns a writer for it. + * The file's name and path (relative to the root of all newly created + * source files) is based on the type to be declared in that file. + * If more than one type is being declared, the name of the principal + * top-level type (the public one, for example) should be used. + * + *

The {@linkplain java.nio.charset.Charset charset} used to + * encode the file is determined by the implementation. + * An annotation processing tool may have an -encoding + * flag or the like for specifying this. It will typically use + * the platform's default encoding if none is specified. + * + * @param name canonical (fully qualified) name of the principal type + * being declared in this file + * @return a writer for the new file + * @throws IOException if the file cannot be created + */ + PrintWriter createSourceFile(String name) throws IOException; + + /** + * Creates a new class file, and returns a stream for writing to it. + * The file's name and path (relative to the root of all newly created + * class files) is based on the name of the type being written. + * + * @param name canonical (fully qualified) name of the type being written + * @return a stream for writing to the new file + * @throws IOException if the file cannot be created + */ + OutputStream createClassFile(String name) throws IOException; + + /** + * Creates a new text file, and returns a writer for it. + * The file is located along with either the + * newly created source or newly created binary files. It may be + * named relative to some package (as are source and binary files), + * and from there by an arbitrary pathname. In a loose sense, the + * pathname of the new file will be the concatenation of + * loc, pkg, and relPath. + * + *

A {@linkplain java.nio.charset.Charset charset} for + * encoding the file may be provided. If none is given, the + * charset used to encode source files + * (see {@link #createSourceFile(String)}) will be used. + * + * @param loc location of the new file + * @param pkg package relative to which the file should be named, + * or the empty string if none + * @param relPath final pathname components of the file + * @param charsetName the name of the charset to use, or null if none + * is being explicitly specified + * @return a writer for the new file + * @throws IOException if the file cannot be created + */ + PrintWriter createTextFile(Location loc, + String pkg, + File relPath, + String charsetName) throws IOException; + + /** + * Creates a new binary file, and returns a stream for writing to it. + * The file is located along with either the + * newly created source or newly created binary files. It may be + * named relative to some package (as are source and binary files), + * and from there by an arbitrary pathname. In a loose sense, the + * pathname of the new file will be the concatenation of + * loc, pkg, and relPath. + * + * @param loc location of the new file + * @param pkg package relative to which the file should be named, + * or the empty string if none + * @param relPath final pathname components of the file + * @return a stream for writing to the new file + * @throws IOException if the file cannot be created + */ + OutputStream createBinaryFile(Location loc, + String pkg, + File relPath) throws IOException; + + + /** + * Locations (subtrees within the file system) where new files are created. + */ + enum Location { + /** The location of new source files. */ + SOURCE_TREE, + /** The location of new class files. */ + CLASS_TREE + } +} diff --git a/langtools/src/share/classes/com/sun/mirror/apt/Messager.java b/langtools/src/share/classes/com/sun/mirror/apt/Messager.java new file mode 100644 index 00000000000..37ab26ae2f2 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/apt/Messager.java @@ -0,0 +1,88 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.apt; + + +import com.sun.mirror.util.SourcePosition; + + +/** + * A Messager provides the way for + * an annotation processor to report error messages, warnings, and + * other notices. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface Messager { + + /** + * Prints an error message. + * Equivalent to printError(null, msg). + * @param msg the message, or an empty string if none + */ + void printError(String msg); + + /** + * Prints an error message. + * @param pos the position where the error occured, or null if it is + * unknown or not applicable + * @param msg the message, or an empty string if none + */ + void printError(SourcePosition pos, String msg); + + /** + * Prints a warning message. + * Equivalent to printWarning(null, msg). + * @param msg the message, or an empty string if none + */ + void printWarning(String msg); + + /** + * Prints a warning message. + * @param pos the position where the warning occured, or null if it is + * unknown or not applicable + * @param msg the message, or an empty string if none + */ + void printWarning(SourcePosition pos, String msg); + + /** + * Prints a notice. + * Equivalent to printNotice(null, msg). + * @param msg the message, or an empty string if none + */ + void printNotice(String msg); + + /** + * Prints a notice. + * @param pos the position where the noticed occured, or null if it is + * unknown or not applicable + * @param msg the message, or an empty string if none + */ + void printNotice(SourcePosition pos, String msg); +} diff --git a/langtools/src/share/classes/com/sun/mirror/apt/RoundCompleteEvent.java b/langtools/src/share/classes/com/sun/mirror/apt/RoundCompleteEvent.java new file mode 100644 index 00000000000..a163b9d3f1a --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/apt/RoundCompleteEvent.java @@ -0,0 +1,68 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.apt; + +/** + * Event for the completion of a round of annotation processing. + * + *

While this class extends the serializable EventObject, it + * cannot meaningfully be serialized because all of the annotation + * processing tool's internal state would potentially be needed. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ +public abstract class RoundCompleteEvent extends java.util.EventObject { + private RoundState rs; + + /** + * The current AnnotationProcessorEnvironment is regarded + * as the source of events. + * + * @param source The source of events + * @param rs The state of the round + */ + protected RoundCompleteEvent(AnnotationProcessorEnvironment source, + RoundState rs) { + super(source); + this.rs = rs; + } + + /** + * Return round state. + */ + public RoundState getRoundState() { + return rs; + } + + /** + * Return source. + */ + public AnnotationProcessorEnvironment getSource() { + return (AnnotationProcessorEnvironment)super.getSource(); + } +} diff --git a/langtools/src/share/classes/com/sun/mirror/apt/RoundCompleteListener.java b/langtools/src/share/classes/com/sun/mirror/apt/RoundCompleteListener.java new file mode 100644 index 00000000000..ae460d8f4c9 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/apt/RoundCompleteListener.java @@ -0,0 +1,42 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.apt; + +/** + * Listener for the completion of a round of annotation processing. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ +public interface RoundCompleteListener extends AnnotationProcessorListener { + /** + * Invoked after all processors for a round have run to completion. + * + * @param event An event for round completion + */ + void roundComplete(RoundCompleteEvent event); +} diff --git a/langtools/src/share/classes/com/sun/mirror/apt/RoundState.java b/langtools/src/share/classes/com/sun/mirror/apt/RoundState.java new file mode 100644 index 00000000000..956899d8574 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/apt/RoundState.java @@ -0,0 +1,59 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.apt; + +/** + * Represents the status of a completed round of annotation processing. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ +public interface RoundState { + /** + * Returns true if this was the last round of annotation + * processing; returns false if there will be a subsequent round. + */ + boolean finalRound(); + + /** + * Returns true if an error was raised in this round of processing; + * returns false otherwise. + */ + boolean errorRaised(); + + /** + * Returns true if new source files were created in this round of + * processing; returns false otherwise. + */ + boolean sourceFilesCreated(); + + /** + * Returns true if new class files were created in this round of + * processing; returns false otherwise. + */ + boolean classFilesCreated(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/apt/package.html b/langtools/src/share/classes/com/sun/mirror/apt/package.html new file mode 100644 index 00000000000..8330decfd8b --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/apt/package.html @@ -0,0 +1,42 @@ + + + + + + + + +Classes used to communicate information between +{@linkplain com.sun.mirror.apt.AnnotationProcessor annotation processors} +and an annotation processing tool. + +

Note that the apt tool and its associated APIs may be +changed or superseded in future j2se releases. + +@since 1.5 + + diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationMirror.java b/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationMirror.java new file mode 100644 index 00000000000..03b65de8600 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationMirror.java @@ -0,0 +1,81 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.declaration; + +import java.util.Map; +import com.sun.mirror.type.AnnotationType; +import com.sun.mirror.util.SourcePosition; + + +/** + * Represents an annotation. An annotation associates a value with + * each element of an annotation type. + * + *

Annotations should not be compared using reference-equality + * ("=="). There is no guarantee that any particular + * annotation will always be represented by the same object. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface AnnotationMirror { + + /** + * Returns the annotation type of this annotation. + * + * @return the annotation type of this annotation + */ + AnnotationType getAnnotationType(); + + /** + * Returns the source position of the beginning of this annotation. + * Returns null if the position is unknown or not applicable. + * + *

This source position is intended for use in providing diagnostics, + * and indicates only approximately where an annotation begins. + * + * @return the source position of the beginning of this annotation or + * null if the position is unknown or not applicable + */ + SourcePosition getPosition(); + + /** + * Returns this annotation's elements and their values. + * This is returned in the form of a map that associates elements + * with their corresponding values. + * Only those elements and values explicitly present in the + * annotation are included, not those that are implicitly assuming + * their default values. + * The order of the map matches the order in which the + * elements appear in the annotation's source. + * + * @return this annotation's elements and their values, + * or an empty map if there are none + */ + Map getElementValues(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationTypeDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationTypeDeclaration.java new file mode 100644 index 00000000000..ed7c14e94cb --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationTypeDeclaration.java @@ -0,0 +1,51 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.declaration; + + +import java.util.Collection; + + +/** + * Represents the declaration of an annotation type. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface AnnotationTypeDeclaration extends InterfaceDeclaration { + + /** + * Returns the annotation type elements of this annotation type. + * These are the methods that are directly declared in the type's + * declaration. + * + * @return the annotation type elements of this annotation type, + * or an empty collection if there are none + */ + Collection getMethods(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationTypeElementDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationTypeElementDeclaration.java new file mode 100644 index 00000000000..1864e36b845 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationTypeElementDeclaration.java @@ -0,0 +1,51 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.declaration; + + +/** + * Represents an element of an annotation type. + * + * @author Joe Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface AnnotationTypeElementDeclaration extends MethodDeclaration { + + /** + * Returns the default value of this element. + * + * @return the default value of this element, or null if this element + * has no default. + */ + AnnotationValue getDefaultValue(); + + /** + * {@inheritDoc} + */ + AnnotationTypeDeclaration getDeclaringType(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationValue.java b/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationValue.java new file mode 100644 index 00000000000..b4f9593262f --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/declaration/AnnotationValue.java @@ -0,0 +1,76 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.declaration; + +import com.sun.mirror.util.SourcePosition; + +/** + * Represents a value of an annotation type element. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface AnnotationValue { + + /** + * Returns the value. + * The result has one of the following types: + *

  • a wrapper class (such as {@link Integer}) for a primitive type + *
  • {@code String} + *
  • {@code TypeMirror} + *
  • {@code EnumConstantDeclaration} + *
  • {@code AnnotationMirror} + *
  • {@code Collection} + * (representing the elements, in order, if the value is an array) + *
+ * + * @return the value + */ + Object getValue(); + + /** + * Returns the source position of the beginning of this annotation value. + * Returns null if the position is unknown or not applicable. + * + *

This source position is intended for use in providing diagnostics, + * and indicates only approximately where an annotation value begins. + * + * @return the source position of the beginning of this annotation value or + * null if the position is unknown or not applicable + */ + SourcePosition getPosition(); + + /** + * Returns a string representation of this value. + * This is returned in a form suitable for representing this value + * in the source code of an annotation. + * + * @return a string representation of this value + */ + String toString(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/ClassDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/ClassDeclaration.java new file mode 100644 index 00000000000..8d86c528314 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/declaration/ClassDeclaration.java @@ -0,0 +1,83 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.declaration; + + +import java.util.Collection; + +import com.sun.mirror.type.ClassType; + + +/** + * Represents the declaration of a class. + * For the declaration of an interface, see {@link InterfaceDeclaration}. + * Provides access to information about the class, its members, and + * its constructors. + * Note that an {@linkplain EnumDeclaration enum} is a kind of class. + * + *

While a ClassDeclaration represents the declaration + * of a class, a {@link ClassType} represents a class type. + * See {@link TypeDeclaration} for more on this distinction. + * + *

{@link com.sun.mirror.util.DeclarationFilter} + * provides a simple way to select just the items of interest + * when a method returns a collection of declarations. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * + * @see ClassType + * @since 1.5 + */ + +public interface ClassDeclaration extends TypeDeclaration { + + /** + * Returns the class type directly extended by this class. + * The only class with no superclass is java.lang.Object, + * for which this method returns null. + * + * @return the class type directly extended by this class, or null + * if there is none + */ + ClassType getSuperclass(); + + /** + * Returns the constructors of this class. + * This includes the default constructor if this class has + * no constructors explicitly declared. + * + * @return the constructors of this class + * + * @see com.sun.mirror.util.DeclarationFilter + */ + Collection getConstructors(); + + /** + * {@inheritDoc} + */ + Collection getMethods(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/ConstructorDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/ConstructorDeclaration.java new file mode 100644 index 00000000000..11391f8f8a3 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/declaration/ConstructorDeclaration.java @@ -0,0 +1,38 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.declaration; + + +/** + * Represents a constructor of a class or interface. + * + * @author Joe Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface ConstructorDeclaration extends ExecutableDeclaration { +} diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/Declaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/Declaration.java new file mode 100644 index 00000000000..1cffc6427d7 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/declaration/Declaration.java @@ -0,0 +1,163 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.declaration; + + +import java.lang.annotation.Annotation; +import java.util.Collection; + +import com.sun.mirror.type.*; +import com.sun.mirror.util.*; + + +/** + * Represents the declaration of a program element such as a package, + * class, or method. Each declaration represents a static, language-level + * construct (and not, for example, a runtime construct of the virtual + * machine), and typically corresponds one-to-one with a particular + * fragment of source code. + * + *

Declarations should be compared using the {@link #equals(Object)} + * method. There is no guarantee that any particular declaration will + * always be represented by the same object. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * + * @see Declarations + * @see TypeMirror + * @since 1.5 + */ + +public interface Declaration { + + /** + * Tests whether an object represents the same declaration as this. + * + * @param obj the object to be compared with this declaration + * @return true if the specified object represents the same + * declaration as this + */ + boolean equals(Object obj); + + /** + * Returns the text of the documentation ("javadoc") comment of + * this declaration. + * + * @return the documentation comment of this declaration, or null + * if there is none + */ + String getDocComment(); + + /** + * Returns the annotations that are directly present on this declaration. + * + * @return the annotations directly present on this declaration; + * an empty collection if there are none + */ + Collection getAnnotationMirrors(); + + /** + * Returns the annotation of this declaration having the specified + * type. The annotation may be either inherited or directly + * present on this declaration. + * + *

The annotation returned by this method could contain an element + * whose value is of type Class. + * This value cannot be returned directly: information necessary to + * locate and load a class (such as the class loader to use) is + * not available, and the class might not be loadable at all. + * Attempting to read a Class object by invoking the relevant + * method on the returned annotation + * will result in a {@link MirroredTypeException}, + * from which the corresponding {@link TypeMirror} may be extracted. + * Similarly, attempting to read a Class[]-valued element + * will result in a {@link MirroredTypesException}. + * + *

+ * Note: This method is unlike + * others in this and related interfaces. It operates on run-time + * reflective information -- representations of annotation types + * currently loaded into the VM -- rather than on the mirrored + * representations defined by and used throughout these + * interfaces. It is intended for callers that are written to + * operate on a known, fixed set of annotation types. + *
+ * + * @param the annotation type + * @param annotationType the Class object corresponding to + * the annotation type + * @return the annotation of this declaration having the specified type + * + * @see #getAnnotationMirrors() + */ + A getAnnotation(Class annotationType); + + /** + * Returns the modifiers of this declaration, excluding annotations. + * Implicit modifiers, such as the public and static + * modifiers of interface members, are included. + * + * @return the modifiers of this declaration in undefined order; + * an empty collection if there are none + */ + Collection getModifiers(); + + /** + * Returns the simple (unqualified) name of this declaration. + * The name of a generic type does not include any reference + * to its formal type parameters. + * For example, the simple name of the interface declaration + * {@code java.util.Set} is "Set". + * If this declaration represents the empty package, an empty + * string is returned. + * If it represents a constructor, the simple name of its + * declaring class is returned. + * + * @return the simple name of this declaration + */ + String getSimpleName(); + + /** + * Returns the source position of the beginning of this declaration. + * Returns null if the position is unknown or not applicable. + * + *

This source position is intended for use in providing + * diagnostics, and indicates only approximately where a declaration + * begins. + * + * @return the source position of the beginning of this declaration, + * or null if the position is unknown or not applicable + */ + SourcePosition getPosition(); + + /** + * Applies a visitor to this declaration. + * + * @param v the visitor operating on this declaration + */ + void accept(DeclarationVisitor v); +} diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/EnumConstantDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/EnumConstantDeclaration.java new file mode 100644 index 00000000000..60f45b5e460 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/declaration/EnumConstantDeclaration.java @@ -0,0 +1,42 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.declaration; + + +/** + * Represents an enum constant declaration. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface EnumConstantDeclaration extends FieldDeclaration { + /** + * {@inheritDoc} + */ + EnumDeclaration getDeclaringType(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/EnumDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/EnumDeclaration.java new file mode 100644 index 00000000000..c1026830a1d --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/declaration/EnumDeclaration.java @@ -0,0 +1,49 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.declaration; + + +import java.util.Collection; + + +/** + * Represents the declaration of an enum type. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface EnumDeclaration extends ClassDeclaration { + + /** + * Returns the enum constants defined for this enum. + * + * @return the enum constants defined for this enum, + * or an empty collection if there are none + */ + Collection getEnumConstants(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/ExecutableDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/ExecutableDeclaration.java new file mode 100644 index 00000000000..e3b1b3d15ed --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/declaration/ExecutableDeclaration.java @@ -0,0 +1,79 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.declaration; + + +import java.util.Collection; + +import com.sun.mirror.type.ReferenceType; + + +/** + * Represents a method or constructor of a class or interface. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface ExecutableDeclaration extends MemberDeclaration { + + /** + * Returns true if this method or constructor accepts a variable + * number of arguments. + * + * @return true if this method or constructor accepts a variable + * number of arguments + */ + boolean isVarArgs(); + + /** + * Returns the formal type parameters of this method or constructor. + * They are returned in declaration order. + * + * @return the formal type parameters of this method or constructor, + * or an empty collection if there are none + */ + Collection getFormalTypeParameters(); + + /** + * Returns the formal parameters of this method or constructor. + * They are returned in declaration order. + * + * @return the formal parameters of this method or constructor, + * or an empty collection if there are none + */ + Collection getParameters(); + + /** + * Returns the exceptions and other throwables listed in this + * method or constructor's throws clause. + * + * @return the exceptions and other throwables listed in the + * throws clause, or an empty collection if there are none + */ + Collection getThrownTypes(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/FieldDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/FieldDeclaration.java new file mode 100644 index 00000000000..656dd89eab5 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/declaration/FieldDeclaration.java @@ -0,0 +1,73 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.declaration; + + +import com.sun.mirror.type.TypeMirror; + + +/** + * Represents a field of a type declaration. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface FieldDeclaration extends MemberDeclaration { + + /** + * Returns the type of this field. + * + * @return the type of this field + */ + TypeMirror getType(); + + /** + * Returns the value of this field if this field is a compile-time + * constant. Returns null otherwise. + * The value will be of a primitive type or String. + * If the value is of a primitive type, it is wrapped in the + * appropriate wrapper class (such as {@link Integer}). + * + * @return the value of this field if this field is a compile-time + * constant, or null otherwise + */ + Object getConstantValue(); + + /** + * Returns the text of a constant expression representing the + * value of this field if this field is a compile-time constant. + * Returns null otherwise. + * The value will be of a primitive type or String. + * The text returned is in a form suitable for representing the value + * in source code. + * + * @return the text of a constant expression if this field is a + * compile-time constant, or null otherwise + */ + String getConstantExpression(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/InterfaceDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/InterfaceDeclaration.java new file mode 100644 index 00000000000..253371acb25 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/declaration/InterfaceDeclaration.java @@ -0,0 +1,51 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.declaration; + + +import com.sun.mirror.type.InterfaceType; + + +/** + * Represents the declaration of an interface. + * Provides access to information about the interface and its members. + * Note that an {@linkplain AnnotationTypeDeclaration annotation type} is + * a kind of interface. + * + *

While an InterfaceDeclaration represents the + * declaration of an interface, an {@link InterfaceType} + * represents an interface type. + * See {@link TypeDeclaration} for more on this distinction. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * + * @see InterfaceType + * @since 1.5 + */ + +public interface InterfaceDeclaration extends TypeDeclaration { +} diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/MemberDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/MemberDeclaration.java new file mode 100644 index 00000000000..8d5feda5524 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/declaration/MemberDeclaration.java @@ -0,0 +1,51 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.declaration; + + +/** + * Represents a declaration that may be a member or constructor of a declared + * type. This includes fields, constructors, methods, and (since they + * may be nested) declared types themselves. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface MemberDeclaration extends Declaration { + + /** + * Returns the type declaration within which this member or constructor + * is declared. + * If this is the declaration of a top-level type (a non-nested class + * or interface), returns null. + * + * @return the type declaration within which this member or constructor + * is declared, or null if there is none + */ + TypeDeclaration getDeclaringType(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/MethodDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/MethodDeclaration.java new file mode 100644 index 00000000000..d2abeff5c30 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/declaration/MethodDeclaration.java @@ -0,0 +1,53 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.declaration; + + +import com.sun.mirror.type.TypeMirror; +import com.sun.mirror.type.VoidType; + + +/** + * Represents a method of a class or interface. + * Note that an + * {@linkplain AnnotationTypeElementDeclaration annotation type element} + * is a kind of method. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface MethodDeclaration extends ExecutableDeclaration { + + /** + * Returns the formal return type of this method. + * Returns {@link VoidType} if this method does not return a value. + * + * @return the formal return type of this method + */ + TypeMirror getReturnType(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/Modifier.java b/langtools/src/share/classes/com/sun/mirror/declaration/Modifier.java new file mode 100644 index 00000000000..ccd63b4032b --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/declaration/Modifier.java @@ -0,0 +1,72 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.declaration; + + +/** + * Represents a modifier on the declaration of a program element such + * as a class, method, or field. + * + *

Not all modifiers are applicable to all kinds of declarations. + * When two or more modifiers appear in the source code of a declaration, + * then it is customary, though not required, that they appear in the same + * order as the constants listed in the detail section below. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public enum Modifier { + + // See JLS2 sections 8.1.1, 8.3.1, 8.4.3, 8.8.3, and 9.1.1. + // java.lang.reflect.Modifier includes INTERFACE, but that's a VMism. + + /** The modifier public */ PUBLIC, + /** The modifier protected */ PROTECTED, + /** The modifier private */ PRIVATE, + /** The modifier abstract */ ABSTRACT, + /** The modifier static */ STATIC, + /** The modifier final */ FINAL, + /** The modifier transient */ TRANSIENT, + /** The modifier volatile */ VOLATILE, + /** The modifier synchronized */ SYNCHRONIZED, + /** The modifier native */ NATIVE, + /** The modifier strictfp */ STRICTFP; + + + private String lowercase = null; // modifier name in lowercase + + /** + * Returns this modifier's name in lowercase. + */ + public String toString() { + if (lowercase == null) { + lowercase = name().toLowerCase(java.util.Locale.US); + } + return lowercase; + } +} diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/PackageDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/PackageDeclaration.java new file mode 100644 index 00000000000..40c09c8611f --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/declaration/PackageDeclaration.java @@ -0,0 +1,95 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.declaration; + + +import java.util.Collection; + + +/** + * Represents the declaration of a package. Provides access to information + * about the package and its members. + * + *

{@link com.sun.mirror.util.DeclarationFilter} + * provides a simple way to select just the items of interest + * when a method returns a collection of declarations. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface PackageDeclaration extends Declaration { + + /** + * Returns the fully qualified name of this package. + * This is also known as the package's canonical name. + * + * @return the fully qualified name of this package, or the + * empty string if this is the unnamed package + */ + String getQualifiedName(); + + /** + * Returns the declarations of the top-level classes in this package. + * Interfaces are not included, but enum types are. + * + * @return the declarations of the top-level classes in this package + * + * @see com.sun.mirror.util.DeclarationFilter + */ + Collection getClasses(); + + /** + * Returns the declarations of the top-level enum types in this package. + * + * @return the declarations of the top-level enum types in this package + * + * @see com.sun.mirror.util.DeclarationFilter + */ + Collection getEnums(); + + /** + * Returns the declarations of the top-level interfaces in this package. + * Annotation types are included. + * + * @return the declarations of the top-level interfaces in this package + * + * @see com.sun.mirror.util.DeclarationFilter + */ + Collection getInterfaces(); + + /** + * Returns the declarations of the top-level annotation types in this + * package. + * + * @return the declarations of the top-level annotation types in this + * package + * + * @see com.sun.mirror.util.DeclarationFilter + */ + Collection getAnnotationTypes(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/ParameterDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/ParameterDeclaration.java new file mode 100644 index 00000000000..28cc7f82b6d --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/declaration/ParameterDeclaration.java @@ -0,0 +1,48 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.declaration; + + +import com.sun.mirror.type.TypeMirror; + + +/** + * Represents a formal parameter of a method or constructor. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface ParameterDeclaration extends Declaration { + + /** + * Returns the type of this parameter. + * + * @return the type of this parameter + */ + TypeMirror getType(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/TypeDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/TypeDeclaration.java new file mode 100644 index 00000000000..b3d1db54746 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/declaration/TypeDeclaration.java @@ -0,0 +1,140 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.declaration; + + +import java.util.Collection; + +import com.sun.mirror.type.*; + + +/** + * Represents the declaration of a class or interface. + * Provides access to information about the type and its members. + * Note that an {@linkplain EnumDeclaration enum} is a kind of class, + * and an {@linkplain AnnotationTypeDeclaration annotation type} is + * a kind of interface. + * + *

+ * While a TypeDeclaration represents the declaration + * of a class or interface, a {@link DeclaredType} represents a class + * or interface type, the latter being a use + * (or invocation) of the former. + * The distinction is most apparent with generic types, + * for which a single declaration can define a whole + * family of types. For example, the declaration of + * {@code java.util.Set} corresponds to the parameterized types + * {@code java.util.Set} and {@code java.util.Set} + * (and many others), and to the raw type {@code java.util.Set}. + * + *

{@link com.sun.mirror.util.DeclarationFilter} + * provides a simple way to select just the items of interest + * when a method returns a collection of declarations. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * + * @see DeclaredType + * @since 1.5 + */ + +public interface TypeDeclaration extends MemberDeclaration { + + /** + * Returns the package within which this type is declared. + * + * @return the package within which this type is declared + */ + PackageDeclaration getPackage(); + + /** + * Returns the fully qualified name of this class or interface + * declaration. More precisely, it returns the canonical + * name. + * The name of a generic type does not include any reference + * to its formal type parameters. + * For example, the the fully qualified name of the interface declaration + * {@code java.util.Set} is "java.util.Set". + * + * @return the fully qualified name of this class or interface declaration + */ + String getQualifiedName(); + + /** + * Returns the formal type parameters of this class or interface. + * + * @return the formal type parameters, or an empty collection + * if there are none + */ + Collection getFormalTypeParameters(); + + /** + * Returns the interface types directly implemented by this class + * or extended by this interface. + * + * @return the interface types directly implemented by this class + * or extended by this interface, or an empty collection if there are none + * + * @see com.sun.mirror.util.DeclarationFilter + */ + Collection getSuperinterfaces(); + + /** + * Returns the fields that are directly declared by this class or + * interface. Includes enum constants. + * + * @return the fields that are directly declared, + * or an empty collection if there are none + * + * @see com.sun.mirror.util.DeclarationFilter + */ + Collection getFields(); + + /** + * Returns the methods that are directly declared by this class or + * interface. Includes annotation type elements. Excludes + * implicitly declared methods of an interface, such as + * toString, that correspond to the methods of + * java.lang.Object. + * + * @return the methods that are directly declared, + * or an empty collection if there are none + * + * @see com.sun.mirror.util.DeclarationFilter + */ + Collection getMethods(); + + /** + * Returns the declarations of the nested classes and interfaces + * that are directly declared by this class or interface. + * + * @return the declarations of the nested classes and interfaces, + * or an empty collection if there are none + * + * @see com.sun.mirror.util.DeclarationFilter + */ + Collection getNestedTypes(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/TypeParameterDeclaration.java b/langtools/src/share/classes/com/sun/mirror/declaration/TypeParameterDeclaration.java new file mode 100644 index 00000000000..458b39f4312 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/declaration/TypeParameterDeclaration.java @@ -0,0 +1,63 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.declaration; + + +import java.util.Collection; + +import com.sun.mirror.type.*; + + +/** + * Represents a formal type parameter of a generic type, method, + * or constructor declaration. + * A type parameter declares a {@link TypeVariable}. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface TypeParameterDeclaration extends Declaration { + + /** + * Returns the bounds of this type parameter. + * These are the types given by the extends clause. + * If there is no explicit extends clause, then + * java.lang.Object is considered to be the sole bound. + * + * @return the bounds of this type parameter + */ + Collection getBounds(); + + /** + * Returns the type, method, or constructor declaration within which + * this type parameter is declared. + * + * @return the declaration within which this type parameter is declared + */ + Declaration getOwner(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/declaration/package.html b/langtools/src/share/classes/com/sun/mirror/declaration/package.html new file mode 100644 index 00000000000..1920d4dbc7b --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/declaration/package.html @@ -0,0 +1,44 @@ + + + + + + + + +Interfaces used to model program element declarations. +A declaration is represented by the appropriate subinterface of +{@link com.sun.mirror.declaration.Declaration}, +and an annotation is represented as an +{@link com.sun.mirror.declaration.AnnotationMirror}. + +

Note that the apt tool and its associated APIs may be +changed or superseded in future j2se releases. + +@since 1.5 + + diff --git a/langtools/src/share/classes/com/sun/mirror/overview.html b/langtools/src/share/classes/com/sun/mirror/overview.html new file mode 100644 index 00000000000..e68fcb71c4d --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/overview.html @@ -0,0 +1,111 @@ + + + + + + + + +The Mirror API is used to model the semantic structure of a program. +It provides representations of the entities +declared in a program, such as classes, methods, and fields. +Constructs below the method level, such as +individual statements and expressions, are not represented. + +

Also included is support for writing +{@linkplain com.sun.mirror.apt.AnnotationProcessor annotation processors} +to examine and process the annotations +of program elements. An annotation processor may, as an example, create +new source files and XML documents to be used in conjunction with the +original code. + + +

Characteristics of the API

+ +A program is represented at the language level, rather than at the +level of the virtual machine. Nested classes, for example, are +handled as first-class constructs, +rather than in the translated form understood by the VM. +Both source code and compiled code (class files) may be modeled +in this way. + +

Programs are modeled in their static, or build-time, form. +This differs from the {@linkplain java.lang.reflect reflection} API, +which provides run-time information about classes and objects. + +

The API does not provide direct support for generating new code. + + +

Declarations and Types

+ +The mirror API represents program constructs principally through the +{@link com.sun.mirror.declaration.Declaration} interface +and its hierarchy of subinterfaces in the package {@link +com.sun.mirror.declaration}. A Declaration represents a +program element such as a package, class, or method. +The interface hierarchy is depicted + here. + +

Types are represented by the {@link com.sun.mirror.type.TypeMirror} +interface and its hierarchy of subinterfaces in the +package {@link com.sun.mirror.type}. Types include primitive types, +class and interface types, array types, type variables, and wildcards. +The interface hierarchy is depicted + here. + +

The API makes a clear distinction between declarations and types. +This is most significant for generic types, where a single declaration +can define an infinite family of types. For example, the declaration of +java.util.Set defines the raw type java.util.Set, +the parameterized type {@code java.util.Set}, +and much more. Only the declaration can be annotated, for example, +and only a type can appear in a method signature. + +

A program being modeled may be incomplete, in that +it may depend on an unknown class or interface type. +This may be the result of a processing error such as a missing class file, +or perhaps the missing type is to be created by an annotation processor. +See {@link com.sun.mirror.type.DeclaredType} for information on +how such unknown types are handled. + + +

Utilities and Tool Support

+ +The {@link com.sun.mirror.util} package provides +utilities to assist in the processing of declarations and types. +Included is support for using the visitor design pattern when +operating on declaration and type objects. + +

The {@link com.sun.mirror.apt} package supports the writing +of annotation processors. It provides the mechanism for them to +interact with an annotation processing tool. + + +@since 1.5 + + + diff --git a/langtools/src/share/classes/com/sun/mirror/type/AnnotationType.java b/langtools/src/share/classes/com/sun/mirror/type/AnnotationType.java new file mode 100644 index 00000000000..22db4ca7aca --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/type/AnnotationType.java @@ -0,0 +1,46 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.type; + + +import com.sun.mirror.declaration.AnnotationTypeDeclaration; + + +/** + * Represents an annotation type. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface AnnotationType extends InterfaceType { + + /** + * {@inheritDoc} + */ + AnnotationTypeDeclaration getDeclaration(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/type/ArrayType.java b/langtools/src/share/classes/com/sun/mirror/type/ArrayType.java new file mode 100644 index 00000000000..4de386ea7b0 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/type/ArrayType.java @@ -0,0 +1,47 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.type; + + +/** + * Represents an array type. + * A multidimensional array type is represented as an array type + * whose component type is also an array type. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface ArrayType extends ReferenceType { + + /** + * Returns the component type of this array type. + * + * @return the component type of this array type + */ + TypeMirror getComponentType(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/type/ClassType.java b/langtools/src/share/classes/com/sun/mirror/type/ClassType.java new file mode 100644 index 00000000000..051fd590dda --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/type/ClassType.java @@ -0,0 +1,68 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.type; + + +import com.sun.mirror.declaration.*; + + +/** + * Represents a class type. + * Interface types are represented separately by {@link InterfaceType}. + * Note that an {@linkplain EnumType enum} is a kind of class. + * + *

While a {@link ClassDeclaration} represents the declaration + * of a class, a ClassType represents a class type. + * See {@link TypeDeclaration} for more on this distinction. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface ClassType extends DeclaredType { + + /** + * {@inheritDoc} + */ + ClassDeclaration getDeclaration(); + + /** + * Returns the class type that is a direct supertype of this one. + * This is the superclass of this type's declaring class, with any + * type arguments substituted in. + * The only class with no superclass is java.lang.Object, + * for which this method returns null. + * + *

For example, the class type extended by + * {@code java.util.TreeSet} is + * {@code java.util.AbstractSet}. + * + * @return the class type that is a direct supertype of this one, + * or null if there is none + */ + ClassType getSuperclass(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/type/DeclaredType.java b/langtools/src/share/classes/com/sun/mirror/type/DeclaredType.java new file mode 100644 index 00000000000..d473b61a9b8 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/type/DeclaredType.java @@ -0,0 +1,105 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.type; + + +import java.util.Collection; + +import com.sun.mirror.declaration.TypeDeclaration; + + +/** + * Represents a declared type, either a class type or an interface type. + * This includes parameterized types such as {@code java.util.Set} + * as well as raw types. + * + *

While a TypeDeclaration represents the declaration + * of a class or interface, a DeclaredType represents a class + * or interface type, the latter being a use of the former. + * See {@link TypeDeclaration} for more on this distinction. + * + *

A DeclaredType may represent a type + * for which details (declaration, supertypes, etc.) are unknown. + * This may be the result of a processing error, such as a missing class file, + * and is indicated by {@link #getDeclaration()} returning null. + * Other method invocations on such an unknown type will not, in general, + * return meaningful results. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface DeclaredType extends ReferenceType { + + /** + * Returns the declaration of this type. + * + *

Returns null if this type's declaration is unknown. This may + * be the result of a processing error, such as a missing class file. + * + * @return the declaration of this type, or null if unknown + */ + TypeDeclaration getDeclaration(); + + /** + * Returns the type that contains this type as a member. + * Returns null if this is a top-level type. + * + *

For example, the containing type of {@code O.I} + * is the type {@code O}, and the containing type of + * {@code O.I} is the type {@code O}. + * + * @return the type that contains this type, + * or null if this is a top-level type + */ + DeclaredType getContainingType(); + + /** + * Returns (in order) the actual type arguments of this type. + * For a generic type nested within another generic type + * (such as {@code Outer.Inner}), only the type + * arguments of the innermost type are included. + * + * @return the actual type arguments of this type, or an empty collection + * if there are none + */ + Collection getActualTypeArguments(); + + /** + * Returns the interface types that are direct supertypes of this type. + * These are the interface types implemented or extended + * by this type's declaration, with any type arguments + * substituted in. + * + *

For example, the interface type extended by + * {@code java.util.Set} is {@code java.util.Collection}. + * + * @return the interface types that are direct supertypes of this type, + * or an empty collection if there are none + */ + Collection getSuperinterfaces(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/type/EnumType.java b/langtools/src/share/classes/com/sun/mirror/type/EnumType.java new file mode 100644 index 00000000000..90113a9d53b --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/type/EnumType.java @@ -0,0 +1,46 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.type; + + +import com.sun.mirror.declaration.EnumDeclaration; + + +/** + * Represents an enum type. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface EnumType extends ClassType { + + /** + * {@inheritDoc} + */ + EnumDeclaration getDeclaration(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/type/InterfaceType.java b/langtools/src/share/classes/com/sun/mirror/type/InterfaceType.java new file mode 100644 index 00000000000..8b9068d3f6a --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/type/InterfaceType.java @@ -0,0 +1,53 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.type; + + +import com.sun.mirror.declaration.*; + + +/** + * Represents an interface type. + * Note that an {@linkplain AnnotationType annotation type} is + * a kind of interface. + * + *

While an {@link InterfaceDeclaration} represents the + * declaration of an interface, an InterfaceType + * represents an interface type. + * See {@link TypeDeclaration} for more on this distinction. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface InterfaceType extends DeclaredType { + + /** + * {@inheritDoc} + */ + InterfaceDeclaration getDeclaration(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/type/MirroredTypeException.java b/langtools/src/share/classes/com/sun/mirror/type/MirroredTypeException.java new file mode 100644 index 00000000000..a0048d9e729 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/type/MirroredTypeException.java @@ -0,0 +1,81 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.type; + + +import java.lang.annotation.Annotation; + +import com.sun.mirror.declaration.Declaration; + + +/** + * Thrown when an application attempts to access the {@link Class} object + * corresponding to a {@link TypeMirror}. + * + * @see MirroredTypesException + * @see Declaration#getAnnotation(Class) + */ +public class MirroredTypeException extends RuntimeException { + + private static final long serialVersionUID = 1; + + private transient TypeMirror type; // cannot be serialized + private String name; // type's qualified "name" + + /** + * Constructs a new MirroredTypeException for the specified type. + * + * @param type the type being accessed + */ + public MirroredTypeException(TypeMirror type) { + super("Attempt to access Class object for TypeMirror " + type); + this.type = type; + name = type.toString(); + } + + /** + * Returns the type mirror corresponding to the type being accessed. + * The type mirror may be unavailable if this exception has been + * serialized and then read back in. + * + * @return the type mirror, or null if unavailable + */ + public TypeMirror getTypeMirror() { + return type; + } + + /** + * Returns the fully qualified name of the type being accessed. + * More precisely, returns the canonical name of a class, + * interface, array, or primitive, and returns "void" for + * the pseudo-type representing the type of void. + * + * @return the fully qualified name of the type being accessed + */ + public String getQualifiedName() { + return name; + } +} diff --git a/langtools/src/share/classes/com/sun/mirror/type/MirroredTypesException.java b/langtools/src/share/classes/com/sun/mirror/type/MirroredTypesException.java new file mode 100644 index 00000000000..8d44ec14e96 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/type/MirroredTypesException.java @@ -0,0 +1,90 @@ +/* + * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.type; + + +import java.lang.annotation.Annotation; +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; + +import com.sun.mirror.declaration.Declaration; + + +/** + * Thrown when an application attempts to access a sequence of {@link Class} + * objects each corresponding to a {@link TypeMirror}. + * + * @see MirroredTypeException + * @see Declaration#getAnnotation(Class) + */ +public class MirroredTypesException extends RuntimeException { + + private static final long serialVersionUID = 1; + + private transient Collection types; // cannot be serialized + private Collection names; // types' qualified "names" + + /** + * Constructs a new MirroredTypesException for the specified types. + * + * @param types an ordered collection of the types being accessed + */ + public MirroredTypesException(Collection types) { + super("Attempt to access Class objects for TypeMirrors " + types); + this.types = types; + names = new ArrayList(); + for (TypeMirror t : types) { + names.add(t.toString()); + } + } + + /** + * Returns the type mirrors corresponding to the types being accessed. + * The type mirrors may be unavailable if this exception has been + * serialized and then read back in. + * + * @return the type mirrors in order, or null if unavailable + */ + public Collection getTypeMirrors() { + return (types != null) + ? Collections.unmodifiableCollection(types) + : null; + } + + /** + * Returns the fully qualified names of the types being accessed. + * More precisely, returns the canonical names of each class, + * interface, array, or primitive, and "void" for + * the pseudo-type representing the type of void. + * + * @return the fully qualified names, in order, of the types being + * accessed + */ + public Collection getQualifiedNames() { + return Collections.unmodifiableCollection(names); + } +} diff --git a/langtools/src/share/classes/com/sun/mirror/type/PrimitiveType.java b/langtools/src/share/classes/com/sun/mirror/type/PrimitiveType.java new file mode 100644 index 00000000000..d9ec2f30fab --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/type/PrimitiveType.java @@ -0,0 +1,61 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.type; + + +/** + * Represents a primitive type. These include + * boolean, byte, short, int, + * long, char, float, and double. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface PrimitiveType extends TypeMirror { + + /** + * Returns the kind of primitive type that this object represents. + * + * @return the kind of primitive type that this object represents + */ + Kind getKind(); + + /** + * An enumeration of the different kinds of primitive types. + */ + enum Kind { + /** The primitive type boolean */ BOOLEAN, + /** The primitive type byte */ BYTE, + /** The primitive type short */ SHORT, + /** The primitive type int */ INT, + /** The primitive type long */ LONG, + /** The primitive type char */ CHAR, + /** The primitive type float */ FLOAT, + /** The primitive type double */ DOUBLE + } +} diff --git a/langtools/src/share/classes/com/sun/mirror/type/ReferenceType.java b/langtools/src/share/classes/com/sun/mirror/type/ReferenceType.java new file mode 100644 index 00000000000..862eb87caec --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/type/ReferenceType.java @@ -0,0 +1,39 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.type; + + +/** + * Represents a reference type. + * These include class and interface types, array types, and type variables. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface ReferenceType extends TypeMirror { +} diff --git a/langtools/src/share/classes/com/sun/mirror/type/TypeMirror.java b/langtools/src/share/classes/com/sun/mirror/type/TypeMirror.java new file mode 100644 index 00000000000..6b3033935b8 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/type/TypeMirror.java @@ -0,0 +1,79 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.type; + + +import com.sun.mirror.declaration.Declaration; +import com.sun.mirror.util.Types; +import com.sun.mirror.util.TypeVisitor; + + +/** + * Represents a type in the Java programming language. + * Types include primitive types, class and interface types, array + * types, and type variables. Wildcard type arguments, and the + * pseudo-type representing the type of void, are represented + * by type mirrors as well. + * + *

Types may be compared using the utility methods in + * {@link Types}. + * There is no guarantee that any particular type will + * always be represented by the same object. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * + * @see Declaration + * @see Types + * @since 1.5 + */ + +public interface TypeMirror { + + /** + * Returns a string representation of this type. + * Any names embedded in the expression are qualified. + * + * @return a string representation of this type + */ + String toString(); + + /** + * Tests whether two types represent the same type. + * + * @param obj the object to be compared with this type + * @return true if the specified object represents the same + * type as this. + */ + boolean equals(Object obj); + + /** + * Applies a visitor to this type. + * + * @param v the visitor operating on this type + */ + void accept(TypeVisitor v); +} diff --git a/langtools/src/share/classes/com/sun/mirror/type/TypeVariable.java b/langtools/src/share/classes/com/sun/mirror/type/TypeVariable.java new file mode 100644 index 00000000000..0c5c097b0f5 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/type/TypeVariable.java @@ -0,0 +1,51 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.type; + + +import com.sun.mirror.declaration.*; + + +/** + * Represents a type variable. + * A type variable is declared by a + * {@linkplain TypeParameterDeclaration type parameter} of a + * type, method, or constructor. + * + * @author Joe Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface TypeVariable extends ReferenceType { + + /** + * Returns the type parameter that declared this type variable. + * + * @return the type parameter that declared this type variable + */ + TypeParameterDeclaration getDeclaration(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/type/VoidType.java b/langtools/src/share/classes/com/sun/mirror/type/VoidType.java new file mode 100644 index 00000000000..b913e7fdb25 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/type/VoidType.java @@ -0,0 +1,43 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.type; + + +import com.sun.mirror.declaration.MethodDeclaration; + + +/** + * A pseudo-type representing the type of void. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * + * @see MethodDeclaration#getReturnType() + * @since 1.5 + */ + +public interface VoidType extends TypeMirror { +} diff --git a/langtools/src/share/classes/com/sun/mirror/type/WildcardType.java b/langtools/src/share/classes/com/sun/mirror/type/WildcardType.java new file mode 100644 index 00000000000..fc0fa48f767 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/type/WildcardType.java @@ -0,0 +1,68 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.type; + + +import java.util.Collection; + + +/** + * Represents a wildcard type argument. + * Examples include:


+ *   ?
+ *   ? extends Number
+ *   ? super T
+ * 
+ * + *

A wildcard may have its upper bound explicitly set by an + * extends clause, its lower bound explicitly set by a + * super clause, or neither (but not both). + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface WildcardType extends TypeMirror { + + /** + * Returns the upper bounds of this wildcard. + * If no upper bound is explicitly declared, then + * an empty collection is returned. + * + * @return the upper bounds of this wildcard + */ + Collection getUpperBounds(); + + /** + * Returns the lower bounds of this wildcard. + * If no lower bound is explicitly declared, then + * an empty collection is returned. + * + * @return the lower bounds of this wildcard + */ + Collection getLowerBounds(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/type/package.html b/langtools/src/share/classes/com/sun/mirror/type/package.html new file mode 100644 index 00000000000..cb83900545d --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/type/package.html @@ -0,0 +1,42 @@ + + + + + + + + +Interfaces used to model types. +A type is represented by the appropriate subinterface of +{@link com.sun.mirror.type.TypeMirror}. + +

Note that the apt tool and its associated APIs may be +changed or superseded in future j2se releases. + +@since 1.5 + + diff --git a/langtools/src/share/classes/com/sun/mirror/util/DeclarationFilter.java b/langtools/src/share/classes/com/sun/mirror/util/DeclarationFilter.java new file mode 100644 index 00000000000..83936dd4e2c --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/util/DeclarationFilter.java @@ -0,0 +1,313 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.util; + + +import java.util.ArrayList; +import java.util.Collection; + +import com.sun.mirror.declaration.Declaration; +import com.sun.mirror.declaration.Modifier; + +import static com.sun.mirror.declaration.Modifier.*; + + +/** + * A filter for selecting just the items of interest + * from a collection of declarations. + * The filter is said to select or to match those declarations. + * Filters can be created in several ways: + * by the static methods described below, + * by negating or composing existing filters, + * or by subclasses that implement arbitrary matching rules. + * + *

A subclass can create an arbitrary filter simply by implementing + * the {@link #matches(Declaration)} method. + * + *

Examples. + *

Selecting the public declarations from a collection: + *

+ *     result = FILTER_PUBLIC.filter(decls);            
+ * Selecting class declarations (including enums): + *
+ *     classFilter = DeclarationFilter.getFilter(ClassDeclaration.class);
+ *     result = classFilter.filter(decls);              
+ * Selecting class declarations but excluding enums: + *
+ *     enumFilter = DeclarationFilter.getFilter(EnumDeclaration.class);
+ *     compoundFilter = classFilter.and(enumFilter.not());
+ *     result = compoundFilter.filter(decls);           
+ * Selecting declarations named "Bob": + *
+ *     nameFilter = new DeclarationFilter() {
+ *                      public boolean matches(Declaration d) {
+ *                          return d.getSimpleName().equals("Bob");
+ *                      }
+ *                  };
+ *     result = nameFilter.filter(decls);               
+ * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public class DeclarationFilter { + + // Predefined filters for convenience. + + /** + * A filter that selects only public declarations. + */ + public static final DeclarationFilter FILTER_PUBLIC = + new AccessFilter(PUBLIC); + + /** + * A filter that selects only protected declarations. + */ + public static final DeclarationFilter FILTER_PROTECTED = + new AccessFilter(PROTECTED); + + /** + * A filter that selects only public or protected + * declarations. + */ + public static final DeclarationFilter FILTER_PUBLIC_OR_PROTECTED = + new AccessFilter(PUBLIC, PROTECTED); + + /** + * A filter that selects only package-private (default) + * declarations. + */ + public static final DeclarationFilter FILTER_PACKAGE = + new AccessFilter(); + + /** + * A filter that selects only private declarations. + */ + public static final DeclarationFilter FILTER_PRIVATE = + new AccessFilter(PRIVATE); + + + /** + * Constructs an identity filter: one that selects all declarations. + */ + public DeclarationFilter() { + } + + + + // Methods to create a filter. + + /** + * Returns a filter that selects declarations containing all of a + * collection of modifiers. + * + * @param mods the modifiers to match (non-null) + * @return a filter that matches declarations containing mods + */ + public static DeclarationFilter getFilter( + final Collection mods) { + return new DeclarationFilter() { + public boolean matches(Declaration d) { + return d.getModifiers().containsAll(mods); + } + }; + } + + /** + * Returns a filter that selects declarations of a particular kind. + * For example, there may be a filter that selects only class + * declarations, or only fields. + * The filter will select declarations of the specified kind, + * and also any subtypes of that kind; for example, a field filter + * will also select enum constants. + * + * @param kind the kind of declarations to select + * @return a filter that selects declarations of a particular kind + */ + public static DeclarationFilter getFilter( + final Class kind) { + return new DeclarationFilter() { + public boolean matches(Declaration d) { + return kind.isInstance(d); + } + }; + } + + /** + * Returns a filter that selects those declarations selected + * by both this filter and another. + * + * @param f filter to be composed with this one + * @return a filter that selects those declarations selected by + * both this filter and another + */ + public DeclarationFilter and(DeclarationFilter f) { + final DeclarationFilter f1 = this; + final DeclarationFilter f2 = f; + return new DeclarationFilter() { + public boolean matches(Declaration d) { + return f1.matches(d) && f2.matches(d); + } + }; + } + + /** + * Returns a filter that selects those declarations selected + * by either this filter or another. + * + * @param f filter to be composed with this one + * @return a filter that selects those declarations selected by + * either this filter or another + */ + public DeclarationFilter or(DeclarationFilter f) { + final DeclarationFilter f1 = this; + final DeclarationFilter f2 = f; + return new DeclarationFilter() { + public boolean matches(Declaration d) { + return f1.matches(d) || f2.matches(d); + } + }; + } + + /** + * Returns a filter that selects those declarations not selected + * by this filter. + * + * @return a filter that selects those declarations not selected + * by this filter + */ + public DeclarationFilter not() { + return new DeclarationFilter() { + public boolean matches(Declaration d) { + return !DeclarationFilter.this.matches(d); + } + }; + } + + + + // Methods to apply a filter. + + /** + * Tests whether this filter matches a given declaration. + * The default implementation always returns true; + * subclasses should override this. + * + * @param decl the declaration to match + * @return true if this filter matches the given declaration + */ + public boolean matches(Declaration decl) { + return true; + } + + /** + * Returns the declarations matched by this filter. + * The result is a collection of the same type as the argument; + * the {@linkplain #filter(Collection, Class) two-parameter version} + * of filter offers control over the result type. + * + * @param type of the declarations being filtered + * @param decls declarations being filtered + * @return the declarations matched by this filter + */ + public Collection filter(Collection decls) { + ArrayList res = new ArrayList(decls.size()); + for (D d : decls) { + if (matches(d)) { + res.add(d); + } + } + return res; + } + + /** + * Returns the declarations matched by this filter, with the result + * being restricted to declarations of a given kind. + * Similar to the simpler + * {@linkplain #filter(Collection) single-parameter version} + * of filter, but the result type is specified explicitly. + * + * @param type of the declarations being returned + * @param decls declarations being filtered + * @param resType type of the declarations being returned -- + * the reflective view of D + * @return the declarations matched by this filter, restricted to those + * of the specified type + */ + public Collection + filter(Collection decls, Class resType) { + ArrayList res = new ArrayList(decls.size()); + for (Declaration d : decls) { + if (resType.isInstance(d) && matches(d)) { + res.add(resType.cast(d)); + } + } + return res; + } + + + + /* + * A filter based on access modifiers. + */ + private static class AccessFilter extends DeclarationFilter { + + // The first access modifier to filter on, or null if we're looking + // for declarations with no access modifiers. + private Modifier mod1 = null; + + // The second access modifier to filter on, or null if none. + private Modifier mod2 = null; + + // Returns a filter that matches declarations with no access + // modifiers. + AccessFilter() { + } + + // Returns a filter that matches m. + AccessFilter(Modifier m) { + mod1 = m; + } + + // Returns a filter that matches either m1 or m2. + AccessFilter(Modifier m1, Modifier m2) { + mod1 = m1; + mod2 = m2; + } + + public boolean matches(Declaration d) { + Collection mods = d.getModifiers(); + if (mod1 == null) { // looking for package private + return !(mods.contains(PUBLIC) || + mods.contains(PROTECTED) || + mods.contains(PRIVATE)); + } + return mods.contains(mod1) && + (mod2 == null || mods.contains(mod2)); + } + } +} diff --git a/langtools/src/share/classes/com/sun/mirror/util/DeclarationScanner.java b/langtools/src/share/classes/com/sun/mirror/util/DeclarationScanner.java new file mode 100644 index 00000000000..6dbb275a538 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/util/DeclarationScanner.java @@ -0,0 +1,261 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.util; + +import com.sun.mirror.declaration.*; + +/** + * A visitor for declarations that scans declarations contained within + * the given declaration. For example, when visiting a class, the + * methods, fields, constructors, and nested types of the class are + * also visited. + * + *

To control the processing done on a declaration, users of this + * class pass in their own visitors for pre and post processing. The + * preprocessing visitor is called before the contained declarations + * are scanned; the postprocessing visitor is called after the + * contained declarations are scanned. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +class DeclarationScanner implements DeclarationVisitor { + protected DeclarationVisitor pre; + protected DeclarationVisitor post; + + DeclarationScanner(DeclarationVisitor pre, DeclarationVisitor post) { + this.pre = pre; + this.post = post; + } + + /** + * Visits a declaration. + * + * @param d the declaration to visit + */ + public void visitDeclaration(Declaration d) { + d.accept(pre); + d.accept(post); + } + + /** + * Visits a package declaration. + * + * @param d the declaration to visit + */ + public void visitPackageDeclaration(PackageDeclaration d) { + d.accept(pre); + + for(ClassDeclaration classDecl: d.getClasses()) { + classDecl.accept(this); + } + + for(InterfaceDeclaration interfaceDecl: d.getInterfaces()) { + interfaceDecl.accept(this); + } + + d.accept(post); + } + + /** + * Visits a member or constructor declaration. + * + * @param d the declaration to visit + */ + public void visitMemberDeclaration(MemberDeclaration d) { + visitDeclaration(d); + } + + /** + * Visits a type declaration. + * + * @param d the declaration to visit + */ + public void visitTypeDeclaration(TypeDeclaration d) { + d.accept(pre); + + for(TypeParameterDeclaration tpDecl: d.getFormalTypeParameters()) { + tpDecl.accept(this); + } + + for(FieldDeclaration fieldDecl: d.getFields()) { + fieldDecl.accept(this); + } + + for(MethodDeclaration methodDecl: d.getMethods()) { + methodDecl.accept(this); + } + + for(TypeDeclaration typeDecl: d.getNestedTypes()) { + typeDecl.accept(this); + } + + d.accept(post); + } + + /** + * Visits a class declaration. + * + * @param d the declaration to visit + */ + public void visitClassDeclaration(ClassDeclaration d) { + d.accept(pre); + + for(TypeParameterDeclaration tpDecl: d.getFormalTypeParameters()) { + tpDecl.accept(this); + } + + for(FieldDeclaration fieldDecl: d.getFields()) { + fieldDecl.accept(this); + } + + for(MethodDeclaration methodDecl: d.getMethods()) { + methodDecl.accept(this); + } + + for(TypeDeclaration typeDecl: d.getNestedTypes()) { + typeDecl.accept(this); + } + + for(ConstructorDeclaration ctorDecl: d.getConstructors()) { + ctorDecl.accept(this); + } + + d.accept(post); + } + + /** + * Visits an enum declaration. + * + * @param d the declaration to visit + */ + public void visitEnumDeclaration(EnumDeclaration d) { + visitClassDeclaration(d); + } + + /** + * Visits an interface declaration. + * + * @param d the declaration to visit + */ + public void visitInterfaceDeclaration(InterfaceDeclaration d) { + visitTypeDeclaration(d); + } + + /** + * Visits an annotation type declaration. + * + * @param d the declaration to visit + */ + public void visitAnnotationTypeDeclaration(AnnotationTypeDeclaration d) { + visitInterfaceDeclaration(d); + } + + /** + * Visits a field declaration. + * + * @param d the declaration to visit + */ + public void visitFieldDeclaration(FieldDeclaration d) { + visitMemberDeclaration(d); + } + + /** + * Visits an enum constant declaration. + * + * @param d the declaration to visit + */ + public void visitEnumConstantDeclaration(EnumConstantDeclaration d) { + visitFieldDeclaration(d); + } + + /** + * Visits a method or constructor declaration. + * + * @param d the declaration to visit + */ + public void visitExecutableDeclaration(ExecutableDeclaration d) { + d.accept(pre); + + for(TypeParameterDeclaration tpDecl: d.getFormalTypeParameters()) { + tpDecl.accept(this); + } + + for(ParameterDeclaration pDecl: d.getParameters()) { + pDecl.accept(this); + } + + d.accept(post); + } + + /** + * Visits a constructor declaration. + * + * @param d the declaration to visit + */ + public void visitConstructorDeclaration(ConstructorDeclaration d) { + visitExecutableDeclaration(d); + } + + /** + * Visits a method declaration. + * + * @param d the declaration to visit + */ + public void visitMethodDeclaration(MethodDeclaration d) { + visitExecutableDeclaration(d); + } + + /** + * Visits an annotation type element declaration. + * + * @param d the declaration to visit + */ + public void visitAnnotationTypeElementDeclaration( + AnnotationTypeElementDeclaration d) { + visitMethodDeclaration(d); + } + + /** + * Visits a parameter declaration. + * + * @param d the declaration to visit + */ + public void visitParameterDeclaration(ParameterDeclaration d) { + visitDeclaration(d); + } + + /** + * Visits a type parameter declaration. + * + * @param d the declaration to visit + */ + public void visitTypeParameterDeclaration(TypeParameterDeclaration d) { + visitDeclaration(d); + } +} diff --git a/langtools/src/share/classes/com/sun/mirror/util/DeclarationVisitor.java b/langtools/src/share/classes/com/sun/mirror/util/DeclarationVisitor.java new file mode 100644 index 00000000000..4b3806efefe --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/util/DeclarationVisitor.java @@ -0,0 +1,143 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.util; + +import com.sun.mirror.declaration.*; + + +/** + * A visitor for declarations, in the style of the standard visitor + * design pattern. Classes implementing this interface are used to + * operate on a declaration when the kind of declaration is unknown at + * compile time. When a visitor is passed to a declaration's {@link + * Declaration#accept accept} method, the most specific + * visitXxx method applicable to that declaration is + * invoked. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface DeclarationVisitor { + + /** + * Visits a declaration. + * @param d the declaration to visit + */ + public void visitDeclaration(Declaration d); + + /** + * Visits a package declaration. + * @param d the declaration to visit + */ + public void visitPackageDeclaration(PackageDeclaration d); + + /** + * Visits a member or constructor declaration. + * @param d the declaration to visit + */ + public void visitMemberDeclaration(MemberDeclaration d); + + /** + * Visits a type declaration. + * @param d the declaration to visit + */ + public void visitTypeDeclaration(TypeDeclaration d); + + /** + * Visits a class declaration. + * @param d the declaration to visit + */ + public void visitClassDeclaration(ClassDeclaration d); + + /** + * Visits an enum declaration. + * @param d the declaration to visit + */ + public void visitEnumDeclaration(EnumDeclaration d); + + /** + * Visits an interface declaration. + * @param d the declaration to visit + */ + public void visitInterfaceDeclaration(InterfaceDeclaration d); + + /** + * Visits an annotation type declaration. + * @param d the declaration to visit + */ + public void visitAnnotationTypeDeclaration(AnnotationTypeDeclaration d); + + /** + * Visits a field declaration. + * @param d the declaration to visit + */ + public void visitFieldDeclaration(FieldDeclaration d); + + /** + * Visits an enum constant declaration. + * @param d the declaration to visit + */ + public void visitEnumConstantDeclaration(EnumConstantDeclaration d); + + /** + * Visits a method or constructor declaration. + * @param d the declaration to visit + */ + public void visitExecutableDeclaration(ExecutableDeclaration d); + + /** + * Visits a constructor declaration. + * @param d the declaration to visit + */ + public void visitConstructorDeclaration(ConstructorDeclaration d); + + /** + * Visits a method declaration. + * @param d the declaration to visit + */ + public void visitMethodDeclaration(MethodDeclaration d); + + /** + * Visits an annotation type element declaration. + * @param d the declaration to visit + */ + public void visitAnnotationTypeElementDeclaration( + AnnotationTypeElementDeclaration d); + + /** + * Visits a parameter declaration. + * @param d the declaration to visit + */ + public void visitParameterDeclaration(ParameterDeclaration d); + + /** + * Visits a type parameter declaration. + * @param d the declaration to visit + */ + public void visitTypeParameterDeclaration(TypeParameterDeclaration d); +} diff --git a/langtools/src/share/classes/com/sun/mirror/util/DeclarationVisitors.java b/langtools/src/share/classes/com/sun/mirror/util/DeclarationVisitors.java new file mode 100644 index 00000000000..9188be76ae1 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/util/DeclarationVisitors.java @@ -0,0 +1,97 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.util; + +/** + * Utilities to create specialized DeclarationVisitor instances. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ +public class DeclarationVisitors { + private DeclarationVisitors(){} // do not instantiate. + + /** + * A visitor that has no side effects and keeps no state. + */ + public static final DeclarationVisitor NO_OP = new SimpleDeclarationVisitor(); + + /** + * Return a DeclarationVisitor that will scan the + * declaration structure, visiting declarations contained in + * another declaration. For example, when visiting a class, the + * fields, methods, constructors, etc. of the class are also + * visited. The order in which the contained declarations are scanned is + * not specified. + * + *

The pre and post + * DeclarationVisitor parameters specify, + * respectively, the processing the scanner will do before or + * after visiting the contained declarations. If only one of pre + * and post processing is needed, use {@link + * DeclarationVisitors#NO_OP DeclarationVisitors.NO_OP} for the + * other parameter. + * + * @param pre visitor representing processing to do before + * visiting contained declarations. + * + * @param post visitor representing processing to do after + * visiting contained declarations. + */ + public static DeclarationVisitor getDeclarationScanner(DeclarationVisitor pre, + DeclarationVisitor post) { + return new DeclarationScanner(pre, post); + } + + /** + * Return a DeclarationVisitor that will scan the + * declaration structure, visiting declarations contained in + * another declaration in source code order. For example, when + * visiting a class, the fields, methods, constructors, etc. of + * the class are also visited. The order in which the contained + * declarations are visited is as close to source code order as + * possible; declaration mirrors created from class files instead + * of source code will not have source position information. + * + *

The pre and post + * DeclarationVisitor parameters specify, + * respectively, the processing the scanner will do before or + * after visiting the contained declarations. If only one of pre + * and post processing is needed, use {@link + * DeclarationVisitors#NO_OP DeclarationVisitors.NO_OP} for the other parameter. + * + * @param pre visitor representing processing to do before + * visiting contained declarations. + * + * @param post visitor representing processing to do after + * visiting contained declarations. + */ + public static DeclarationVisitor getSourceOrderDeclarationScanner(DeclarationVisitor pre, + DeclarationVisitor post) { + return new SourceOrderDeclScanner(pre, post); + } +} diff --git a/langtools/src/share/classes/com/sun/mirror/util/Declarations.java b/langtools/src/share/classes/com/sun/mirror/util/Declarations.java new file mode 100644 index 00000000000..fe87fa5a9fa --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/util/Declarations.java @@ -0,0 +1,63 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.util; + + +import com.sun.mirror.declaration.*; + + +/** + * Utility methods for operating on declarations. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface Declarations { + + /** + * Tests whether one type, method, or field declaration hides another. + * + * @param sub the first member + * @param sup the second member + * @return true if and only if the first member hides + * the second + */ + boolean hides(MemberDeclaration sub, MemberDeclaration sup); + + /** + * Tests whether one method overrides another. When a + * non-abstract method overrides an abstract one, the + * former is also said to implement the latter. + * + * @param sub the first method + * @param sup the second method + * @return true if and only if the first method overrides + * the second + */ + boolean overrides(MethodDeclaration sub, MethodDeclaration sup); +} diff --git a/langtools/src/share/classes/com/sun/mirror/util/SimpleDeclarationVisitor.java b/langtools/src/share/classes/com/sun/mirror/util/SimpleDeclarationVisitor.java new file mode 100644 index 00000000000..7b0ed87e894 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/util/SimpleDeclarationVisitor.java @@ -0,0 +1,210 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.util; + + +import com.sun.mirror.declaration.*; + + +/** + * A simple visitor for declarations. + * + *

The implementations of the methods of this class do nothing but + * delegate up the declaration hierarchy. A subclass should override the + * methods that correspond to the kinds of declarations on which it + * will operate. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public class SimpleDeclarationVisitor implements DeclarationVisitor { + + /** + * Creates a new SimpleDeclarationVisitor. + */ + public SimpleDeclarationVisitor(){} + + /** + * Visits a declaration. + * The implementation does nothing. + * @param d the declaration to visit + */ + public void visitDeclaration(Declaration d) { + } + + /** + * Visits a package declaration. + * The implementation simply invokes + * {@link #visitDeclaration visitDeclaration}. + * @param d the declaration to visit + */ + public void visitPackageDeclaration(PackageDeclaration d) { + visitDeclaration(d); + } + + /** + * Visits a member or constructor declaration. + * The implementation simply invokes + * {@link #visitDeclaration visitDeclaration}. + * @param d the declaration to visit + */ + public void visitMemberDeclaration(MemberDeclaration d) { + visitDeclaration(d); + } + + /** + * Visits a type declaration. + * The implementation simply invokes + * {@link #visitMemberDeclaration visitMemberDeclaration}. + * @param d the declaration to visit + */ + public void visitTypeDeclaration(TypeDeclaration d) { + visitMemberDeclaration(d); + } + + /** + * Visits a class declaration. + * The implementation simply invokes + * {@link #visitTypeDeclaration visitTypeDeclaration}. + * @param d the declaration to visit + */ + public void visitClassDeclaration(ClassDeclaration d) { + visitTypeDeclaration(d); + } + + /** + * Visits an enum declaration. + * The implementation simply invokes + * {@link #visitClassDeclaration visitClassDeclaration}. + * @param d the declaration to visit + */ + public void visitEnumDeclaration(EnumDeclaration d) { + visitClassDeclaration(d); + } + + /** + * Visits an interface declaration. + * The implementation simply invokes + * {@link #visitTypeDeclaration visitTypeDeclaration}. + * @param d the declaration to visit + */ + public void visitInterfaceDeclaration(InterfaceDeclaration d) { + visitTypeDeclaration(d); + } + + /** + * Visits an annotation type declaration. + * The implementation simply invokes + * {@link #visitInterfaceDeclaration visitInterfaceDeclaration}. + * @param d the declaration to visit + */ + public void visitAnnotationTypeDeclaration(AnnotationTypeDeclaration d) { + visitInterfaceDeclaration(d); + } + + /** + * Visits a field declaration. + * The implementation simply invokes + * {@link #visitMemberDeclaration visitMemberDeclaration}. + * @param d the declaration to visit + */ + public void visitFieldDeclaration(FieldDeclaration d) { + visitMemberDeclaration(d); + } + + /** + * Visits an enum constant declaration. + * The implementation simply invokes + * {@link #visitFieldDeclaration visitFieldDeclaration}. + * @param d the declaration to visit + */ + public void visitEnumConstantDeclaration(EnumConstantDeclaration d) { + visitFieldDeclaration(d); + } + + /** + * Visits a method or constructor declaration. + * The implementation simply invokes + * {@link #visitMemberDeclaration visitMemberDeclaration}. + * @param d the declaration to visit + */ + public void visitExecutableDeclaration(ExecutableDeclaration d) { + visitMemberDeclaration(d); + } + + /** + * Visits a constructor declaration. + * The implementation simply invokes + * {@link #visitExecutableDeclaration visitExecutableDeclaration}. + * @param d the declaration to visit + */ + public void visitConstructorDeclaration(ConstructorDeclaration d) { + visitExecutableDeclaration(d); + } + + /** + * Visits a method declaration. + * The implementation simply invokes + * {@link #visitExecutableDeclaration visitExecutableDeclaration}. + * @param d the declaration to visit + */ + public void visitMethodDeclaration(MethodDeclaration d) { + visitExecutableDeclaration(d); + } + + /** + * Visits an annotation type element declaration. + * The implementation simply invokes + * {@link #visitMethodDeclaration visitMethodDeclaration}. + * @param d the declaration to visit + */ + public void visitAnnotationTypeElementDeclaration( + AnnotationTypeElementDeclaration d) { + visitMethodDeclaration(d); + } + + /** + * Visits a parameter declaration. + * The implementation simply invokes + * {@link #visitDeclaration visitDeclaration}. + * @param d the declaration to visit + */ + public void visitParameterDeclaration(ParameterDeclaration d) { + visitDeclaration(d); + } + + /** + * Visits a type parameter declaration. + * The implementation simply invokes + * {@link #visitDeclaration visitDeclaration}. + * @param d the declaration to visit + */ + public void visitTypeParameterDeclaration(TypeParameterDeclaration d) { + visitDeclaration(d); + } +} diff --git a/langtools/src/share/classes/com/sun/mirror/util/SimpleTypeVisitor.java b/langtools/src/share/classes/com/sun/mirror/util/SimpleTypeVisitor.java new file mode 100644 index 00000000000..eaa37b3dbef --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/util/SimpleTypeVisitor.java @@ -0,0 +1,169 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.util; + + +import com.sun.mirror.type.*; + + +/** + * A simple visitor for types. + * + *

The implementations of the methods of this class do nothing but + * delegate up the type hierarchy. A subclass should override the + * methods that correspond to the kinds of types on which it will + * operate. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public class SimpleTypeVisitor implements TypeVisitor { + + /** + * Creates a new SimpleTypeVisitor. + */ + public SimpleTypeVisitor() {} + + /** + * Visits a type mirror. + * The implementation does nothing. + * @param t the type to visit + */ + public void visitTypeMirror(TypeMirror t) { + } + + /** + * Visits a primitive type. + * The implementation simply invokes + * {@link #visitTypeMirror visitTypeMirror}. + * @param t the type to visit + */ + public void visitPrimitiveType(PrimitiveType t) { + visitTypeMirror(t); + } + + /** + * Visits a void type. + * The implementation simply invokes + * {@link #visitTypeMirror visitTypeMirror}. + * @param t the type to visit + */ + public void visitVoidType(VoidType t) { + visitTypeMirror(t); + } + + /** + * Visits a reference type. + * The implementation simply invokes + * {@link #visitTypeMirror visitTypeMirror}. + * @param t the type to visit + */ + public void visitReferenceType(ReferenceType t) { + visitTypeMirror(t); + } + + /** + * Visits a declared type. + * The implementation simply invokes + * {@link #visitReferenceType visitReferenceType}. + * @param t the type to visit + */ + public void visitDeclaredType(DeclaredType t) { + visitReferenceType(t); + } + + /** + * Visits a class type. + * The implementation simply invokes + * {@link #visitDeclaredType visitDeclaredType}. + * @param t the type to visit + */ + public void visitClassType(ClassType t) { + visitDeclaredType(t); + } + + /** + * Visits an enum type. + * The implementation simply invokes + * {@link #visitClassType visitClassType}. + * @param t the type to visit + */ + public void visitEnumType(EnumType t) { + visitClassType(t); + } + + /** + * Visits an interface type. + * The implementation simply invokes + * {@link #visitDeclaredType visitDeclaredType}. + * @param t the type to visit + */ + public void visitInterfaceType(InterfaceType t) { + visitDeclaredType(t); + } + + /** + * Visits an annotation type. + * The implementation simply invokes + * {@link #visitInterfaceType visitInterfaceType}. + * @param t the type to visit + */ + public void visitAnnotationType(AnnotationType t) { + visitInterfaceType(t); + } + + /** + * Visits an array type. + * The implementation simply invokes + * {@link #visitReferenceType visitReferenceType}. + * @param t the type to visit + */ + public void visitArrayType(ArrayType t) { + visitReferenceType(t); + } + + /** + * Visits a type variable. + * The implementation simply invokes + * {@link #visitReferenceType visitReferenceType}. + * @param t the type to visit + */ + public void visitTypeVariable(TypeVariable t) { + visitReferenceType(t); + } + + /** + * Visits a wildcard. + * The implementation simply invokes + * {@link #visitTypeMirror visitTypeMirror}. + * @param t the type to visit + */ + public void visitWildcardType(WildcardType t) { + visitTypeMirror(t); + } +} diff --git a/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java b/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java new file mode 100644 index 00000000000..3b6e62bec12 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/util/SourceOrderDeclScanner.java @@ -0,0 +1,247 @@ +/* + * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.util; + +import com.sun.mirror.declaration.*; + +import java.util.SortedSet; +import java.util.TreeSet; + +/** + * A visitor for declarations that scans declarations contained within + * the given declaration in source code order. For example, when + * visiting a class, the methods, fields, constructors, and nested + * types of the class are also visited. + * + * To control the processing done on a declaration, users of this + * class pass in their own visitors for pre and post processing. The + * preprocessing visitor is called before the contained declarations + * are scanned; the postprocessing visitor is called after the + * contained declarations are scanned. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ +class SourceOrderDeclScanner extends DeclarationScanner { + static class SourceOrderComparator implements java.util.Comparator { + SourceOrderComparator(){} + + + static boolean equals(Declaration d1, Declaration d2) { + return d1 == d2 || (d1 != null && d1.equals(d2)); + } + + private static class DeclPartialOrder extends com.sun.mirror.util.SimpleDeclarationVisitor { + private int value = 1000; + private static int staticAdjust(Declaration d) { + return d.getModifiers().contains(Modifier.STATIC)?0:1; + } + + DeclPartialOrder() {} + + public int getValue() { return value; } + + @Override + public void visitTypeParameterDeclaration(TypeParameterDeclaration d) {value = 0;} + + @Override + public void visitEnumConstantDeclaration(EnumConstantDeclaration d) {value = 1;} + + @Override + public void visitClassDeclaration(ClassDeclaration d) {value = 2 + staticAdjust(d);} + + @Override + public void visitInterfaceDeclaration(InterfaceDeclaration d) {value = 4;} + + @Override + public void visitEnumDeclaration(EnumDeclaration d) {value = 6;} + + @Override + public void visitAnnotationTypeDeclaration(AnnotationTypeDeclaration d) {value = 8;} + + @Override + public void visitFieldDeclaration(FieldDeclaration d) {value = 10 + staticAdjust(d);} + + @Override + public void visitConstructorDeclaration(ConstructorDeclaration d) {value = 12;} + + @Override + public void visitMethodDeclaration(MethodDeclaration d) {value = 14 + staticAdjust(d);} + } + @SuppressWarnings("cast") + private int compareEqualPosition(Declaration d1, Declaration d2) { + assert d1.getPosition() == d2.getPosition(); + + DeclPartialOrder dpo1 = new DeclPartialOrder(); + DeclPartialOrder dpo2 = new DeclPartialOrder(); + + d1.accept(dpo1); + d2.accept(dpo2); + + int difference = dpo1.getValue() - dpo2.getValue(); + if (difference != 0) + return difference; + else { + int result = d1.getSimpleName().compareTo(d2.getSimpleName()); + if (result != 0) + return result; + return (int)( Long.signum((long)System.identityHashCode(d1) - + (long)System.identityHashCode(d2))); + } + } + + public int compare(Declaration d1, Declaration d2) { + if (equals(d1, d2)) + return 0; + + SourcePosition p1 = d1.getPosition(); + SourcePosition p2 = d2.getPosition(); + + if (p1 == null && p2 != null) + return 1; + else if (p1 != null && p2 == null) + return -1; + else if(p1 == null && p2 == null) + return compareEqualPosition(d1, d2); + else { + assert p1 != null && p2 != null; + int fileComp = p1.file().compareTo(p2.file()) ; + if (fileComp == 0) { + long diff = (long)p1.line() - (long)p2.line(); + if (diff == 0) { + diff = Long.signum((long)p1.column() - (long)p2.column()); + if (diff != 0) + return (int)diff; + else { + // declarations may be two + // compiler-generated members with the + // same source position + return compareEqualPosition(d1, d2); + } + } else + return (diff<0)? -1:1; + } else + return fileComp; + } + } + } + + final static java.util.Comparator comparator = new SourceOrderComparator(); + + SourceOrderDeclScanner(DeclarationVisitor pre, DeclarationVisitor post) { + super(pre, post); + } + + /** + * Visits a type declaration. + * + * @param d the declaration to visit + */ + public void visitTypeDeclaration(TypeDeclaration d) { + d.accept(pre); + + SortedSet decls = new + TreeSet(SourceOrderDeclScanner.comparator) ; + + for(TypeParameterDeclaration tpDecl: d.getFormalTypeParameters()) { + decls.add(tpDecl); + } + + for(FieldDeclaration fieldDecl: d.getFields()) { + decls.add(fieldDecl); + } + + for(MethodDeclaration methodDecl: d.getMethods()) { + decls.add(methodDecl); + } + + for(TypeDeclaration typeDecl: d.getNestedTypes()) { + decls.add(typeDecl); + } + + for(Declaration decl: decls ) + decl.accept(this); + + d.accept(post); + } + + /** + * Visits a class declaration. + * + * @param d the declaration to visit + */ + public void visitClassDeclaration(ClassDeclaration d) { + d.accept(pre); + + SortedSet decls = new + TreeSet(SourceOrderDeclScanner.comparator) ; + + for(TypeParameterDeclaration tpDecl: d.getFormalTypeParameters()) { + decls.add(tpDecl); + } + + for(FieldDeclaration fieldDecl: d.getFields()) { + decls.add(fieldDecl); + } + + for(MethodDeclaration methodDecl: d.getMethods()) { + decls.add(methodDecl); + } + + for(TypeDeclaration typeDecl: d.getNestedTypes()) { + decls.add(typeDecl); + } + + for(ConstructorDeclaration ctorDecl: d.getConstructors()) { + decls.add(ctorDecl); + } + + for(Declaration decl: decls ) + decl.accept(this); + + d.accept(post); + } + + public void visitExecutableDeclaration(ExecutableDeclaration d) { + d.accept(pre); + + SortedSet decls = new + TreeSet(SourceOrderDeclScanner.comparator) ; + + for(TypeParameterDeclaration tpDecl: d.getFormalTypeParameters()) + decls.add(tpDecl); + + for(ParameterDeclaration pDecl: d.getParameters()) + decls.add(pDecl); + + for(Declaration decl: decls ) + decl.accept(this); + + d.accept(post); + } + +} diff --git a/langtools/src/share/classes/com/sun/mirror/util/SourcePosition.java b/langtools/src/share/classes/com/sun/mirror/util/SourcePosition.java new file mode 100644 index 00000000000..f300d3c19ab --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/util/SourcePosition.java @@ -0,0 +1,66 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.util; + + +import java.io.File; + + +/** + * Represents a position in a source file. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface SourcePosition { + + /** + * Returns the source file containing this position. + * + * @return the source file containing this position; never null + */ + File file(); + + /** + * Returns the line number of this position. Lines are numbered + * starting with 1. + * + * @return the line number of this position, or 0 if the line + * number is unknown or not applicable + */ + int line(); + + /** + * Returns the column number of this position. Columns are numbered + * starting with 1. + * + * @return the column number of this position, or 0 if the column + * number is unknown or not applicable + */ + int column(); +} diff --git a/langtools/src/share/classes/com/sun/mirror/util/TypeVisitor.java b/langtools/src/share/classes/com/sun/mirror/util/TypeVisitor.java new file mode 100644 index 00000000000..4df15f551d6 --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/util/TypeVisitor.java @@ -0,0 +1,131 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.util; + + +import com.sun.mirror.type.*; + + +/** + * A visitor for types, in the style of the standard visitor design pattern. + * This is used to operate on a type when the kind + * of type is unknown at compile time. + * When a visitor is passed to a type's + * {@link TypeMirror#accept accept} method, + * the most specific visitXxx method applicable to + * that type is invoked. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface TypeVisitor { + + /** + * Visits a type mirror. + * + * @param t the type to visit + */ + public void visitTypeMirror(TypeMirror t); + + /** + * Visits a primitive type. + + * @param t the type to visit + */ + public void visitPrimitiveType(PrimitiveType t); + + /** + * Visits a void type. + * + * @param t the type to visit + */ + public void visitVoidType(VoidType t); + + /** + * Visits a reference type. + * + * @param t the type to visit + */ + public void visitReferenceType(ReferenceType t); + + /** + * Visits a declared type. + * + * @param t the type to visit + */ + public void visitDeclaredType(DeclaredType t); + + /** + * Visits a class type. + * + * @param t the type to visit + */ + public void visitClassType(ClassType t); + + /** + * Visits an enum type. + * + * @param t the type to visit + */ + public void visitEnumType(EnumType t); + + /** + * Visits an interface type. + * + * @param t the type to visit + */ + public void visitInterfaceType(InterfaceType t); + + /** + * Visits an annotation type. + * + * @param t the type to visit + */ + public void visitAnnotationType(AnnotationType t); + + /** + * Visits an array type. + * + * @param t the type to visit + */ + public void visitArrayType(ArrayType t); + + /** + * Visits a type variable. + * + * @param t the type to visit + */ + public void visitTypeVariable(TypeVariable t); + + /** + * Visits a wildcard. + * + * @param t the type to visit + */ + public void visitWildcardType(WildcardType t); +} diff --git a/langtools/src/share/classes/com/sun/mirror/util/Types.java b/langtools/src/share/classes/com/sun/mirror/util/Types.java new file mode 100644 index 00000000000..8bb2512105f --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/util/Types.java @@ -0,0 +1,183 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.mirror.util; + + +import java.util.Collection; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.type.*; + + +/** + * Utility methods for operating on types. + * + * @author Joseph D. Darcy + * @author Scott Seligman + * @since 1.5 + */ + +public interface Types { + + /** + * Tests whether one type is a subtype of the another. + * Any type is considered to be a subtype of itself. + * + * @param t1 the first type + * @param t2 the second type + * @return true if and only if the first type is a subtype + * of the second + */ + boolean isSubtype(TypeMirror t1, TypeMirror t2); + + /** + * Tests whether one type is assignable to another. + * + * @param t1 the first type + * @param t2 the second type + * @return true if and only if the first type is assignable + * to the second + */ + boolean isAssignable(TypeMirror t1, TypeMirror t2); + + /** + * Returns the erasure of a type. + * + * @param t the type to be erased + * @return the erasure of the given type + */ + TypeMirror getErasure(TypeMirror t); + + /** + * Returns a primitive type. + * + * @param kind the kind of primitive type to return + * @return a primitive type + */ + PrimitiveType getPrimitiveType(PrimitiveType.Kind kind); + + /** + * Returns the pseudo-type representing the type of void. + * + * @return the pseudo-type representing the type of void + */ + VoidType getVoidType(); + + /** + * Returns an array type with the specified component type. + * + * @param componentType the component type + * @return an array type with the specified component type. + * @throws IllegalArgumentException if the component type is not valid for + * an array + */ + ArrayType getArrayType(TypeMirror componentType); + + /** + * Returns the type variable declared by a type parameter. + * + * @param tparam the type parameter + * @return the type variable declared by the type parameter + */ + TypeVariable getTypeVariable(TypeParameterDeclaration tparam); + + /** + * Returns a new wildcard. + * Either the wildcards's upper bounds or lower bounds may be + * specified, or neither, but not both. + * + * @param upperBounds the upper bounds of this wildcard, + * or an empty collection if none + * @param lowerBounds the lower bounds of this wildcard, + * or an empty collection if none + * @return a new wildcard + * @throws IllegalArgumentException if bounds are not valid + */ + WildcardType getWildcardType(Collection upperBounds, + Collection lowerBounds); + + /** + * Returns the type corresponding to a type declaration and + * actual type arguments. + * Given the declaration for String, for example, this + * method may be used to get the String type. It may + * then be invoked a second time, with the declaration for Set, + * to make the parameterized type {@code Set}. + * + *

The number of type arguments must either equal the + * number of the declaration's formal type parameters, or must be + * zero. If zero, and if the declaration is generic, + * then the declaration's raw type is returned. + * + *

If a parameterized type is being returned, its declaration + * must not be contained within a generic outer class. + * The parameterized type {@code Outer.Inner}, + * for example, may be constructed by first using this + * method to get the type {@code Outer}, and then invoking + * {@link #getDeclaredType(DeclaredType, TypeDeclaration, TypeMirror...)}. + * + * @param decl the type declaration + * @param typeArgs the actual type arguments + * @return the type corresponding to the type declaration and + * actual type arguments + * @throws IllegalArgumentException if too many or too few + * type arguments are given, or if an inappropriate type + * argument or declaration is provided + */ + DeclaredType getDeclaredType(TypeDeclaration decl, + TypeMirror... typeArgs); + + /** + * Returns the type corresponding to a type declaration + * and actual arguments, given a + * {@linkplain DeclaredType#getContainingType() containing type} + * of which it is a member. + * The parameterized type {@code Outer.Inner}, + * for example, may be constructed by first using + * {@link #getDeclaredType(TypeDeclaration, TypeMirror...)} + * to get the type {@code Outer}, and then invoking + * this method. + * + *

If the containing type is a parameterized type, + * the number of type arguments must equal the + * number of the declaration's formal type parameters. + * If it is not parameterized or if it is null, this method is + * equivalent to getDeclaredType(decl, typeArgs). + * + * @param containing the containing type, or null if none + * @param decl the type declaration + * @param typeArgs the actual type arguments + * @return the type corresponding to the type declaration and + * actual type arguments, + * contained within the given type + * @throws IllegalArgumentException if too many or too few + * type arguments are given, or if an inappropriate type + * argument, declaration, or containing type is provided + */ + DeclaredType getDeclaredType(DeclaredType containing, + TypeDeclaration decl, + TypeMirror... typeArgs); +} diff --git a/langtools/src/share/classes/com/sun/mirror/util/package.html b/langtools/src/share/classes/com/sun/mirror/util/package.html new file mode 100644 index 00000000000..ef3e71d8dea --- /dev/null +++ b/langtools/src/share/classes/com/sun/mirror/util/package.html @@ -0,0 +1,42 @@ + + + + + + + + +Utilities to assist in the processing of {@linkplain +com.sun.mirror.declaration declarations} and {@linkplain +com.sun.mirror.type types}. + +

Note that the apt tool and its associated APIs may be +changed or superseded in future j2se releases. + +@since 1.5 + + diff --git a/langtools/src/share/classes/com/sun/source/tree/AnnotationTree.java b/langtools/src/share/classes/com/sun/source/tree/AnnotationTree.java new file mode 100644 index 00000000000..f7b2e1a117f --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/AnnotationTree.java @@ -0,0 +1,48 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import java.util.List; + +/** + * A tree node for an annotation. + * + * For example: + *

+ *    {@code @}annotationType
+ *    {@code @}annotationType ( arguments )
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 9.7" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface AnnotationTree extends ExpressionTree { + Tree getAnnotationType(); + List getArguments(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/ArrayAccessTree.java b/langtools/src/share/classes/com/sun/source/tree/ArrayAccessTree.java new file mode 100644 index 00000000000..52db7f122f3 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/ArrayAccessTree.java @@ -0,0 +1,45 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for an array access expression. + * + * For example: + *
+ *   expression [ index ]
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 15.13" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface ArrayAccessTree extends ExpressionTree { + ExpressionTree getExpression(); + ExpressionTree getIndex(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/ArrayTypeTree.java b/langtools/src/share/classes/com/sun/source/tree/ArrayTypeTree.java new file mode 100644 index 00000000000..41a247a18b1 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/ArrayTypeTree.java @@ -0,0 +1,44 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for an array type. + * + * For example: + *
+ *   type []
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 10.1" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface ArrayTypeTree extends Tree { + Tree getType(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/AssertTree.java b/langtools/src/share/classes/com/sun/source/tree/AssertTree.java new file mode 100644 index 00000000000..77b8f575d95 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/AssertTree.java @@ -0,0 +1,47 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for an 'assert' statement. + * + * For example: + *
+ *   assert condition ;
+ *
+ *   assert condition : detail ;
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 14.10" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface AssertTree extends StatementTree { + ExpressionTree getCondition(); + ExpressionTree getDetail(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/AssignmentTree.java b/langtools/src/share/classes/com/sun/source/tree/AssignmentTree.java new file mode 100644 index 00000000000..ba86a1d51ad --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/AssignmentTree.java @@ -0,0 +1,45 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for an assignment expression. + * + * For example: + *
+ *   variable = expression
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 15.26.1" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface AssignmentTree extends ExpressionTree { + ExpressionTree getVariable(); + ExpressionTree getExpression(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/BinaryTree.java b/langtools/src/share/classes/com/sun/source/tree/BinaryTree.java new file mode 100644 index 00000000000..c7e47d70b81 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/BinaryTree.java @@ -0,0 +1,46 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for a binary expression. + * Use {@link #getKind getKind} to determine the kind of operator. + * + * For example: + *
+ *   leftOperand operator rightOperand
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, sections 15.17 to 15.24" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface BinaryTree extends ExpressionTree { + ExpressionTree getLeftOperand(); + ExpressionTree getRightOperand(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/BlockTree.java b/langtools/src/share/classes/com/sun/source/tree/BlockTree.java new file mode 100644 index 00000000000..ad026880e6b --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/BlockTree.java @@ -0,0 +1,51 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import java.util.List; + +/** + * A tree node for a statement block. + * + * For example: + *
+ *   { }
+ *
+ *   { statements }
+ *
+ *   static { statements }
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 14.2" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface BlockTree extends StatementTree { + boolean isStatic(); + List getStatements(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/BreakTree.java b/langtools/src/share/classes/com/sun/source/tree/BreakTree.java new file mode 100644 index 00000000000..565aed5c21e --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/BreakTree.java @@ -0,0 +1,48 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import javax.lang.model.element.Name; + +/** + * A tree node for a 'break' statement. + * + * For example: + *
+ *   break;
+ *
+ *   break label ;
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 14.15" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface BreakTree extends StatementTree { + Name getLabel(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/CaseTree.java b/langtools/src/share/classes/com/sun/source/tree/CaseTree.java new file mode 100644 index 00000000000..ff3029f5281 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/CaseTree.java @@ -0,0 +1,54 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import java.util.List; + +/** + * A tree node for a 'case' in a 'switch' statement. + * + * For example: + *
+ *   case expression :
+ *       statements
+ *
+ *   default :
+ *       statements
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 14.11" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface CaseTree extends Tree { + /** + * @return null if and only if this Case is {@code default:} + */ + ExpressionTree getExpression(); + List getStatements(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/CatchTree.java b/langtools/src/share/classes/com/sun/source/tree/CatchTree.java new file mode 100644 index 00000000000..ba09577b1b8 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/CatchTree.java @@ -0,0 +1,46 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for a 'catch' block in a 'try' statement. + * + * For example: + *
+ *   catch ( parameter )
+ *       block
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 14.20" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface CatchTree extends Tree { + VariableTree getParameter(); + BlockTree getBlock(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/ClassTree.java b/langtools/src/share/classes/com/sun/source/tree/ClassTree.java new file mode 100644 index 00000000000..e163b8cb4cb --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/ClassTree.java @@ -0,0 +1,59 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import java.util.List; +import javax.lang.model.element.Name; + +/** + * A tree node for a class, interface, enum, or annotation + * type declaration. + * + * For example: + *
+ *   modifiers class simpleName typeParameters
+ *       extends extendsClause
+ *       implements implementsClause
+ *   {
+ *       members
+ *   }
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, + * sections 8.1, 8.9, 9.1, and 9.6" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface ClassTree extends StatementTree { + ModifiersTree getModifiers(); + Name getSimpleName(); + List getTypeParameters(); + Tree getExtendsClause(); + List getImplementsClause(); + List getMembers(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/CompilationUnitTree.java b/langtools/src/share/classes/com/sun/source/tree/CompilationUnitTree.java new file mode 100644 index 00000000000..1bc2191b383 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/CompilationUnitTree.java @@ -0,0 +1,54 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import java.util.List; +import javax.tools.JavaFileObject; +import com.sun.source.tree.LineMap; + +/** + * Represents the abstract syntax tree for compilation units (source + * files) and package declarations (package-info.java). + * + * @see "The Java Language Specification, 3rd ed, sections 7.3, and 7.4" + * + * @author Peter von der Ahé + * @since 1.6 + */ +public interface CompilationUnitTree extends Tree { + List getPackageAnnotations(); + ExpressionTree getPackageName(); + List getImports(); + List getTypeDecls(); + JavaFileObject getSourceFile(); + + /** + * Gets the line map for this compilation unit, if available. + * Returns null if the line map is not available. + * @return the line map for this compilation unit + */ + LineMap getLineMap(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/CompoundAssignmentTree.java b/langtools/src/share/classes/com/sun/source/tree/CompoundAssignmentTree.java new file mode 100644 index 00000000000..7cedd40a00f --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/CompoundAssignmentTree.java @@ -0,0 +1,46 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for compound assignment operator. + * Use {@link #getKind getKind} to determine the kind of operator. + * + * For example: + *
+ *   variable operator expression
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 15.26.2" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface CompoundAssignmentTree extends ExpressionTree { + ExpressionTree getVariable(); + ExpressionTree getExpression(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/ConditionalExpressionTree.java b/langtools/src/share/classes/com/sun/source/tree/ConditionalExpressionTree.java new file mode 100644 index 00000000000..760070f74e4 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/ConditionalExpressionTree.java @@ -0,0 +1,46 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for the conditional operator ? :. + * + * For example: + *
+ *   condition ? trueExpression : falseExpression
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 15.25" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface ConditionalExpressionTree extends ExpressionTree { + ExpressionTree getCondition(); + ExpressionTree getTrueExpression(); + ExpressionTree getFalseExpression(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/ContinueTree.java b/langtools/src/share/classes/com/sun/source/tree/ContinueTree.java new file mode 100644 index 00000000000..7d1982f316c --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/ContinueTree.java @@ -0,0 +1,47 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import javax.lang.model.element.Name; + +/** + * A tree node for a 'continue' statement. + * + * For example: + *
+ *   continue;
+ *   continue label ;
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 14.16" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface ContinueTree extends StatementTree { + Name getLabel(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/DoWhileLoopTree.java b/langtools/src/share/classes/com/sun/source/tree/DoWhileLoopTree.java new file mode 100644 index 00000000000..b658e24bad4 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/DoWhileLoopTree.java @@ -0,0 +1,47 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for a 'do' statement. + * + * For example: + *
+ *   do
+ *       statement
+ *   while ( expression );
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 14.13" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface DoWhileLoopTree extends StatementTree { + ExpressionTree getCondition(); + StatementTree getStatement(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/EmptyStatementTree.java b/langtools/src/share/classes/com/sun/source/tree/EmptyStatementTree.java new file mode 100644 index 00000000000..4befd0d220e --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/EmptyStatementTree.java @@ -0,0 +1,42 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for an empty (skip) statement. + * + * For example: + *
+ *    ;
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 14.6" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface EmptyStatementTree extends StatementTree {} diff --git a/langtools/src/share/classes/com/sun/source/tree/EnhancedForLoopTree.java b/langtools/src/share/classes/com/sun/source/tree/EnhancedForLoopTree.java new file mode 100644 index 00000000000..682cb387027 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/EnhancedForLoopTree.java @@ -0,0 +1,47 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for an "enhanced" 'for' loop statement. + * + * For example: + *
+ *   for ( variable : expression )
+ *       statement
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 14.14.2" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface EnhancedForLoopTree extends StatementTree { + VariableTree getVariable(); + ExpressionTree getExpression(); + StatementTree getStatement(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/ErroneousTree.java b/langtools/src/share/classes/com/sun/source/tree/ErroneousTree.java new file mode 100644 index 00000000000..3a6973ee806 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/ErroneousTree.java @@ -0,0 +1,39 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import java.util.List; + +/** + * A tree node to stand in for a malformed expression. + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface ErroneousTree extends ExpressionTree { + List getErrorTrees(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/ExpressionStatementTree.java b/langtools/src/share/classes/com/sun/source/tree/ExpressionStatementTree.java new file mode 100644 index 00000000000..47bb956acc2 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/ExpressionStatementTree.java @@ -0,0 +1,44 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for an expression statement. + * + * For example: + *
+ *   expression ;
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 14.8" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface ExpressionStatementTree extends StatementTree { + ExpressionTree getExpression(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/ExpressionTree.java b/langtools/src/share/classes/com/sun/source/tree/ExpressionTree.java new file mode 100644 index 00000000000..bc817e593a0 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/ExpressionTree.java @@ -0,0 +1,38 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node used as the base class for the different types of + * expressions. + * + * @see "The Java Language Specification, 3rd ed, chapter 15" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface ExpressionTree extends Tree {} diff --git a/langtools/src/share/classes/com/sun/source/tree/ForLoopTree.java b/langtools/src/share/classes/com/sun/source/tree/ForLoopTree.java new file mode 100644 index 00000000000..72cea8ba0ce --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/ForLoopTree.java @@ -0,0 +1,50 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import java.util.List; + +/** + * A tree node for a basic 'for' loop statement. + * + * For example: + *
+ *   for ( initializer ; condition ; update )
+ *       statement
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 14.14.1" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface ForLoopTree extends StatementTree { + List getInitializer(); + ExpressionTree getCondition(); + List getUpdate(); + StatementTree getStatement(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/IdentifierTree.java b/langtools/src/share/classes/com/sun/source/tree/IdentifierTree.java new file mode 100644 index 00000000000..ee04d7a84c3 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/IdentifierTree.java @@ -0,0 +1,46 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import javax.lang.model.element.Name; + +/** + * A tree node for an identifier expression. + * + * For example: + *
+ *   name
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 6.5.6.1" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface IdentifierTree extends ExpressionTree { + Name getName(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/IfTree.java b/langtools/src/share/classes/com/sun/source/tree/IfTree.java new file mode 100644 index 00000000000..6ab0fc251f8 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/IfTree.java @@ -0,0 +1,55 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for an 'if' statement. + * + * For example: + *
+ *   if ( condition )
+ *      thenStatement
+ *
+ *   if ( condition )
+ *       thenStatement
+ *   else
+ *       elseStatement
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 14.9" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface IfTree extends StatementTree { + ExpressionTree getCondition(); + StatementTree getThenStatement(); + /** + * @return null if this if statement has no else branch. + */ + StatementTree getElseStatement(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/ImportTree.java b/langtools/src/share/classes/com/sun/source/tree/ImportTree.java new file mode 100644 index 00000000000..1fdba86f4da --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/ImportTree.java @@ -0,0 +1,51 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for an import statement. + * + * For example: + *
+ *   import qualifiedIdentifier ;
+ *
+ *   static import qualifiedIdentifier ;
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 7.5" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface ImportTree extends Tree { + boolean isStatic(); + /** + * @return a qualified identifier ending in "*" if and only if + * this is an import-on-demand. + */ + Tree getQualifiedIdentifier(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/InstanceOfTree.java b/langtools/src/share/classes/com/sun/source/tree/InstanceOfTree.java new file mode 100644 index 00000000000..0cc582ab59a --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/InstanceOfTree.java @@ -0,0 +1,45 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for an 'instanceof' expression. + * + * For example: + *
+ *   expression instanceof type
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 15.20.2" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface InstanceOfTree extends ExpressionTree { + ExpressionTree getExpression(); + Tree getType(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/LabeledStatementTree.java b/langtools/src/share/classes/com/sun/source/tree/LabeledStatementTree.java new file mode 100644 index 00000000000..022f754a816 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/LabeledStatementTree.java @@ -0,0 +1,47 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import javax.lang.model.element.Name; + +/** + * A tree node for a labeled statement. + * + * For example: + *
+ *   label : statement
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 14.7" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface LabeledStatementTree extends StatementTree { + Name getLabel(); + StatementTree getStatement(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/LineMap.java b/langtools/src/share/classes/com/sun/source/tree/LineMap.java new file mode 100644 index 00000000000..312f1b62145 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/LineMap.java @@ -0,0 +1,78 @@ +/* + * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * Provides methods to convert between character positions and line numbers + * for a compilation unit. + * + * @since 1.6 + */ +public interface LineMap { + /** + * Find the start position of a line. + * + * @param line line number (beginning at 1) + * @return position of first character in line + * @throws IndexOutOfBoundsException + * if lineNumber < 1 + * if lineNumber > no. of lines + */ + long getStartPosition(long line); + + /** + * Find the position corresponding to a (line,column). + * + * @param line line number (beginning at 1) + * @param column tab-expanded column number (beginning 1) + * + * @return position of character + * @throws IndexOutOfBoundsException + * if {@code line < 1} + * if {@code line > no. of lines} + */ + long getPosition(long line, long column); + + /** + * Find the line containing a position; a line termination + * character is on the line it terminates. + * + * @param pos character offset of the position + * @return the line number of pos (first line is 1) + */ + long getLineNumber(long pos); + + /** + * Find the column for a character position. + * Tab characters preceding the position on the same line + * will be expanded when calculating the column number. + * + * @param pos character offset of the position + * @return the tab-expanded column number of pos (first column is 1) + */ + long getColumnNumber(long pos); + +} diff --git a/langtools/src/share/classes/com/sun/source/tree/LiteralTree.java b/langtools/src/share/classes/com/sun/source/tree/LiteralTree.java new file mode 100644 index 00000000000..f7cb163c96b --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/LiteralTree.java @@ -0,0 +1,45 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for a literal expression. + * Use {@link #getKind getKind} to determine the kind of literal. + * + * For example: + *
+ *   value
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 15.28" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface LiteralTree extends ExpressionTree { + Object getValue(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/MemberSelectTree.java b/langtools/src/share/classes/com/sun/source/tree/MemberSelectTree.java new file mode 100644 index 00000000000..cb794beb6c2 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/MemberSelectTree.java @@ -0,0 +1,48 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import javax.lang.model.element.Name; + +/** + * A tree node for a member access expression. + * + * For example: + *
+ *   expression . identifier
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, sections 6.5, + * 15.11, and 15.12" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface MemberSelectTree extends ExpressionTree { + ExpressionTree getExpression(); + Name getIdentifier(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/MethodInvocationTree.java b/langtools/src/share/classes/com/sun/source/tree/MethodInvocationTree.java new file mode 100644 index 00000000000..ba784608da6 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/MethodInvocationTree.java @@ -0,0 +1,50 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import java.util.List; + +/** + * A tree node for a method invocation expression. + * + * For example: + *
+ *   identifier ( arguments )
+ *
+ *   this . typeArguments identifier ( arguments )
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 15.12" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface MethodInvocationTree extends ExpressionTree { + List getTypeArguments(); + ExpressionTree getMethodSelect(); + List getArguments(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/MethodTree.java b/langtools/src/share/classes/com/sun/source/tree/MethodTree.java new file mode 100644 index 00000000000..5e4280ba5c0 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/MethodTree.java @@ -0,0 +1,59 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import java.util.List; +import javax.lang.model.element.Name; + +/** + * A tree node for a method or annotation type element declaration. + * + * For example: + *
+ *   modifiers typeParameters type name
+ *      ( parameters )
+ *      body
+ *
+ *   modifiers type name () default defaultValue
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, sections 8.4, 8.6, 8.7, + * 9.4, and 9.6" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface MethodTree extends Tree { + ModifiersTree getModifiers(); + Name getName(); + Tree getReturnType(); + List getTypeParameters(); + List getParameters(); + List getThrows(); + BlockTree getBody(); + Tree getDefaultValue(); // for annotation types +} diff --git a/langtools/src/share/classes/com/sun/source/tree/ModifiersTree.java b/langtools/src/share/classes/com/sun/source/tree/ModifiersTree.java new file mode 100644 index 00000000000..4efd4ff1e2f --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/ModifiersTree.java @@ -0,0 +1,52 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import java.util.List; +import java.util.Set; +import javax.lang.model.element.Modifier; + +/** + * A tree node for the modifiers, including annotations, for a declaration. + * + * For example: + *
+ *   flags
+ *
+ *   flags annotations
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, sections + * 8.1.1, 8.3.1, 8.4.3, 8.5.1, 8.8.3, 9.1.1, and 9.7" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface ModifiersTree extends Tree { + Set getFlags(); + List getAnnotations(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/NewArrayTree.java b/langtools/src/share/classes/com/sun/source/tree/NewArrayTree.java new file mode 100644 index 00000000000..d132b46d249 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/NewArrayTree.java @@ -0,0 +1,50 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import java.util.List; + +/** + * A tree node for an expression to create a new instance of an array. + * + * For example: + *
+ *   new type dimensions initializers
+ *
+ *   new type dimensions [ ] initializers
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 15.10" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface NewArrayTree extends ExpressionTree { + Tree getType(); + List getDimensions(); + List getInitializers(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/NewClassTree.java b/langtools/src/share/classes/com/sun/source/tree/NewClassTree.java new file mode 100644 index 00000000000..55b61c33bc6 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/NewClassTree.java @@ -0,0 +1,57 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import java.util.List; + +/** + * A tree node to declare a new instance of a class. + * + * For example: + *
+ *   new identifier ( )
+ *
+ *   new identifier ( arguments )
+ *
+ *   new typeArguments identifier ( arguments )
+ *       classBody
+ *
+ *   enclosingExpression.new identifier ( arguments )
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 15.9" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface NewClassTree extends ExpressionTree { + ExpressionTree getEnclosingExpression(); + List getTypeArguments(); + ExpressionTree getIdentifier(); + List getArguments(); + ClassTree getClassBody(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/ParameterizedTypeTree.java b/langtools/src/share/classes/com/sun/source/tree/ParameterizedTypeTree.java new file mode 100644 index 00000000000..b4f98f40b43 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/ParameterizedTypeTree.java @@ -0,0 +1,47 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import java.util.List; + +/** + * A tree node for a type expression involving type parameters. + * + * For example: + *
+ *   type < typeArguments >
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 4.5.1" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface ParameterizedTypeTree extends Tree { + Tree getType(); + List getTypeArguments(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/ParenthesizedTree.java b/langtools/src/share/classes/com/sun/source/tree/ParenthesizedTree.java new file mode 100644 index 00000000000..09c74f8e7d2 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/ParenthesizedTree.java @@ -0,0 +1,45 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for a parenthesized expression. Note: parentheses + * not be preserved by the parser. + * + * For example: + *
+ *   ( expression )
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 15.8.5" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface ParenthesizedTree extends ExpressionTree { + ExpressionTree getExpression(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/PrimitiveTypeTree.java b/langtools/src/share/classes/com/sun/source/tree/PrimitiveTypeTree.java new file mode 100644 index 00000000000..bc0cd94248c --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/PrimitiveTypeTree.java @@ -0,0 +1,46 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import javax.lang.model.type.TypeKind; + +/** + * A tree node for a primitive type. + * + * For example: + *
+ *   primitiveTypeKind
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 4.2" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface PrimitiveTypeTree extends Tree { + TypeKind getPrimitiveTypeKind(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/ReturnTree.java b/langtools/src/share/classes/com/sun/source/tree/ReturnTree.java new file mode 100644 index 00000000000..37b37a60baf --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/ReturnTree.java @@ -0,0 +1,45 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for a 'return' statement. + * + * For example: + *
+ *   return;
+ *   return expression;
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 14.17" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface ReturnTree extends StatementTree { + ExpressionTree getExpression(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/Scope.java b/langtools/src/share/classes/com/sun/source/tree/Scope.java new file mode 100644 index 00000000000..df1eafb4e80 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/Scope.java @@ -0,0 +1,73 @@ +/* + * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import com.sun.source.tree.Tree; +import javax.lang.model.element.Element; +import javax.lang.model.element.ExecutableElement; +import javax.lang.model.element.TypeElement; +import javax.lang.model.type.DeclaredType; + +/** + * Interface for determining locally available program elements, such as + * local variables and imports. + * Upon creation, a Scope is associated with a given program position; + * for example, a {@linkplain Tree tree node}. This position may be used to + * infer an enclosing method and/or class. + * + *

A Scope does not itself contain the details of the elements corresponding + * to the parameters, methods and fields of the methods and classes containing + * its position. However, these elements can be determined from the enclosing + * elements. + * + *

Scopes may be contained in an enclosing scope. The outermost scope contains + * those elements available via "star import" declarations; the scope within that + * contains the top level elements of the compilation unit, including any named + * imports. + * + * @since 1.6 + */ +public interface Scope { + /** + * Returns the enclosing scope. + */ + public Scope getEnclosingScope(); + + /** + * Returns the innermost type element containing the position of this scope + */ + public TypeElement getEnclosingClass(); + + /** + * Returns the innermost executable element containing the position of this scope. + */ + public ExecutableElement getEnclosingMethod(); + + /** + * Returns the elements directly contained in this scope. + */ + public Iterable getLocalElements(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/StatementTree.java b/langtools/src/share/classes/com/sun/source/tree/StatementTree.java new file mode 100644 index 00000000000..cc7c04af2f4 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/StatementTree.java @@ -0,0 +1,38 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node used as the base class for the different kinds of + * statements. + * + * @see "The Java Language Specification, 3rd ed, chapter 14" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface StatementTree extends Tree {} diff --git a/langtools/src/share/classes/com/sun/source/tree/SwitchTree.java b/langtools/src/share/classes/com/sun/source/tree/SwitchTree.java new file mode 100644 index 00000000000..faab423cb04 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/SwitchTree.java @@ -0,0 +1,49 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import java.util.List; + +/** + * A tree node for a 'switch' statement. + * + * For example: + *

+ *   switch ( expression ) {
+ *     cases
+ *   }
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 14.11" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface SwitchTree extends StatementTree { + ExpressionTree getExpression(); + List getCases(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/SynchronizedTree.java b/langtools/src/share/classes/com/sun/source/tree/SynchronizedTree.java new file mode 100644 index 00000000000..fa169d2a792 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/SynchronizedTree.java @@ -0,0 +1,46 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for a 'synchronized' statement. + * + * For example: + *
+ *   synchronized ( expression )
+ *       block
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 14.19" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface SynchronizedTree extends StatementTree { + ExpressionTree getExpression(); + BlockTree getBlock(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/ThrowTree.java b/langtools/src/share/classes/com/sun/source/tree/ThrowTree.java new file mode 100644 index 00000000000..cecdd970d63 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/ThrowTree.java @@ -0,0 +1,44 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for a 'throw' statement. + * + * For example: + *
+ *   throw expression;
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 14.18" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface ThrowTree extends StatementTree { + ExpressionTree getExpression(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/Tree.java b/langtools/src/share/classes/com/sun/source/tree/Tree.java new file mode 100644 index 00000000000..75d56f74123 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/Tree.java @@ -0,0 +1,585 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * Common interface for all nodes in an abstract syntax tree. + * + *

WARNING: This interface and its sub-interfaces are + * subject to change as the Java™ programming language evolves. + * These interfaces are implemented by Sun's Java compiler (javac) + * and should not be implemented either directly or indirectly by + * other applications. + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * + * @since 1.6 + */ +public interface Tree { + + /** + * Enumerates all kinds of trees. + */ + public enum Kind { + /** + * Used for instances of {@link AnnotationTree}. + */ + ANNOTATION(AnnotationTree.class), + + /** + * Used for instances of {@link ArrayAccessTree}. + */ + ARRAY_ACCESS(ArrayAccessTree.class), + + /** + * Used for instances of {@link ArrayTypeTree}. + */ + ARRAY_TYPE(ArrayTypeTree.class), + + /** + * Used for instances of {@link AssertTree}. + */ + ASSERT(AssertTree.class), + + /** + * Used for instances of {@link AssignmentTree}. + */ + ASSIGNMENT(AssignmentTree.class), + + /** + * Used for instances of {@link BlockTree}. + */ + BLOCK(BlockTree.class), + + /** + * Used for instances of {@link BreakTree}. + */ + BREAK(BreakTree.class), + + /** + * Used for instances of {@link CaseTree}. + */ + CASE(CaseTree.class), + + /** + * Used for instances of {@link CatchTree}. + */ + CATCH(CatchTree.class), + + /** + * Used for instances of {@link ClassTree}. + */ + CLASS(ClassTree.class), + + /** + * Used for instances of {@link CompilationUnitTree}. + */ + COMPILATION_UNIT(CompilationUnitTree.class), + + /** + * Used for instances of {@link ConditionalExpressionTree}. + */ + CONDITIONAL_EXPRESSION(ConditionalExpressionTree.class), + + /** + * Used for instances of {@link ContinueTree}. + */ + CONTINUE(ContinueTree.class), + + /** + * Used for instances of {@link DoWhileLoopTree}. + */ + DO_WHILE_LOOP(DoWhileLoopTree.class), + + /** + * Used for instances of {@link EnhancedForLoopTree}. + */ + ENHANCED_FOR_LOOP(EnhancedForLoopTree.class), + + /** + * Used for instances of {@link ExpressionStatementTree}. + */ + EXPRESSION_STATEMENT(ExpressionStatementTree.class), + + /** + * Used for instances of {@link MemberSelectTree}. + */ + MEMBER_SELECT(MemberSelectTree.class), + + /** + * Used for instances of {@link ForLoopTree}. + */ + FOR_LOOP(ForLoopTree.class), + + /** + * Used for instances of {@link IdentifierTree}. + */ + IDENTIFIER(IdentifierTree.class), + + /** + * Used for instances of {@link IfTree}. + */ + IF(IfTree.class), + + /** + * Used for instances of {@link ImportTree}. + */ + IMPORT(ImportTree.class), + + /** + * Used for instances of {@link InstanceOfTree}. + */ + INSTANCE_OF(InstanceOfTree.class), + + /** + * Used for instances of {@link LabeledStatementTree}. + */ + LABELED_STATEMENT(LabeledStatementTree.class), + + /** + * Used for instances of {@link MethodTree}. + */ + METHOD(MethodTree.class), + + /** + * Used for instances of {@link MethodInvocationTree}. + */ + METHOD_INVOCATION(MethodInvocationTree.class), + + /** + * Used for instances of {@link ModifiersTree}. + */ + MODIFIERS(ModifiersTree.class), + + /** + * Used for instances of {@link NewArrayTree}. + */ + NEW_ARRAY(NewArrayTree.class), + + /** + * Used for instances of {@link NewClassTree}. + */ + NEW_CLASS(NewClassTree.class), + + /** + * Used for instances of {@link ParenthesizedTree}. + */ + PARENTHESIZED(ParenthesizedTree.class), + + /** + * Used for instances of {@link PrimitiveTypeTree}. + */ + PRIMITIVE_TYPE(PrimitiveTypeTree.class), + + /** + * Used for instances of {@link ReturnTree}. + */ + RETURN(ReturnTree.class), + + /** + * Used for instances of {@link EmptyStatementTree}. + */ + EMPTY_STATEMENT(EmptyStatementTree.class), + + /** + * Used for instances of {@link SwitchTree}. + */ + SWITCH(SwitchTree.class), + + /** + * Used for instances of {@link SynchronizedTree}. + */ + SYNCHRONIZED(SynchronizedTree.class), + + /** + * Used for instances of {@link ThrowTree}. + */ + THROW(ThrowTree.class), + + /** + * Used for instances of {@link TryTree}. + */ + TRY(TryTree.class), + + /** + * Used for instances of {@link ParameterizedTypeTree}. + */ + PARAMETERIZED_TYPE(ParameterizedTypeTree.class), + + /** + * Used for instances of {@link TypeCastTree}. + */ + TYPE_CAST(TypeCastTree.class), + + /** + * Used for instances of {@link TypeParameterTree}. + */ + TYPE_PARAMETER(TypeParameterTree.class), + + /** + * Used for instances of {@link VariableTree}. + */ + VARIABLE(VariableTree.class), + + /** + * Used for instances of {@link WhileLoopTree}. + */ + WHILE_LOOP(WhileLoopTree.class), + + /** + * Used for instances of {@link UnaryTree} representing postfix + * increment operator {@code ++}. + */ + POSTFIX_INCREMENT(UnaryTree.class), + + /** + * Used for instances of {@link UnaryTree} representing postfix + * decrement operator {@code --}. + */ + POSTFIX_DECREMENT(UnaryTree.class), + + /** + * Used for instances of {@link UnaryTree} representing prefix + * increment operator {@code ++}. + */ + PREFIX_INCREMENT(UnaryTree.class), + + /** + * Used for instances of {@link UnaryTree} representing prefix + * decrement operator {@code --}. + */ + PREFIX_DECREMENT(UnaryTree.class), + + /** + * Used for instances of {@link UnaryTree} representing unary plus + * operator {@code +}. + */ + UNARY_PLUS(UnaryTree.class), + + /** + * Used for instances of {@link UnaryTree} representing unary minus + * operator {@code -}. + */ + UNARY_MINUS(UnaryTree.class), + + /** + * Used for instances of {@link UnaryTree} representing bitwise + * complement operator {@code ~}. + */ + BITWISE_COMPLEMENT(UnaryTree.class), + + /** + * Used for instances of {@link UnaryTree} representing logical + * complement operator {@code !}. + */ + LOGICAL_COMPLEMENT(UnaryTree.class), + + /** + * Used for instances of {@link BinaryTree} representing + * multiplication {@code *}. + */ + MULTIPLY(BinaryTree.class), + + /** + * Used for instances of {@link BinaryTree} representing + * division {@code /}. + */ + DIVIDE(BinaryTree.class), + + /** + * Used for instances of {@link BinaryTree} representing + * remainder {@code %}. + */ + REMAINDER(BinaryTree.class), + + /** + * Used for instances of {@link BinaryTree} representing + * addition or string concatenation {@code +}. + */ + PLUS(BinaryTree.class), + + /** + * Used for instances of {@link BinaryTree} representing + * subtraction {@code -}. + */ + MINUS(BinaryTree.class), + + /** + * Used for instances of {@link BinaryTree} representing + * left shift {@code <<}. + */ + LEFT_SHIFT(BinaryTree.class), + + /** + * Used for instances of {@link BinaryTree} representing + * right shift {@code >>}. + */ + RIGHT_SHIFT(BinaryTree.class), + + /** + * Used for instances of {@link BinaryTree} representing + * unsigned right shift {@code >>>}. + */ + UNSIGNED_RIGHT_SHIFT(BinaryTree.class), + + /** + * Used for instances of {@link BinaryTree} representing + * less-than {@code <}. + */ + LESS_THAN(BinaryTree.class), + + /** + * Used for instances of {@link BinaryTree} representing + * greater-than {@code >}. + */ + GREATER_THAN(BinaryTree.class), + + /** + * Used for instances of {@link BinaryTree} representing + * less-than-equal {@code <=}. + */ + LESS_THAN_EQUAL(BinaryTree.class), + + /** + * Used for instances of {@link BinaryTree} representing + * greater-than-equal {@code >=}. + */ + GREATER_THAN_EQUAL(BinaryTree.class), + + /** + * Used for instances of {@link BinaryTree} representing + * equal-to {@code ==}. + */ + EQUAL_TO(BinaryTree.class), + + /** + * Used for instances of {@link BinaryTree} representing + * not-equal-to {@code !=}. + */ + NOT_EQUAL_TO(BinaryTree.class), + + /** + * Used for instances of {@link BinaryTree} representing + * bitwise and logical "and" {@code &}. + */ + AND(BinaryTree.class), + + /** + * Used for instances of {@link BinaryTree} representing + * bitwise and logical "xor" {@code ^}. + */ + XOR(BinaryTree.class), + + /** + * Used for instances of {@link BinaryTree} representing + * bitwise and logical "or" {@code |}. + */ + OR(BinaryTree.class), + + /** + * Used for instances of {@link BinaryTree} representing + * conditional-and {@code &&}. + */ + CONDITIONAL_AND(BinaryTree.class), + + /** + * Used for instances of {@link BinaryTree} representing + * conditional-or {@code ||}. + */ + CONDITIONAL_OR(BinaryTree.class), + + /** + * Used for instances of {@link CompoundAssignmentTree} representing + * multiplication assignment {@code *=}. + */ + MULTIPLY_ASSIGNMENT(CompoundAssignmentTree.class), + + /** + * Used for instances of {@link CompoundAssignmentTree} representing + * division assignment {@code /=}. + */ + DIVIDE_ASSIGNMENT(CompoundAssignmentTree.class), + + /** + * Used for instances of {@link CompoundAssignmentTree} representing + * remainder assignment {@code %=}. + */ + REMAINDER_ASSIGNMENT(CompoundAssignmentTree.class), + + /** + * Used for instances of {@link CompoundAssignmentTree} representing + * addition or string concatenation assignment {@code +=}. + */ + PLUS_ASSIGNMENT(CompoundAssignmentTree.class), + + /** + * Used for instances of {@link CompoundAssignmentTree} representing + * subtraction assignment {@code -=}. + */ + MINUS_ASSIGNMENT(CompoundAssignmentTree.class), + + /** + * Used for instances of {@link CompoundAssignmentTree} representing + * left shift assignment {@code <<=}. + */ + LEFT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class), + + /** + * Used for instances of {@link CompoundAssignmentTree} representing + * right shift assignment {@code >>=}. + */ + RIGHT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class), + + /** + * Used for instances of {@link CompoundAssignmentTree} representing + * unsigned right shift assignment {@code >>>=}. + */ + UNSIGNED_RIGHT_SHIFT_ASSIGNMENT(CompoundAssignmentTree.class), + + /** + * Used for instances of {@link CompoundAssignmentTree} representing + * bitwise and logical "and" assignment {@code &=}. + */ + AND_ASSIGNMENT(CompoundAssignmentTree.class), + + /** + * Used for instances of {@link CompoundAssignmentTree} representing + * bitwise and logical "xor" assignment {@code ^=}. + */ + XOR_ASSIGNMENT(CompoundAssignmentTree.class), + + /** + * Used for instances of {@link CompoundAssignmentTree} representing + * bitwise and logical "or" assignment {@code |=}. + */ + OR_ASSIGNMENT(CompoundAssignmentTree.class), + + /** + * Used for instances of {@link LiteralTree} representing + * an integral literal expression of type {@code int}. + */ + INT_LITERAL(LiteralTree.class), + + /** + * Used for instances of {@link LiteralTree} representing + * an integral literal expression of type {@code long}. + */ + LONG_LITERAL(LiteralTree.class), + + /** + * Used for instances of {@link LiteralTree} representing + * a floating-point literal expression of type {@code float}. + */ + FLOAT_LITERAL(LiteralTree.class), + + /** + * Used for instances of {@link LiteralTree} representing + * a floating-point literal expression of type {@code double}. + */ + DOUBLE_LITERAL(LiteralTree.class), + + /** + * Used for instances of {@link LiteralTree} representing + * a boolean literal expression of type {@code boolean}. + */ + BOOLEAN_LITERAL(LiteralTree.class), + + /** + * Used for instances of {@link LiteralTree} representing + * a character literal expression of type {@code char}. + */ + CHAR_LITERAL(LiteralTree.class), + + /** + * Used for instances of {@link LiteralTree} representing + * a string literal expression of type {@link String}. + */ + STRING_LITERAL(LiteralTree.class), + + /** + * Used for instances of {@link LiteralTree} representing + * the use of {@code null}. + */ + NULL_LITERAL(LiteralTree.class), + + /** + * Used for instances of {@link WildcardTree} representing + * an unbounded wildcard type argument. + */ + UNBOUNDED_WILDCARD(WildcardTree.class), + + /** + * Used for instances of {@link WildcardTree} representing + * an extends bounded wildcard type argument. + */ + EXTENDS_WILDCARD(WildcardTree.class), + + /** + * Used for instances of {@link WildcardTree} representing + * a super bounded wildcard type argument. + */ + SUPER_WILDCARD(WildcardTree.class), + + /** + * Used for instances of {@link ErroneousTree}. + */ + ERRONEOUS(ErroneousTree.class), + + /** + * An implementation-reserved node. This is the not the node + * you are looking for. + */ + OTHER(null); + + + Kind(Class intf) { + associatedInterface = intf; + } + + public Class asInterface() { + return associatedInterface; + } + + private final Class associatedInterface; + } + + /** + * Gets the kind of this tree. + * + * @return the kind of this tree. + */ + Kind getKind(); + + /** + * Accept method used to implement the visitor pattern. The + * visitor pattern is used to implement operations on trees. + * + * @param result type of this operation. + * @param type of additonal data. + */ + R accept(TreeVisitor visitor, D data); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/TreeVisitor.java b/langtools/src/share/classes/com/sun/source/tree/TreeVisitor.java new file mode 100644 index 00000000000..5a739e28115 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/TreeVisitor.java @@ -0,0 +1,108 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A visitor of trees, in the style of the visitor design pattern. + * Classes implementing this interface are used to operate + * on a tree when the kind of tree is unknown at compile time. + * When a visitor is passed to an tree's {@link Tree#accept + * accept} method, the visitXYZ method most applicable + * to that tree is invoked. + * + *

Classes implementing this interface may or may not throw a + * {@code NullPointerException} if the additional parameter {@code p} + * is {@code null}; see documentation of the implementing class for + * details. + * + *

WARNING: It is possible that methods will be added to + * this interface to accommodate new, currently unknown, language + * structures added to future versions of the Java™ programming + * language. Therefore, visitor classes directly implementing this + * interface may be source incompatible with future versions of the + * platform. + * + * @param the return type of this visitor's methods. Use {@link + * Void} for visitors that do not need to return results. + * @param

the type of the additional parameter to this visitor's + * methods. Use {@code Void} for visitors that do not need an + * additional parameter. + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * + * @since 1.6 + */ +public interface TreeVisitor { + R visitAnnotation(AnnotationTree node, P p); + R visitMethodInvocation(MethodInvocationTree node, P p); + R visitAssert(AssertTree node, P p); + R visitAssignment(AssignmentTree node, P p); + R visitCompoundAssignment(CompoundAssignmentTree node, P p); + R visitBinary(BinaryTree node, P p); + R visitBlock(BlockTree node, P p); + R visitBreak(BreakTree node, P p); + R visitCase(CaseTree node, P p); + R visitCatch(CatchTree node, P p); + R visitClass(ClassTree node, P p); + R visitConditionalExpression(ConditionalExpressionTree node, P p); + R visitContinue(ContinueTree node, P p); + R visitDoWhileLoop(DoWhileLoopTree node, P p); + R visitErroneous(ErroneousTree node, P p); + R visitExpressionStatement(ExpressionStatementTree node, P p); + R visitEnhancedForLoop(EnhancedForLoopTree node, P p); + R visitForLoop(ForLoopTree node, P p); + R visitIdentifier(IdentifierTree node, P p); + R visitIf(IfTree node, P p); + R visitImport(ImportTree node, P p); + R visitArrayAccess(ArrayAccessTree node, P p); + R visitLabeledStatement(LabeledStatementTree node, P p); + R visitLiteral(LiteralTree node, P p); + R visitMethod(MethodTree node, P p); + R visitModifiers(ModifiersTree node, P p); + R visitNewArray(NewArrayTree node, P p); + R visitNewClass(NewClassTree node, P p); + R visitParenthesized(ParenthesizedTree node, P p); + R visitReturn(ReturnTree node, P p); + R visitMemberSelect(MemberSelectTree node, P p); + R visitEmptyStatement(EmptyStatementTree node, P p); + R visitSwitch(SwitchTree node, P p); + R visitSynchronized(SynchronizedTree node, P p); + R visitThrow(ThrowTree node, P p); + R visitCompilationUnit(CompilationUnitTree node, P p); + R visitTry(TryTree node, P p); + R visitParameterizedType(ParameterizedTypeTree node, P p); + R visitArrayType(ArrayTypeTree node, P p); + R visitTypeCast(TypeCastTree node, P p); + R visitPrimitiveType(PrimitiveTypeTree node, P p); + R visitTypeParameter(TypeParameterTree node, P p); + R visitInstanceOf(InstanceOfTree node, P p); + R visitUnary(UnaryTree node, P p); + R visitVariable(VariableTree node, P p); + R visitWhileLoop(WhileLoopTree node, P p); + R visitWildcard(WildcardTree node, P p); + R visitOther(Tree node, P p); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/TryTree.java b/langtools/src/share/classes/com/sun/source/tree/TryTree.java new file mode 100644 index 00000000000..5e512c89ec7 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/TryTree.java @@ -0,0 +1,52 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import java.util.List; + +/** + * A tree node for a 'try' statement. + * + * For example: + *

+ *   try
+ *       block
+ *   catches
+ *   finally
+ *       finallyBlock
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 14.20" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface TryTree extends StatementTree { + BlockTree getBlock(); + List getCatches(); + BlockTree getFinallyBlock(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/TypeCastTree.java b/langtools/src/share/classes/com/sun/source/tree/TypeCastTree.java new file mode 100644 index 00000000000..76549f0cdbf --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/TypeCastTree.java @@ -0,0 +1,45 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for a type cast expression. + * + * For example: + *
+ *   ( type ) expression
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 15.16" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface TypeCastTree extends ExpressionTree { + Tree getType(); + ExpressionTree getExpression(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/TypeParameterTree.java b/langtools/src/share/classes/com/sun/source/tree/TypeParameterTree.java new file mode 100644 index 00000000000..2af7e5519db --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/TypeParameterTree.java @@ -0,0 +1,50 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import java.util.List; +import javax.lang.model.element.Name; + +/** + * A tree node for a type parameter. + * + * For example: + *
+ *   name
+ *
+ *   name extends bounds
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 4.4" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface TypeParameterTree extends Tree { + Name getName(); + List getBounds(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/UnaryTree.java b/langtools/src/share/classes/com/sun/source/tree/UnaryTree.java new file mode 100644 index 00000000000..37fd39dd9bd --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/UnaryTree.java @@ -0,0 +1,47 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for postfix and unary expressions. + * Use {@link #getKind getKind} to determine the kind of operator. + * + * For example: + *
+ *   operator expression
+ *
+ *   expression operator
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, sections 15.14 and 15.15" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface UnaryTree extends ExpressionTree { + ExpressionTree getExpression(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/VariableTree.java b/langtools/src/share/classes/com/sun/source/tree/VariableTree.java new file mode 100644 index 00000000000..affa5b26a96 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/VariableTree.java @@ -0,0 +1,49 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +import javax.lang.model.element.Name; + +/** + * A tree node for a variable declaration. + * + * For example: + *
+ *   modifiers type name initializer ;
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, sections 8.3 and 14.4" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface VariableTree extends StatementTree { + ModifiersTree getModifiers(); + Name getName(); + Tree getType(); + ExpressionTree getInitializer(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/WhileLoopTree.java b/langtools/src/share/classes/com/sun/source/tree/WhileLoopTree.java new file mode 100644 index 00000000000..5829fc180dd --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/WhileLoopTree.java @@ -0,0 +1,47 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for a 'while' loop statement. + * + * For example: + *
+ *   while ( condition )
+ *     statement
+ * 
+ * + * + * @see "The Java Language Specification, 3rd ed, section 14.12" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface WhileLoopTree extends StatementTree { + ExpressionTree getCondition(); + StatementTree getStatement(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/WildcardTree.java b/langtools/src/share/classes/com/sun/source/tree/WildcardTree.java new file mode 100644 index 00000000000..1e2c1401632 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/WildcardTree.java @@ -0,0 +1,49 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.tree; + +/** + * A tree node for a wildcard type argument. + * Use {@link #getKind getKind} to determine the kind of bound. + * + * For example: + *
+ *   ?
+ *
+ *   ? extends bound
+ *
+ *   ? super bound
+ * 
+ * + * @see "The Java Language Specification, 3rd ed, section 4.5.1" + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface WildcardTree extends Tree { + Tree getBound(); +} diff --git a/langtools/src/share/classes/com/sun/source/tree/package-info.java b/langtools/src/share/classes/com/sun/source/tree/package-info.java new file mode 100644 index 00000000000..d60c241dd63 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/tree/package-info.java @@ -0,0 +1,34 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/** + * Provides interfaces to represent source code as abstract syntax + * trees (AST). + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +package com.sun.source.tree; diff --git a/langtools/src/share/classes/com/sun/source/util/JavacTask.java b/langtools/src/share/classes/com/sun/source/util/JavacTask.java new file mode 100644 index 00000000000..f38b2a07296 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/util/JavacTask.java @@ -0,0 +1,91 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.util; + +import com.sun.source.tree.CompilationUnitTree; +import com.sun.source.tree.Tree; +import java.io.IOException; +import javax.lang.model.element.Element; +import javax.lang.model.type.TypeMirror; +import javax.lang.model.util.Elements; +import javax.lang.model.util.Types; +import javax.tools.JavaCompiler.CompilationTask; +import javax.tools.JavaFileObject; + +/** + * Provides access to functionality specific to the Sun Java Compiler, javac. + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public abstract class JavacTask implements CompilationTask { + + /** + * Parse the specified files returning a list of abstract syntax trees. + * + * @return a list of abstract syntax trees + * @throws IOException if an unhandled I/O error occurred in the compiler. + */ + public abstract Iterable parse() + throws IOException; + + /** + * Complete all analysis. + * + * @return a list of elements that were analyzed + * @throws IOException if an unhandled I/O error occurred in the compiler. + */ + public abstract Iterable analyze() throws IOException; + + /** + * Generate code. + * + * @return a list of files that were generated + * @throws IOException if an unhandled I/O error occurred in the compiler. + */ + public abstract Iterable generate() throws IOException; + + /** + * The specified listener will receive events describing the progress of + * this compilation task. + */ + public abstract void setTaskListener(TaskListener taskListener); + + /** + * Get a type mirror of the tree node determined by the specified path. + */ + public abstract TypeMirror getTypeMirror(Iterable path); + /** + * Get a utility object for dealing with program elements. + */ + public abstract Elements getElements(); + + /** + * Get a utility object for dealing with type mirrors. + */ + public abstract Types getTypes(); +} diff --git a/langtools/src/share/classes/com/sun/source/util/SimpleTreeVisitor.java b/langtools/src/share/classes/com/sun/source/util/SimpleTreeVisitor.java new file mode 100644 index 00000000000..62bdc42f92d --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/util/SimpleTreeVisitor.java @@ -0,0 +1,254 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.util; + +import com.sun.source.tree.*; + +/** + * A simple visitor for tree nodes. + * + * @author Peter von der Ahé + * @since 1.6 + */ +public class SimpleTreeVisitor implements TreeVisitor { + protected final R DEFAULT_VALUE; + + protected SimpleTreeVisitor() { + DEFAULT_VALUE = null; + } + + protected SimpleTreeVisitor(R defaultValue) { + DEFAULT_VALUE = defaultValue; + } + + protected R defaultAction(Tree node, P p) { + return DEFAULT_VALUE; + } + + public final R visit(Tree node, P p) { + return (node == null) ? null : node.accept(this, p); + } + + public final R visit(Iterable nodes, P p) { + R r = null; + if (nodes != null) + for (Tree node : nodes) + r = visit(node, p); + return r; + } + + public R visitCompilationUnit(CompilationUnitTree node, P p) { + return defaultAction(node, p); + } + + public R visitImport(ImportTree node, P p) { + return defaultAction(node, p); + } + + public R visitClass(ClassTree node, P p) { + return defaultAction(node, p); + } + + public R visitMethod(MethodTree node, P p) { + return defaultAction(node, p); + } + + public R visitVariable(VariableTree node, P p) { + return defaultAction(node, p); + } + + public R visitEmptyStatement(EmptyStatementTree node, P p) { + return defaultAction(node, p); + } + + public R visitBlock(BlockTree node, P p) { + return defaultAction(node, p); + } + + public R visitDoWhileLoop(DoWhileLoopTree node, P p) { + return defaultAction(node, p); + } + + public R visitWhileLoop(WhileLoopTree node, P p) { + return defaultAction(node, p); + } + + public R visitForLoop(ForLoopTree node, P p) { + return defaultAction(node, p); + } + + public R visitEnhancedForLoop(EnhancedForLoopTree node, P p) { + return defaultAction(node, p); + } + + public R visitLabeledStatement(LabeledStatementTree node, P p) { + return defaultAction(node, p); + } + + public R visitSwitch(SwitchTree node, P p) { + return defaultAction(node, p); + } + + public R visitCase(CaseTree node, P p) { + return defaultAction(node, p); + } + + public R visitSynchronized(SynchronizedTree node, P p) { + return defaultAction(node, p); + } + + public R visitTry(TryTree node, P p) { + return defaultAction(node, p); + } + + public R visitCatch(CatchTree node, P p) { + return defaultAction(node, p); + } + + public R visitConditionalExpression(ConditionalExpressionTree node, P p) { + return defaultAction(node, p); + } + + public R visitIf(IfTree node, P p) { + return defaultAction(node, p); + } + + public R visitExpressionStatement(ExpressionStatementTree node, P p) { + return defaultAction(node, p); + } + + public R visitBreak(BreakTree node, P p) { + return defaultAction(node, p); + } + + public R visitContinue(ContinueTree node, P p) { + return defaultAction(node, p); + } + + public R visitReturn(ReturnTree node, P p) { + return defaultAction(node, p); + } + + public R visitThrow(ThrowTree node, P p) { + return defaultAction(node, p); + } + + public R visitAssert(AssertTree node, P p) { + return defaultAction(node, p); + } + + public R visitMethodInvocation(MethodInvocationTree node, P p) { + return defaultAction(node, p); + } + + public R visitNewClass(NewClassTree node, P p) { + return defaultAction(node, p); + } + + public R visitNewArray(NewArrayTree node, P p) { + return defaultAction(node, p); + } + + public R visitParenthesized(ParenthesizedTree node, P p) { + return defaultAction(node, p); + } + + public R visitAssignment(AssignmentTree node, P p) { + return defaultAction(node, p); + } + + public R visitCompoundAssignment(CompoundAssignmentTree node, P p) { + return defaultAction(node, p); + } + + public R visitUnary(UnaryTree node, P p) { + return defaultAction(node, p); + } + + public R visitBinary(BinaryTree node, P p) { + return defaultAction(node, p); + } + + public R visitTypeCast(TypeCastTree node, P p) { + return defaultAction(node, p); + } + + public R visitInstanceOf(InstanceOfTree node, P p) { + return defaultAction(node, p); + } + + public R visitArrayAccess(ArrayAccessTree node, P p) { + return defaultAction(node, p); + } + + public R visitMemberSelect(MemberSelectTree node, P p) { + return defaultAction(node, p); + } + + public R visitIdentifier(IdentifierTree node, P p) { + return defaultAction(node, p); + } + + public R visitLiteral(LiteralTree node, P p) { + return defaultAction(node, p); + } + + public R visitPrimitiveType(PrimitiveTypeTree node, P p) { + return defaultAction(node, p); + } + + public R visitArrayType(ArrayTypeTree node, P p) { + return defaultAction(node, p); + } + + public R visitParameterizedType(ParameterizedTypeTree node, P p) { + return defaultAction(node, p); + } + + public R visitTypeParameter(TypeParameterTree node, P p) { + return defaultAction(node, p); + } + + public R visitWildcard(WildcardTree node, P p) { + return defaultAction(node, p); + } + + public R visitModifiers(ModifiersTree node, P p) { + return defaultAction(node, p); + } + + public R visitAnnotation(AnnotationTree node, P p) { + return defaultAction(node, p); + } + + public R visitErroneous(ErroneousTree node, P p) { + return defaultAction(node, p); + } + + public R visitOther(Tree node, P p) { + return defaultAction(node, p); + } +} diff --git a/langtools/src/share/classes/com/sun/source/util/SourcePositions.java b/langtools/src/share/classes/com/sun/source/util/SourcePositions.java new file mode 100644 index 00000000000..42fb8fdbf57 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/util/SourcePositions.java @@ -0,0 +1,86 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.util; + +import com.sun.source.tree.*; + +/** + * Provides methods to obtain the position of a Tree within a CompilationUnit. + * A position is defined as a simple character offset from the start of a + * CompilationUnit where the first character is at offset 0. + * + * @author Peter von der Ahé + * @since 1.6 + */ +public interface SourcePositions { + + /** + * Gets the starting position of tree within file. If tree is not found within + * file, or if the starting position is not available, + * return {@link javax.tools.Diagnostic#NOPOS}. + * The returned position must be at the start of the yield of this tree, that + * is for any sub-tree of this tree, the following must hold: + * + *

+ * {@code tree.getStartPosition() <= subtree.getStartPosition()} or
+ * {@code tree.getStartPosition() == NOPOS} or
+ * {@code subtree.getStartPosition() == NOPOS} + *

+ * + * @param file CompilationUnit in which to find tree. + * @param tree tree for which a position is sought. + * @return the start position of tree. + */ + long getStartPosition(CompilationUnitTree file, Tree tree); + + /** + * Gets the ending position of tree within file. If tree is not found within + * file, or if the starting position is not available, + * return {@link javax.tools.Diagnostic#NOPOS}. + * The returned position must be at the end of the yield of this tree, + * that is for any sub-tree of this tree, the following must hold: + * + *

+ * {@code tree.getEndPosition() >= subtree.getEndPosition()} or
+ * {@code tree.getEndPosition() == NOPOS} or
+ * {@code subtree.getEndPosition() == NOPOS} + *

+ * + * In addition, the following must hold: + * + *

+ * {@code tree.getStartPosition() <= tree.getEndPosition()} or
+ * {@code tree.getStartPosition() == NOPOS} or
+ * {@code tree.getEndPosition() == NOPOS} + *

+ * + * @param file CompilationUnit in which to find tree. + * @param tree tree for which a position is sought. + * @return the end position of tree. + */ + long getEndPosition(CompilationUnitTree file, Tree tree); + +} diff --git a/langtools/src/share/classes/com/sun/source/util/TaskEvent.java b/langtools/src/share/classes/com/sun/source/util/TaskEvent.java new file mode 100644 index 00000000000..ce98826dbe2 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/util/TaskEvent.java @@ -0,0 +1,122 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.util; + +import com.sun.source.tree.CompilationUnitTree; +import javax.lang.model.element.TypeElement; +import javax.tools.JavaFileObject; + +/** + * Provides details about work that has been done by the Sun Java Compiler, javac. + * + * @author Jonathan Gibbons + * @since 1.6 + */ +public final class TaskEvent +{ + /** + * Kind of task event. + * @since 1.6 + */ + public enum Kind { + /** + * For events related to the parsing of a file. + */ + PARSE, + /** + * For events relating to elements being entered. + **/ + ENTER, + /** + * For events relating to elements being analyzed for errors. + **/ + ANALYZE, + /** + * For events relating to class files being generated. + **/ + GENERATE, + /** + * For events relating to overall annotaion processing. + **/ + ANNOTATION_PROCESSING, + /** + * For events relating to an individual annotation processing round. + **/ + ANNOTATION_PROCESSING_ROUND + }; + + public TaskEvent(Kind kind) { + this(kind, null, null, null); + } + + public TaskEvent(Kind kind, JavaFileObject sourceFile) { + this(kind, sourceFile, null, null); + } + + public TaskEvent(Kind kind, CompilationUnitTree unit) { + this(kind, unit.getSourceFile(), unit, null); + } + + public TaskEvent(Kind kind, CompilationUnitTree unit, TypeElement clazz) { + this(kind, unit.getSourceFile(), unit, clazz); + } + + private TaskEvent(Kind kind, JavaFileObject file, CompilationUnitTree unit, TypeElement clazz) { + this.kind = kind; + this.file = file; + this.unit = unit; + this.clazz = clazz; + } + + public Kind getKind() { + return kind; + } + + public JavaFileObject getSourceFile() { + return file; + } + + public CompilationUnitTree getCompilationUnit() { + return unit; + } + + public TypeElement getTypeElement() { + return clazz; + } + + public String toString() { + return "TaskEvent[" + + kind + "," + + file + "," + // the compilation unit is identified by the file + + clazz + "]"; + } + + private Kind kind; + private JavaFileObject file; + private CompilationUnitTree unit; + private TypeElement clazz; +} diff --git a/langtools/src/share/classes/com/sun/source/util/TaskListener.java b/langtools/src/share/classes/com/sun/source/util/TaskListener.java new file mode 100644 index 00000000000..7cb13944059 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/util/TaskListener.java @@ -0,0 +1,40 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.util; + + +/** + * Provides a listener to monitor the activity of the Sun Java Compiler, javac. + * + * @author Jonathan Gibbons + * @since 1.6 + */ +public interface TaskListener +{ + public void started(TaskEvent e); + + public void finished(TaskEvent e); +} diff --git a/langtools/src/share/classes/com/sun/source/util/TreePath.java b/langtools/src/share/classes/com/sun/source/util/TreePath.java new file mode 100644 index 00000000000..cd45a58900b --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/util/TreePath.java @@ -0,0 +1,142 @@ +/* + * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.util; + +import com.sun.source.tree.*; +import java.util.Iterator; + +/** + * A path of tree nodes, typically used to represent the sequence of ancestor + * nodes of a tree node up to the top level CompilationUnitTree node. + * + * @author Jonathan Gibbons + * @since 1.6 + */ +public class TreePath implements Iterable { + /** + * Gets a tree path for a tree node within a compilation unit. + * @return null if the node is not found + */ + public static TreePath getPath(CompilationUnitTree unit, Tree target) { + return getPath(new TreePath(unit), target); + } + + /** + * Gets a tree path for a tree node within a subtree identified by a TreePath object. + * @return null if the node is not found + */ + public static TreePath getPath(TreePath path, Tree target) { + path.getClass(); + target.getClass(); + + class Result extends Error { + static final long serialVersionUID = -5942088234594905625L; + TreePath path; + Result(TreePath path) { + this.path = path; + } + } + class PathFinder extends TreePathScanner { + public TreePath scan(Tree tree, Tree target) { + if (tree == target) + throw new Result(new TreePath(getCurrentPath(), target)); + return super.scan(tree, target); + } + } + + try { + new PathFinder().scan(path, target); + } catch (Result result) { + return result.path; + } + return null; + } + + /** + * Creates a TreePath for a root node. + */ + public TreePath(CompilationUnitTree t) { + this(null, t); + } + + /** + * Creates a TreePath for a child node. + */ + public TreePath(TreePath p, Tree t) { + if (t.getKind() == Tree.Kind.COMPILATION_UNIT) { + compilationUnit = (CompilationUnitTree) t; + parent = null; + } + else { + compilationUnit = p.compilationUnit; + parent = p; + } + leaf = t; + } + /** + * Get the compilation unit associated with this path. + */ + public CompilationUnitTree getCompilationUnit() { + return compilationUnit; + } + + /** + * Get the leaf node for this path. + */ + public Tree getLeaf() { + return leaf; + } + + /** + * Get the path for the enclosing node, or null if there is no enclosing node. + */ + public TreePath getParentPath() { + return parent; + } + + public Iterator iterator() { + return new Iterator() { + public boolean hasNext() { + return curr.parent != null; + } + + public Tree next() { + curr = curr.parent; + return curr.leaf; + } + + public void remove() { + throw new UnsupportedOperationException(); + } + + private TreePath curr; + }; + } + + private CompilationUnitTree compilationUnit; + private Tree leaf; + private TreePath parent; +} diff --git a/langtools/src/share/classes/com/sun/source/util/TreePathScanner.java b/langtools/src/share/classes/com/sun/source/util/TreePathScanner.java new file mode 100644 index 00000000000..78c5639bcf6 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/util/TreePathScanner.java @@ -0,0 +1,82 @@ +/* + * Copyright 2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.util; + +import com.sun.source.tree.*; + +/** + * A TreeVisitor that visits all the child tree nodes, and provides + * support for maintaining a path for the parent nodes. + * To visit nodes of a particular type, just override the + * corresponding visitorXYZ method. + * Inside your method, call super.visitXYZ to visit descendant + * nodes. + * + * @author Jonathan Gibbons + * @since 1.6 + */ +public class TreePathScanner extends TreeScanner { + + /** + * Scan a tree from a position identified by a TreePath. + */ + public R scan(TreePath path, P p) { + this.path = path; + try { + return path.getLeaf().accept(this, p); + } finally { + this.path = null; + } + } + + /** + * Scan a single node. + * The current path is updated for the duration of the scan. + */ + @Override + public R scan(Tree tree, P p) { + if (tree == null) + return null; + + TreePath prev = path; + path = new TreePath(path, tree); + try { + return tree.accept(this, p); + } finally { + path = prev; + } + } + + /** + * Get the current path for the node, as built up by the currently + * active set of scan calls. + */ + public TreePath getCurrentPath() { + return path; + } + + private TreePath path; +} diff --git a/langtools/src/share/classes/com/sun/source/util/TreeScanner.java b/langtools/src/share/classes/com/sun/source/util/TreeScanner.java new file mode 100644 index 00000000000..6bbacad11e1 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/util/TreeScanner.java @@ -0,0 +1,381 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.util; + +import com.sun.source.tree.*; + +/** + * A TreeVisitor that visits all the child tree nodes. + * To visit nodes of a particular type, just override the + * corresponding visitXYZ method. + * Inside your method, call super.visitXYZ to visit descendant + * nodes. + * + *

The default implementation of the visitXYZ methods will determine + * a result as follows: + *

    + *
  • If the node being visited has no children, the result will be null. + *
  • If the node being visited has one child, the result will be the + * result of calling {@code scan} on that child. The child may be a simple node + * or itself a list of nodes. + *
  • If the node being visited has more than one child, the result will + * be determined by calling {@code scan} each child in turn, and then combining the + * result of each scan after the first with the cumulative result + * so far, as determined by the {@link #reduce} method. Each child may be either + * a simple node of a list of nodes. The default behavior of the {@code reduce} + * method is such that the result of the visitXYZ method will be the result of + * the last child scanned. + *
+ * + *

Here is an example to count the number of identifier nodes in a tree: + *

+ *   class CountIdentifiers extends TreeScanner {
+ *      {@literal @}Override
+ *      public Integer visitIdentifier(IdentifierTree node, Void p) {
+ *          return 1;
+ *      }
+ *      {@literal @}Override
+ *      public Integer reduce(Integer r1, Integer r2) {
+ *          return (r1 == null ? 0 : r1) + (r2 == null ? 0 : r2);
+ *      }
+ *   }
+ * 
+ * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +public class TreeScanner implements TreeVisitor { + + /** Scan a single node. + */ + public R scan(Tree node, P p) { + return (node == null) ? null : node.accept(this, p); + } + + private R scanAndReduce(Tree node, P p, R r) { + return reduce(scan(node, p), r); + } + + /** Scan a list of nodes. + */ + public R scan(Iterable nodes, P p) { + R r = null; + if (nodes != null) { + boolean first = true; + for (Tree node : nodes) { + r = (first ? scan(node, p) : scanAndReduce(node, p, r)); + first = false; + } + } + return r; + } + + private R scanAndReduce(Iterable nodes, P p, R r) { + return reduce(scan(nodes, p), r); + } + + /** + * Reduces two results into a combined result. + * The default implementation is to return the first parameter. + * The general contract of the method is that it may take any action whatsoever. + */ + public R reduce(R r1, R r2) { + return r1; + } + + +/* *************************************************************************** + * Visitor methods + ****************************************************************************/ + + public R visitCompilationUnit(CompilationUnitTree node, P p) { + R r = scan(node.getPackageAnnotations(), p); + r = scanAndReduce(node.getPackageName(), p, r); + r = scanAndReduce(node.getImports(), p, r); + r = scanAndReduce(node.getTypeDecls(), p, r); + return r; + } + + public R visitImport(ImportTree node, P p) { + return scan(node.getQualifiedIdentifier(), p); + } + + public R visitClass(ClassTree node, P p) { + R r = scan(node.getModifiers(), p); + r = scanAndReduce(node.getTypeParameters(), p, r); + r = scanAndReduce(node.getExtendsClause(), p, r); + r = scanAndReduce(node.getImplementsClause(), p, r); + r = scanAndReduce(node.getMembers(), p, r); + return r; + } + + public R visitMethod(MethodTree node, P p) { + R r = scan(node.getModifiers(), p); + r = scanAndReduce(node.getReturnType(), p, r); + r = scanAndReduce(node.getTypeParameters(), p, r); + r = scanAndReduce(node.getParameters(), p, r); + r = scanAndReduce(node.getThrows(), p, r); + r = scanAndReduce(node.getBody(), p, r); + return r; + } + + public R visitVariable(VariableTree node, P p) { + R r = scan(node.getModifiers(), p); + r = scanAndReduce(node.getType(), p, r); + r = scanAndReduce(node.getInitializer(), p, r); + return r; + } + + public R visitEmptyStatement(EmptyStatementTree node, P p) { + return null; + } + + public R visitBlock(BlockTree node, P p) { + return scan(node.getStatements(), p); + } + + public R visitDoWhileLoop(DoWhileLoopTree node, P p) { + R r = scan(node.getStatement(), p); + r = scanAndReduce(node.getCondition(), p, r); + return r; + } + + public R visitWhileLoop(WhileLoopTree node, P p) { + R r = scan(node.getCondition(), p); + r = scanAndReduce(node.getStatement(), p, r); + return r; + } + + public R visitForLoop(ForLoopTree node, P p) { + R r = scan(node.getInitializer(), p); + r = scanAndReduce(node.getCondition(), p, r); + r = scanAndReduce(node.getUpdate(), p, r); + r = scanAndReduce(node.getStatement(), p, r); + return r; + } + + public R visitEnhancedForLoop(EnhancedForLoopTree node, P p) { + R r = scan(node.getVariable(), p); + r = scanAndReduce(node.getExpression(), p, r); + r = scanAndReduce(node.getStatement(), p, r); + return r; + } + + public R visitLabeledStatement(LabeledStatementTree node, P p) { + return scan(node.getStatement(), p); + } + + public R visitSwitch(SwitchTree node, P p) { + R r = scan(node.getExpression(), p); + r = scanAndReduce(node.getCases(), p, r); + return r; + } + + public R visitCase(CaseTree node, P p) { + R r = scan(node.getExpression(), p); + r = scanAndReduce(node.getStatements(), p, r); + return r; + } + + public R visitSynchronized(SynchronizedTree node, P p) { + R r = scan(node.getExpression(), p); + r = scanAndReduce(node.getBlock(), p, r); + return r; + } + + public R visitTry(TryTree node, P p) { + R r = scan(node.getBlock(), p); + r = scanAndReduce(node.getCatches(), p, r); + r = scanAndReduce(node.getFinallyBlock(), p, r); + return r; + } + + public R visitCatch(CatchTree node, P p) { + R r = scan(node.getParameter(), p); + r = scanAndReduce(node.getBlock(), p, r); + return r; + } + + public R visitConditionalExpression(ConditionalExpressionTree node, P p) { + R r = scan(node.getCondition(), p); + r = scanAndReduce(node.getTrueExpression(), p, r); + r = scanAndReduce(node.getFalseExpression(), p, r); + return r; + } + + public R visitIf(IfTree node, P p) { + R r = scan(node.getCondition(), p); + r = scanAndReduce(node.getThenStatement(), p, r); + r = scanAndReduce(node.getElseStatement(), p, r); + return r; + } + + public R visitExpressionStatement(ExpressionStatementTree node, P p) { + return scan(node.getExpression(), p); + } + + public R visitBreak(BreakTree node, P p) { + return null; + } + + public R visitContinue(ContinueTree node, P p) { + return null; + } + + public R visitReturn(ReturnTree node, P p) { + return scan(node.getExpression(), p); + } + + public R visitThrow(ThrowTree node, P p) { + return scan(node.getExpression(), p); + } + + public R visitAssert(AssertTree node, P p) { + R r = scan(node.getCondition(), p); + r = scanAndReduce(node.getDetail(), p, r); + return r; + } + + public R visitMethodInvocation(MethodInvocationTree node, P p) { + R r = scan(node.getTypeArguments(), p); + r = scanAndReduce(node.getMethodSelect(), p, r); + r = scanAndReduce(node.getArguments(), p, r); + return r; + } + + public R visitNewClass(NewClassTree node, P p) { + R r = scan(node.getEnclosingExpression(), p); + r = scanAndReduce(node.getIdentifier(), p, r); + r = scanAndReduce(node.getTypeArguments(), p, r); + r = scanAndReduce(node.getArguments(), p, r); + r = scanAndReduce(node.getClassBody(), p, r); + return r; + } + + public R visitNewArray(NewArrayTree node, P p) { + R r = scan(node.getType(), p); + r = scanAndReduce(node.getDimensions(), p, r); + r = scanAndReduce(node.getInitializers(), p, r); + return r; + } + + public R visitParenthesized(ParenthesizedTree node, P p) { + return scan(node.getExpression(), p); + } + + public R visitAssignment(AssignmentTree node, P p) { + R r = scan(node.getVariable(), p); + r = scanAndReduce(node.getExpression(), p, r); + return r; + } + + public R visitCompoundAssignment(CompoundAssignmentTree node, P p) { + R r = scan(node.getVariable(), p); + r = scanAndReduce(node.getExpression(), p, r); + return r; + } + + public R visitUnary(UnaryTree node, P p) { + return scan(node.getExpression(), p); + } + + public R visitBinary(BinaryTree node, P p) { + R r = scan(node.getLeftOperand(), p); + r = scanAndReduce(node.getRightOperand(), p, r); + return r; + } + + public R visitTypeCast(TypeCastTree node, P p) { + R r = scan(node.getType(), p); + r = scanAndReduce(node.getExpression(), p, r); + return r; + } + + public R visitInstanceOf(InstanceOfTree node, P p) { + R r = scan(node.getExpression(), p); + r = scanAndReduce(node.getType(), p, r); + return r; + } + + public R visitArrayAccess(ArrayAccessTree node, P p) { + R r = scan(node.getExpression(), p); + r = scanAndReduce(node.getIndex(), p, r); + return r; + } + + public R visitMemberSelect(MemberSelectTree node, P p) { + return scan(node.getExpression(), p); + } + + public R visitIdentifier(IdentifierTree node, P p) { + return null; + } + + public R visitLiteral(LiteralTree node, P p) { + return null; + } + + public R visitPrimitiveType(PrimitiveTypeTree node, P p) { + return null; + } + + public R visitArrayType(ArrayTypeTree node, P p) { + return scan(node.getType(), p); + } + + public R visitParameterizedType(ParameterizedTypeTree node, P p) { + R r = scan(node.getType(), p); + r = scanAndReduce(node.getTypeArguments(), p, r); + return r; + } + + public R visitTypeParameter(TypeParameterTree node, P p) { + return scan(node.getBounds(), p); + } + + public R visitWildcard(WildcardTree node, P p) { + return scan(node.getBound(), p); + } + + public R visitModifiers(ModifiersTree node, P p) { + return scan(node.getAnnotations(), p); + } + + public R visitAnnotation(AnnotationTree node, P p) { + R r = scan(node.getAnnotationType(), p); + r = scanAndReduce(node.getArguments(), p, r); + return r; + } + + public R visitOther(Tree node, P p) { + return null; + } + + public R visitErroneous(ErroneousTree node, P p) { + return null; + } +} diff --git a/langtools/src/share/classes/com/sun/source/util/Trees.java b/langtools/src/share/classes/com/sun/source/util/Trees.java new file mode 100644 index 00000000000..ff1c51fa4f1 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/util/Trees.java @@ -0,0 +1,180 @@ +/* + * Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.source.util; + +import java.lang.reflect.Method; +import javax.annotation.processing.ProcessingEnvironment; +import javax.lang.model.element.AnnotationMirror; +import javax.lang.model.element.AnnotationValue; +import javax.lang.model.element.Element; +import javax.lang.model.element.ExecutableElement; +import javax.lang.model.element.TypeElement; +import javax.lang.model.type.DeclaredType; +import javax.lang.model.type.TypeMirror; +import javax.tools.JavaCompiler.CompilationTask; + +import com.sun.source.tree.ClassTree; +import com.sun.source.tree.CompilationUnitTree; +import com.sun.source.tree.MethodTree; +import com.sun.source.tree.Scope; +import com.sun.source.tree.Tree; + +/** + * Bridges JSR 199, JSR 269, and the Tree API. + * + * @author Peter von der Ahé + */ +public abstract class Trees { + /** + * Gets a Trees object for a given CompilationTask. + * @throws IllegalArgumentException if the task does not support the Trees API. + */ + public static Trees instance(CompilationTask task) { + if (!task.getClass().getName().equals("com.sun.tools.javac.api.JavacTaskImpl")) + throw new IllegalArgumentException(); + return getJavacTrees(CompilationTask.class, task); + } + + /** + * Gets a Trees object for a given CompilationTask. + * @throws IllegalArgumentException if the env does not support the Trees API. + */ + public static Trees instance(ProcessingEnvironment env) { + if (!env.getClass().getName().equals("com.sun.tools.javac.processing.JavacProcessingEnvironment")) + throw new IllegalArgumentException(); + return getJavacTrees(ProcessingEnvironment.class, env); + } + + private static Trees getJavacTrees(Class argType, Object arg) { + try { + ClassLoader cl = arg.getClass().getClassLoader(); + Class c = Class.forName("com.sun.tools.javac.api.JavacTrees", false, cl); + argType = Class.forName(argType.getName(), false, cl); + Method m = c.getMethod("instance", new Class[] { argType }); + return (Trees) m.invoke(null, new Object[] { arg }); + } catch (Throwable e) { + throw new AssertionError(e); + } + } + + /** + * Gets a utility object for obtaining source positions. + */ + public abstract SourcePositions getSourcePositions(); + + /** + * Gets the Tree node for a given Element. + * Returns null if the node can not be found. + */ + public abstract Tree getTree(Element element); + + /** + * Gets the ClassTree node for a given TypeElement. + * Returns null if the node can not be found. + */ + public abstract ClassTree getTree(TypeElement element); + + /** + * Gets the MethodTree node for a given ExecutableElement. + * Returns null if the node can not be found. + */ + public abstract MethodTree getTree(ExecutableElement method); + + /** + * Gets the Tree node for an AnnotationMirror on a given Element. + * Returns null if the node can not be found. + */ + public abstract Tree getTree(Element e, AnnotationMirror a); + + /** + * Gets the Tree node for an AnnotationValue for an AnnotationMirror on a given Element. + * Returns null if the node can not be found. + */ + public abstract Tree getTree(Element e, AnnotationMirror a, AnnotationValue v); + + /** + * Gets the path to tree node within the specified compilation unit. + */ + public abstract TreePath getPath(CompilationUnitTree unit, Tree node); + + /** + * Gets the TreePath node for a given Element. + * Returns null if the node can not be found. + */ + public abstract TreePath getPath(Element e); + + /** + * Gets the TreePath node for an AnnotationMirror on a given Element. + * Returns null if the node can not be found. + */ + public abstract TreePath getPath(Element e, AnnotationMirror a); + + /** + * Gets the TreePath node for an AnnotationValue for an AnnotationMirror on a given Element. + * Returns null if the node can not be found. + */ + public abstract TreePath getPath(Element e, AnnotationMirror a, AnnotationValue v); + + /** + * Gets the Element for the Tree node identified by a given TreePath. + * Returns null if the element is not available. + * @throws IllegalArgumentException is the TreePath does not identify + * a Tree node that might have an associated Element. + */ + public abstract Element getElement(TreePath path); + + /** + * Gets the TypeMirror for the Tree node identified by a given TreePath. + * Returns null if the TypeMirror is not available. + * @throws IllegalArgumentException is the TreePath does not identify + * a Tree node that might have an associated TypeMirror. + */ + public abstract TypeMirror getTypeMirror(TreePath path); + + /** + * Gets the Scope for the Tree node identified by a given TreePath. + * Returns null if the Scope is not available. + */ + public abstract Scope getScope(TreePath path); + + /** + * Checks whether a given type is accessible in a given scope. + * @param scope the scope to be checked + * @param type the type to be checked + * @return true if {@code type} is accessible + */ + public abstract boolean isAccessible(Scope scope, TypeElement type); + + /** + * Checks whether the given element is accessible as a member of the given + * type in a given scope. + * @param scope the scope to be checked + * @param member the member to be checked + * @param type the type for which to check if the member is accessible + * @return true if {@code member} is accessible in {@code type} + */ + public abstract boolean isAccessible(Scope scope, Element member, DeclaredType type); +} diff --git a/langtools/src/share/classes/com/sun/source/util/package-info.java b/langtools/src/share/classes/com/sun/source/util/package-info.java new file mode 100644 index 00000000000..b6a764b7308 --- /dev/null +++ b/langtools/src/share/classes/com/sun/source/util/package-info.java @@ -0,0 +1,33 @@ +/* + * Copyright 2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +/** + * Provides utilities for operations on abstract syntax trees (AST). + * + * @author Peter von der Ahé + * @author Jonathan Gibbons + * @since 1.6 + */ +package com.sun.source.util; diff --git a/langtools/src/share/classes/com/sun/tools/apt/Main.java b/langtools/src/share/classes/com/sun/tools/apt/Main.java new file mode 100644 index 00000000000..730a5e88892 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/Main.java @@ -0,0 +1,115 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt; + +import java.io.PrintWriter; +import com.sun.mirror.apt.AnnotationProcessorFactory; + +/** + * The main program for the command-line tool apt. + * + *

Nothing described in this source file is part of any supported + * API. If you write code that depends on this, you do so at your own + * risk. This code and its internal interfaces are subject to change + * or deletion without notice. + */ +public class Main { + + static { + ClassLoader loader = Main.class.getClassLoader(); + if (loader != null) + loader.setPackageAssertionStatus("com.sun.tools.apt", true); + } + + /** Command line interface. If args is null, a + * NullPointerException is thrown. + * @param args The command line parameters. + */ + public static void main(String... args) { + System.exit(process(args)); + } + + /** Programatic interface. If args is null, a + * NullPointerException is thrown. + * Output is directed to System.err. + * @param args The command line parameters. + */ + public static int process(String... args) { + return processing(null, null, args); + } + + /** Programmatic interface. If any argument + * is null, a NullPointerException is thrown. + * @param args The command line parameters. + * @param out Where the tool's output is directed. + */ + public static int process(PrintWriter out, String... args) { + if (out == null) + throw new NullPointerException("Parameter out cannot be null."); + return processing(null, out, args); + } + + /** Programmatic interface. If factory or args + * is null, a NullPointerException is thrown. + * The "-factory" and "-factorypath" + * command line parameters are ignored by this entry point. + * Output is directed to System.err. + * + * @param factory The annotation processor factory to use + * @param args The command line parameters. + */ + public static int process(AnnotationProcessorFactory factory, String... args) { + return process(factory, new PrintWriter(System.err, true), args); + } + + /** Programmatic interface. If any argument + * is null, a NullPointerException is thrown. + * The "-factory" and "-factorypath" + * command line parameters are ignored by this entry point. + * + * @param factory The annotation processor factory to use + * @param args The command line parameters. + * @param out Where the tool's output is directed. + */ + public static int process(AnnotationProcessorFactory factory, PrintWriter out, + String... args) { + if (out == null) + throw new NullPointerException("Parameter out cannot be null."); + if (factory == null) + throw new NullPointerException("Parameter factory cannot be null"); + return processing(factory, out, args); + } + + private static int processing(AnnotationProcessorFactory factory, + PrintWriter out, + String... args) { + if (out == null) + out = new PrintWriter(System.err, true); + com.sun.tools.apt.main.Main compiler = + new com.sun.tools.apt.main.Main("apt", out); + return compiler.compile(args, factory); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/comp/AnnotationProcessingError.java b/langtools/src/share/classes/com/sun/tools/apt/comp/AnnotationProcessingError.java new file mode 100644 index 00000000000..582b21c2ee9 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/comp/AnnotationProcessingError.java @@ -0,0 +1,32 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.comp; + +public class AnnotationProcessingError extends Error { + AnnotationProcessingError(Throwable cause) { + super(cause); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/comp/Apt.java b/langtools/src/share/classes/com/sun/tools/apt/comp/Apt.java new file mode 100644 index 00000000000..aab5dadec46 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/comp/Apt.java @@ -0,0 +1,546 @@ +/* + * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.comp; + +import com.sun.tools.javac.code.*; +import com.sun.tools.javac.comp.*; +import com.sun.tools.javac.tree.*; +import com.sun.tools.javac.util.*; +import com.sun.tools.javac.tree.TreeScanner; +import com.sun.tools.javac.util.Context; +import com.sun.tools.apt.util.Bark; +import com.sun.tools.javac.util.Position; + +import java.util.*; +import java.util.regex.*; +import java.lang.reflect.*; +import java.lang.reflect.InvocationTargetException; +import java.io.IOException; + +import com.sun.tools.apt.*; +import com.sun.tools.apt.comp.*; +import com.sun.tools.javac.code.Symbol.*; + +import com.sun.mirror.declaration.TypeDeclaration; +import com.sun.mirror.declaration.AnnotationTypeDeclaration; +import com.sun.mirror.apt.*; +// import com.sun.mirror.apt.AnnotationProcessorFactory; +import com.sun.mirror.apt.AnnotationProcessors; + +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.apt.mirror.apt.FilerImpl; +import com.sun.tools.apt.mirror.apt.AnnotationProcessorEnvironmentImpl; + + +import static com.sun.tools.apt.mirror.declaration.DeclarationMaker.isJavaIdentifier; + +/** + * Apt compiler phase. + * + *

This is NOT part of any API supported by Sun Microsystems. + * If you write code that depends on this, you do so at your own + * risk. This code and its internal interfaces are subject to change + * or deletion without notice. + */ +public class Apt extends ListBuffer> { + java.util.Set genSourceFileNames = new java.util.LinkedHashSet(); + public java.util.Set getSourceFileNames() { + return genSourceFileNames; + } + + /** List of names of generated class files. + */ + java.util.Set genClassFileNames = new java.util.LinkedHashSet(); + public java.util.Set getClassFileNames() { + return genClassFileNames; + } + + /* AptEnvironment */ + AptEnv aptenv; + + private Context context; + + /** The context key for the todo list. */ + + protected static final Context.Key aptKey = + new Context.Key(); + + /** Get the Apt instance for this context. */ + public static Apt instance(Context context) { + Apt instance = context.get(aptKey); + if (instance == null) + instance = new Apt(context); + return instance; + } + + /** Create a new apt list. */ + protected Apt(Context context) { + this.context = context; + + context.put(aptKey, this); + aptenv = AptEnv.instance(context); + } + + /** + * Used to scan javac trees to build data structures needed for + * bootstrapping the apt environment. In particular: + * + *

    + * + *
  • Generate list of canonical names of annotation types that + * appear in source files given on the command line + * + *
  • Collect list of javac symbols representing source files + * given on the command line + * + *
+ */ + static class AptTreeScanner extends TreeScanner { + + // Set of fully qualified names of annotation types present in + // examined source + private Set annotationSet; + + // Symbols to build bootstrapping declaration list + private Collection specifiedDeclCollection; + private Collection declCollection; + + public Set getAnnotationSet() { + return annotationSet; + } + + public AptTreeScanner() { + annotationSet = new LinkedHashSet(); + specifiedDeclCollection = new LinkedHashSet(); + declCollection = new LinkedHashSet(); + } + + public void visitTopLevel(JCTree.JCCompilationUnit tree) { + super.visitTopLevel(tree); + // Print out contents -- what are we dealing with? + + for(JCTree d: tree.defs) { + if (d instanceof JCTree.JCClassDecl) + specifiedDeclCollection.add(((JCTree.JCClassDecl) d).sym); + } + + } + + public void visitBlock(JCTree.JCBlock tree) { + ; // Do nothing. + } + + + // should add nested classes to packages, etc. + public void visitClassDef(JCTree.JCClassDecl tree) { + if (tree.sym == null) { + // could be an anon class w/in an initializer + return; + } + + super.visitClassDef(tree); + + declCollection.add(tree.sym); + } + + public void visitMethodDef(JCTree.JCMethodDecl tree) { + super.visitMethodDef(tree); + } + + public void visitVarDef(JCTree.JCVariableDecl tree) { + super.visitVarDef(tree); + } + + public void visitAnnotation(JCTree.JCAnnotation tree) { + super.visitAnnotation(tree); + annotationSet.add(tree.type.tsym.toString()); + } + } + + Set computeAnnotationSet(Collection classSymbols) { + Set annotationSet = new HashSet(); + + for(ClassSymbol classSymbol: classSymbols) { + computeAnnotationSet(classSymbol, annotationSet); + } + return annotationSet; + } + + void computeAnnotationSet(Symbol symbol, Set annotationSet) { + if (symbol != null ) { + if (symbol.getAnnotationMirrors() != null) + for(Attribute.Compound compound: symbol.getAnnotationMirrors()) + annotationSet.add(compound.type.tsym.toString()); // should fullName be used instead of toString? + + if (symbol instanceof Symbol.MethodSymbol) // add parameter annotations + for(Symbol param: ((MethodSymbol) symbol).params()) + computeAnnotationSet(param, annotationSet); + + if (symbol.members() != null) { + for(Scope.Entry e: symbol.members().table) + computeAnnotationSet(e.sym, annotationSet); + } + } + } + + public void main(com.sun.tools.javac.util.List treeList, + ListBuffer classes, + Map origOptions, + ClassLoader aptCL, + AnnotationProcessorFactory providedFactory, + java.util.Set > productiveFactories) { + Bark bark = Bark.instance(context); + java.io.PrintWriter out = bark.warnWriter; + Options options = Options.instance(context); + + Collection spectypedecls = new LinkedHashSet(); + Collection typedecls = new LinkedHashSet(); + Set unmatchedAnnotations = new LinkedHashSet(); + Set emptyATDS = Collections.emptySet(); + Set > currentRoundFactories = + new LinkedHashSet >(); + + // Determine what annotations are present on the input source + // files, create collections of specified type declarations, + // and type declarations. + AptTreeScanner ats = new AptTreeScanner(); + for(JCTree t: treeList) { + t.accept(ats); + } + + // Turn collection of ClassSymbols into Collection of apt decls + for (ClassSymbol cs : ats.specifiedDeclCollection) { + TypeDeclaration decl = aptenv.declMaker.getTypeDeclaration(cs); + spectypedecls.add(decl); + } + + for (ClassSymbol cs : ats.declCollection) { + TypeDeclaration decl = aptenv.declMaker.getTypeDeclaration(cs); + typedecls.add(decl); + } + + unmatchedAnnotations.addAll(ats.getAnnotationSet()); + + // Process input class files + for(ClassSymbol cs : classes) { + TypeDeclaration decl = aptenv.declMaker.getTypeDeclaration(cs); + // System.out.println("Adding a class to spectypedecls"); + spectypedecls.add(decl); + typedecls.add(decl); + computeAnnotationSet(cs, unmatchedAnnotations); + } + + if (options.get("-XListAnnotationTypes") != null) { + out.println("Set of annotations found:" + + (new TreeSet(unmatchedAnnotations)).toString()); + } + + AnnotationProcessorEnvironmentImpl trivAPE = + new AnnotationProcessorEnvironmentImpl(spectypedecls, typedecls, origOptions, context); + + if (options.get("-XListDeclarations") != null) { + out.println("Set of Specified Declarations:" + + spectypedecls); + + out.println("Set of Included Declarations: " + + typedecls); + } + + if (options.get("-print") != null) { + if (spectypedecls.size() == 0 ) + throw new UsageMessageNeededException(); + + // Run the printing processor + AnnotationProcessor proc = (new BootstrapAPF()).getProcessorFor(new HashSet(), + trivAPE); + proc.process(); + } else { + // Discovery process + + // List of annotation processory factory instances + java.util.Iterator providers = null; + { + /* + * If a factory is provided by the user, the + * "-factory" and "-factorypath" options are not used. + * + * Otherwise, if the "-factory" option is used, search + * the appropriate path for the named class. + * Otherwise, use sun.misc.Service to implement the + * default discovery policy. + */ + + java.util.List list = + new LinkedList(); + String factoryName = options.get("-factory"); + + if (providedFactory != null) { + list.add(providedFactory); + providers = list.iterator(); + } else if (factoryName != null) { + try { + AnnotationProcessorFactory factory = + (AnnotationProcessorFactory) (aptCL.loadClass(factoryName).newInstance()); + list.add(factory); + } catch (ClassNotFoundException cnfe) { + bark.aptWarning("FactoryNotFound", factoryName); + } catch (ClassCastException cce) { + bark.aptWarning("FactoryWrongType", factoryName); + } catch (Exception e ) { + bark.aptWarning("FactoryCantInstantiate", factoryName); + } catch(Throwable t) { + throw new AnnotationProcessingError(t); + } + + providers = list.iterator(); + } else + providers = sun.misc.Service.providers(AnnotationProcessorFactory.class, aptCL); + } + + java.util.Map> factoryToAnnotation = + new LinkedHashMap>(); + + if (!providers.hasNext() && productiveFactories.size() == 0) { + if (unmatchedAnnotations.size() > 0) + bark.aptWarning("NoAnnotationProcessors"); + if (spectypedecls.size() == 0) + throw new UsageMessageNeededException(); + return; // no processors; nothing else to do + } else { + // If there are no annotations, still give + // processors that match everything a chance to + // run. + + if(unmatchedAnnotations.size() == 0) + unmatchedAnnotations.add(""); + + Set emptyStringSet = new HashSet(); + emptyStringSet.add(""); + emptyStringSet = Collections.unmodifiableSet(emptyStringSet); + + while (providers.hasNext() ) { + Object provider = providers.next(); + try { + Set matchedStrings = new HashSet(); + + AnnotationProcessorFactory apf = (AnnotationProcessorFactory) provider; + Collection supportedTypes = apf.supportedAnnotationTypes(); + + Collection supportedTypePatterns = new LinkedList(); + for(String s: supportedTypes) + supportedTypePatterns.add(importStringToPattern(s)); + + for(String s: unmatchedAnnotations) { + for(Pattern p: supportedTypePatterns) { + if (p.matcher(s).matches()) { + matchedStrings.add(s); + break; + } + } + } + + unmatchedAnnotations.removeAll(matchedStrings); + + if (options.get("-XPrintFactoryInfo") != null) { + out.println("Factory " + apf.getClass().getName() + + " matches " + + ((matchedStrings.size() == 0)? + "nothing.": matchedStrings)); + } + + if (matchedStrings.size() > 0) { + // convert annotation names to annotation + // type decls + Set atds = new HashSet(); + + // If a "*" processor is called on the + // empty string, pass in an empty set of + // annotation type declarations. + if (!matchedStrings.equals(emptyStringSet)) { + for(String s: matchedStrings) { + TypeDeclaration decl = aptenv.declMaker.getTypeDeclaration(s); + AnnotationTypeDeclaration annotdecl; + if (decl == null) { + bark.aptError("DeclarationCreation", s); + } else { + try { + annotdecl = (AnnotationTypeDeclaration)decl; + atds.add(annotdecl); + + } catch (ClassCastException cce) { + bark.aptError("BadDeclaration", s); + } + } + } + } + + currentRoundFactories.add(apf.getClass()); + productiveFactories.add(apf.getClass()); + factoryToAnnotation.put(apf, atds); + } else if (productiveFactories.contains(apf.getClass())) { + // If a factory provided a processor in a + // previous round but doesn't match any + // annotations this round, call it with an + // empty set of declarations. + currentRoundFactories.add(apf.getClass()); + factoryToAnnotation.put(apf, emptyATDS ); + } + + if (unmatchedAnnotations.size() == 0) + break; + + } catch (ClassCastException cce) { + bark.aptWarning("BadFactory", cce); + } + } + + unmatchedAnnotations.remove(""); + } + + // If the set difference of productiveFactories and + // currentRoundFactories is non-empty, call the remaining + // productive factories with an empty set of declarations. + { + java.util.Set > neglectedFactories = + new LinkedHashSet>(productiveFactories); + neglectedFactories.removeAll(currentRoundFactories); + for(Class working : neglectedFactories) { + try { + AnnotationProcessorFactory factory = working.newInstance(); + factoryToAnnotation.put(factory, emptyATDS); + } catch (Exception e ) { + bark.aptWarning("FactoryCantInstantiate", working.getName()); + } catch(Throwable t) { + throw new AnnotationProcessingError(t); + } + } + } + + if (unmatchedAnnotations.size() > 0) + bark.aptWarning("AnnotationsWithoutProcessors", unmatchedAnnotations); + + Set processors = new LinkedHashSet(); + + // If there were no source files AND no factory matching "*", + // make sure the usage message is printed + if (spectypedecls.size() == 0 && + factoryToAnnotation.keySet().size() == 0 ) + throw new UsageMessageNeededException(); + + try { + for(AnnotationProcessorFactory apFactory: factoryToAnnotation.keySet()) { + AnnotationProcessor processor = apFactory.getProcessorFor(factoryToAnnotation.get(apFactory), + trivAPE); + if (processor != null) + processors.add(processor); + else + bark.aptWarning("NullProcessor", apFactory.getClass().getName()); + } + } catch(Throwable t) { + throw new AnnotationProcessingError(t); + } + + LinkedList temp = new LinkedList(); + temp.addAll(processors); + + AnnotationProcessor proc = AnnotationProcessors.getCompositeAnnotationProcessor(temp); + + try { + proc.process(); + } catch (Throwable t) { + throw new AnnotationProcessingError(t); + } + + // Invoke listener callback mechanism + trivAPE.roundComplete(); + + FilerImpl filerimpl = (FilerImpl)trivAPE.getFiler(); + genSourceFileNames = filerimpl.getSourceFileNames(); + genClassFileNames = filerimpl.getClassFileNames(); + filerimpl.flush(); // Make sure new files are written out + } + } + + /** + * Convert import-style string to regex matching that string. If + * the string is a valid import-style string, return a regex that + * won't match anything. + */ + Pattern importStringToPattern(String s) { + if (s.equals("*")) { + return allMatches; + } else { + String t = s; + boolean star = false; + + /* + * Validate string from factory is legal. If the string + * has more than one asterisks or the asterisks does not + * appear as the last character (preceded by a period), + * the string is not legal. + */ + + boolean valid = true; + int index = t.indexOf('*'); + if (index != -1) { + // '*' must be last character... + if (index == t.length() -1) { + // ... and preceeding character must be '.' + if ( index-1 >= 0 ) { + valid = t.charAt(index-1) == '.'; + // Strip off ".*$" for identifier checks + t = t.substring(0, t.length()-2); + } + } else + valid = false; + } + + // Verify string is off the form (javaId \.)+ or javaId + if (valid) { + String[] javaIds = t.split("\\.", t.length()+2); + for(String javaId: javaIds) + valid &= isJavaIdentifier(javaId); + } + + if (!valid) { + Bark bark = Bark.instance(context); + bark.aptWarning("MalformedSupportedString", s); + return noMatches; // won't match any valid identifier + } + + String s_prime = s.replaceAll("\\.", "\\\\."); + + if (s_prime.endsWith("*")) { + s_prime = s_prime.substring(0, s_prime.length() - 1) + ".+"; + } + + return Pattern.compile(s_prime); + } + } + + private static final Pattern allMatches = Pattern.compile(".*"); + private static final Pattern noMatches = Pattern.compile("(\\P{all})+"); +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/comp/BootstrapAPF.java b/langtools/src/share/classes/com/sun/tools/apt/comp/BootstrapAPF.java new file mode 100644 index 00000000000..edc71a269f2 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/comp/BootstrapAPF.java @@ -0,0 +1,58 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.comp; + +import java.util.*; +import com.sun.mirror.apt.*; +import com.sun.mirror.declaration.AnnotationTypeDeclaration; + +public class BootstrapAPF implements AnnotationProcessorFactory { + + static final Collection supportedOptions = + Collections.unmodifiableSet(new HashSet()); + + static Collection supportedAnnotations; + static { + Collection c = new HashSet(); + c.add("*"); + supportedAnnotations = Collections.unmodifiableCollection(c); + } + + public BootstrapAPF(){} + + public Collection supportedOptions() { + return BootstrapAPF.supportedOptions; + } + + public Collection supportedAnnotationTypes() { + return supportedAnnotations; + } + + public AnnotationProcessor getProcessorFor(Set atds, + AnnotationProcessorEnvironment env) { + return new PrintAP(env); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/comp/PrintAP.java b/langtools/src/share/classes/com/sun/tools/apt/comp/PrintAP.java new file mode 100644 index 00000000000..59f9e7bdd80 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/comp/PrintAP.java @@ -0,0 +1,466 @@ +/* + * Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.comp; + +import com.sun.mirror.declaration.*; +import static com.sun.mirror.declaration.Modifier.*; +import com.sun.mirror.type.*; +import com.sun.mirror.apt.*; + +import java.util.*; +import com.sun.mirror.util.*; + +/** + * Class used to implement "-print" option. + */ +public class PrintAP implements AnnotationProcessor { + + + static class PrintingVisitors { + int indentation = 0; // Indentation level; + AnnotationProcessorEnvironment env; + Messager out; + Declaration java_lang_Object; + Declaration java_lang_annotation_Annotation; + + static Set EMPTY_ELIDES = Collections.emptySet(); + static Set INTERFACE_ELIDES = EnumSet.of(ABSTRACT); + static Set ENUM_ELIDES = EnumSet.of(FINAL, ABSTRACT); + static Set INTERFACE_MEMBER_ELIDES = EnumSet.of(ABSTRACT, PUBLIC, STATIC, FINAL); + + PrintingVisitors(AnnotationProcessorEnvironment env) { + this.env = env; + this.out = env.getMessager(); + this.java_lang_Object = env.getTypeDeclaration("java.lang.Object"); + this.java_lang_annotation_Annotation = env.getTypeDeclaration("java.lang.annotation.Annotation"); + } + + + static String [] spaces = { + "", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " ", + " " + }; + + + String indent(){ + int indentation = this.indentation; + if (indentation < 0) + return ""; + else if (indentation <= 10) + return spaces[indentation]; + else { + StringBuilder sb = new StringBuilder(); + while (indentation > 10) { + sb.append(spaces[indentation]); + indentation -= 10; + } + sb.append(spaces[indentation]); + return sb.toString(); + } + } + + + class PrePrinting extends SimpleDeclarationVisitor { + Map enumCardinality = new HashMap(); + Map enumConstVisited = new HashMap(); + + PrePrinting(){} + + public void visitClassDeclaration(ClassDeclaration d) { + System.out.println(); + printDocComment(d); + printModifiers(d, EMPTY_ELIDES); + System.out.print("class " + d.getSimpleName()); + printFormalTypeParameters(d); + + // Elide "extends Object" + ClassType Super = d.getSuperclass(); + if (Super != null && !java_lang_Object.equals(Super.getDeclaration()) ) + System.out.print(" extends " + Super.toString()); + + printInterfaces(d); + + System.out.println(" {"); + + PrintingVisitors.this.indentation++; + } + + public void visitEnumDeclaration(EnumDeclaration d) { + enumCardinality.put(d, d.getEnumConstants().size()); + enumConstVisited.put(d, 1); + + System.out.println(); + printDocComment(d); + printModifiers(d, ENUM_ELIDES); + + System.out.print("enum " + d.getSimpleName()); + printFormalTypeParameters(d); + printInterfaces(d); + + System.out.println(" {"); + + PrintingVisitors.this.indentation++; + } + + + public void visitInterfaceDeclaration(InterfaceDeclaration d) { + System.out.println(); + printDocComment(d); + printModifiers(d, INTERFACE_ELIDES); + System.out.print("interface " + d.getSimpleName()); + + printFormalTypeParameters(d); + printInterfaces(d); + + System.out.println(" {"); + + PrintingVisitors.this.indentation++; + } + + public void visitAnnotationTypeDeclaration(AnnotationTypeDeclaration d) { + System.out.println(); + printDocComment(d); + printModifiers(d, INTERFACE_ELIDES); + System.out.print("@interface " + d.getSimpleName()); + printFormalTypeParameters(d); + + printInterfaces(d); + + System.out.println(" {"); + + PrintingVisitors.this.indentation++; + } + + public void visitFieldDeclaration(FieldDeclaration d) { + System.out.println(); + printDocComment(d); + printModifiers(d, + (d.getDeclaringType() instanceof InterfaceDeclaration)? + INTERFACE_MEMBER_ELIDES : EMPTY_ELIDES); + System.out.print(d.getType().toString() + " " + + d.getSimpleName() ); + String constantExpr = d.getConstantExpression(); + if (constantExpr != null) { + System.out.print(" = " + constantExpr); + } + System.out.println(";" ); + } + + public void visitEnumConstantDeclaration(EnumConstantDeclaration d) { + EnumDeclaration ed = d.getDeclaringType(); + int enumCard = enumCardinality.get(ed); + int enumVisit = enumConstVisited.get(ed); + + System.out.println(); + printDocComment(d); + System.out.print(PrintingVisitors.this.indent()); + System.out.print(d.getSimpleName() ); + System.out.println((enumVisit < enumCard )? ",":";" ); + + enumConstVisited.put(ed, enumVisit+1); + } + + public void visitMethodDeclaration(MethodDeclaration d) { + System.out.println(); + printDocComment(d); + printModifiers(d, + (d.getDeclaringType() instanceof InterfaceDeclaration)? + INTERFACE_MEMBER_ELIDES : EMPTY_ELIDES); + printFormalTypeParameters(d); + System.out.print(d.getReturnType().toString() + " "); + System.out.print(d.getSimpleName() + "("); + printParameters(d); + System.out.print(")"); + printThrows(d); + System.out.println(";"); + } + + public void visitConstructorDeclaration(ConstructorDeclaration d) { + System.out.println(); + printDocComment(d); + printModifiers(d, EMPTY_ELIDES); + printFormalTypeParameters(d); + System.out.print(d.getSimpleName() + "("); + printParameters(d); + System.out.print(")"); + printThrows(d); + System.out.println(";"); + } + + + } + + class PostPrinting extends SimpleDeclarationVisitor { + PostPrinting(){} + + public void visitTypeDeclaration(TypeDeclaration d) { + PrintingVisitors.this.indentation--; + + System.out.print(PrintingVisitors.this.indent()); + System.out.println("}"); + } + } + + private void printAnnotations(Collection annots) { + + for(AnnotationMirror annot: annots) { + System.out.print(this.indent()); + System.out.print(annot.toString()); + System.out.println(); + } + } + + private void printAnnotationsInline(Collection annots) { + + for(AnnotationMirror annot: annots) { + System.out.print(annot); + System.out.print(" "); + } + } + + + private void printParameters(ExecutableDeclaration ex) { + + Collection parameters = ex.getParameters(); + int size = parameters.size(); + + switch (size) { + case 0: + break; + + case 1: + for(ParameterDeclaration parameter: parameters) { + printModifiers(parameter, EMPTY_ELIDES); + + if (ex.isVarArgs() ) { + System.out.print(((ArrayType)parameter.getType()).getComponentType() ); + System.out.print("..."); + } else + System.out.print(parameter.getType()); + System.out.print(" " + parameter.getSimpleName()); + } + break; + + default: + { + int i = 1; + for(ParameterDeclaration parameter: parameters) { + if (i == 2) + PrintingVisitors.this.indentation++; + + if (i > 1) + System.out.print(PrintingVisitors.this.indent()); + + printModifiers(parameter, EMPTY_ELIDES); + + if (i == size && ex.isVarArgs() ) { + System.out.print(((ArrayType)parameter.getType()).getComponentType() ); + System.out.print("..."); + } else + System.out.print(parameter.getType()); + System.out.print(" " + parameter.getSimpleName()); + + if (i < size) + System.out.println(","); + + i++; + } + + if (parameters.size() >= 2) + PrintingVisitors.this.indentation--; + } + break; + } + } + + private void printDocComment(Declaration d) { + String docComment = d.getDocComment(); + + if (docComment != null) { + // Break comment into lines + java.util.StringTokenizer st = new StringTokenizer(docComment, + "\n\r"); + System.out.print(PrintingVisitors.this.indent()); + System.out.println("/**"); + + while(st.hasMoreTokens()) { + System.out.print(PrintingVisitors.this.indent()); + System.out.print(" *"); + System.out.println(st.nextToken()); + } + + System.out.print(PrintingVisitors.this.indent()); + System.out.println(" */"); + } + } + + private void printModifiers(Declaration d, Collection elides) { + printAnnotations(d.getAnnotationMirrors()); + + System.out.print(PrintingVisitors.this.indent()); + + for(Modifier m: adjustModifiers(d.getModifiers(), elides) ){ + System.out.print(m.toString() + " "); + } + } + + private void printModifiers(ParameterDeclaration d, Collection elides) { + printAnnotationsInline(d.getAnnotationMirrors()); + + for(Modifier m: adjustModifiers(d.getModifiers(), elides) ) { + System.out.print(m.toString() + " "); + } + } + + private Collection adjustModifiers(Collection mods, + Collection elides) { + if (elides.isEmpty()) + return mods; + else { + Collection newMods = new LinkedHashSet(); + newMods.addAll(mods); + newMods.removeAll(elides); + return newMods; + } + } + + private void printFormalTypeParameters(ExecutableDeclaration e) { + printFormalTypeParameterSet(e.getFormalTypeParameters(), true); + } + + private void printFormalTypeParameters(TypeDeclaration d) { + printFormalTypeParameterSet(d.getFormalTypeParameters(), false); + } + + private void printFormalTypeParameterSet(Collection typeParams, boolean pad) { + if (typeParams.size() != 0) { + System.out.print("<"); + + boolean first = true; + for(TypeParameterDeclaration tpd: typeParams) { + if (!first) + System.out.print(", "); + System.out.print(tpd.toString()); + } + + System.out.print(">"); + if (pad) + System.out.print(" "); + + } + } + + private void printInterfaceSet(Collection interfaces, + boolean classNotInterface) { + if (interfaces.size() != 0) { + System.out.print((classNotInterface?" implements" : " extends")); + + boolean first = true; + for(InterfaceType interType: interfaces) { + if (!first) + System.out.print(","); + System.out.print(" "); + System.out.print(interType.toString()); + first = false; + } + } + } + + private void printInterfaces(TypeDeclaration d) { + printInterfaceSet(d.getSuperinterfaces(), d instanceof ClassDeclaration); + } + + private void printInterfaces(AnnotationTypeDeclaration d) { + Collection interfaces = new HashSet(d.getSuperinterfaces()); + + for(InterfaceType interType: interfaces) { + if (java_lang_annotation_Annotation.equals(interType.getDeclaration()) ) + interfaces.remove(interType); + } + + printInterfaceSet(interfaces, d instanceof ClassDeclaration); + } + + private void printThrows(ExecutableDeclaration d) { + Collection thrownTypes = d.getThrownTypes(); + final int size = thrownTypes.size(); + if (size != 0) { + System.out.print(" throws"); + + int i = 1; + for(ReferenceType thrownType: thrownTypes) { + if (i == 1) { + System.out.print(" "); + } + + if (i == 2) + PrintingVisitors.this.indentation++; + + if (i >= 2) + System.out.print(PrintingVisitors.this.indent()); + + System.out.print(thrownType.toString()); + + + if (i != size) { + System.out.println(", "); + } + i++; + } + + if (size >= 2) + PrintingVisitors.this.indentation--; + } + } + + DeclarationVisitor getPrintingVisitor() { + return DeclarationVisitors.getSourceOrderDeclarationScanner(new PrePrinting(), + new PostPrinting()); + } + } + + AnnotationProcessorEnvironment env; + PrintAP(AnnotationProcessorEnvironment env) { + this.env = env; + } + + + public void process() { + Collection typedecls = env.getSpecifiedTypeDeclarations(); + + for (TypeDeclaration td: typedecls) + td.accept((new PrintingVisitors(env)).getPrintingVisitor()); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/comp/UsageMessageNeededException.java b/langtools/src/share/classes/com/sun/tools/apt/comp/UsageMessageNeededException.java new file mode 100644 index 00000000000..cbbbf8675cf --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/comp/UsageMessageNeededException.java @@ -0,0 +1,29 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.comp; + + +public class UsageMessageNeededException extends RuntimeException {} diff --git a/langtools/src/share/classes/com/sun/tools/apt/main/CommandLine.java b/langtools/src/share/classes/com/sun/tools/apt/main/CommandLine.java new file mode 100644 index 00000000000..83a5111b78f --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/main/CommandLine.java @@ -0,0 +1,90 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.main; + +import java.io.IOException; +import java.io.Reader; +import java.io.FileReader; +import java.io.BufferedReader; +import java.io.StreamTokenizer; +import com.sun.tools.javac.util.ListBuffer; + +/** + * Various utility methods for processing Java tool command line arguments. + * + *

This is NOT part of any API supported by Sun Microsystems. If + * you write code that depends on this, you do so at your own risk. + * This code and its internal interfaces are subject to change or + * deletion without notice. + */ +public class CommandLine { + /** + * Process Win32-style command files for the specified command line + * arguments and return the resulting arguments. A command file argument + * is of the form '@file' where 'file' is the name of the file whose + * contents are to be parsed for additional arguments. The contents of + * the command file are parsed using StreamTokenizer and the original + * '@file' argument replaced with the resulting tokens. Recursive command + * files are not supported. The '@' character itself can be quoted with + * the sequence '@@'. + */ + public static String[] parse(String[] args) + throws IOException + { + ListBuffer newArgs = new ListBuffer(); + for (int i = 0; i < args.length; i++) { + String arg = args[i]; + if (arg.length() > 1 && arg.charAt(0) == '@') { + arg = arg.substring(1); + if (arg.charAt(0) == '@') { + newArgs.append(arg); + } else { + loadCmdFile(arg, newArgs); + } + } else { + newArgs.append(arg); + } + } + return newArgs.toList().toArray(new String[newArgs.length()]); + } + + private static void loadCmdFile(String name, ListBuffer args) + throws IOException + { + Reader r = new BufferedReader(new FileReader(name)); + StreamTokenizer st = new StreamTokenizer(r); + st.resetSyntax(); + st.wordChars(' ', 255); + st.whitespaceChars(0, ' '); + st.commentChar('#'); + st.quoteChar('"'); + st.quoteChar('\''); + while (st.nextToken() != st.TT_EOF) { + args.append(st.sval); + } + r.close(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java b/langtools/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java new file mode 100644 index 00000000000..23c060842f2 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/main/JavaCompiler.java @@ -0,0 +1,298 @@ +/* + * Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.main; + +import java.io.*; +import java.nio.CharBuffer; +import java.util.Set; +import java.util.HashSet; +import java.util.Map; +import java.util.HashMap; + +import javax.tools.JavaFileManager; +import javax.tools.JavaFileObject; + +import com.sun.tools.javac.util.*; +import com.sun.tools.javac.code.*; +import com.sun.tools.javac.tree.*; +import com.sun.tools.javac.parser.*; +import com.sun.tools.javac.comp.*; +import com.sun.tools.javac.jvm.*; + +import com.sun.tools.javac.code.Symbol.*; +import com.sun.tools.javac.tree.JCTree.*; + +import com.sun.tools.apt.comp.*; +import com.sun.tools.apt.util.Bark; +import com.sun.mirror.apt.AnnotationProcessorFactory; +import com.sun.tools.javac.parser.DocCommentScanner; + +/** + *

This is NOT part of any API supported by Sun Microsystems. + * If you write code that depends on this, you do so at your own + * risk. This code and its internal interfaces are subject to change + * or deletion without notice. + */ +public class JavaCompiler extends com.sun.tools.javac.main.JavaCompiler { + /** The context key for the compiler. */ + protected static final Context.Key compilerKey = + new Context.Key(); + + /** Get the JavaCompiler instance for this context. */ + public static JavaCompiler instance(Context context) { + JavaCompiler instance = context.get(compilerKey); + if (instance == null) + instance = new JavaCompiler(context); + return instance; + } + + + java.util.Set genSourceFileNames; + java.util.Set genClassFileNames; + + public java.util.Set getSourceFileNames() { + return genSourceFileNames; + } + + /** List of names of generated class files. + */ + public java.util.Set getClassFileNames() { + return genClassFileNames; + } + + java.util.Set aggregateGenFiles = java.util.Collections.emptySet(); + + public java.util.Set getAggregateGenFiles() { + return aggregateGenFiles; + } + + /** The bark to be used for error reporting. + */ + Bark bark; + + /** The log to be used for error reporting. + */ + Log log; + + /** The annotation framework + */ + Apt apt; + + private static Context preRegister(Context context) { + Bark.preRegister(context); + + // force the use of the scanner that captures Javadoc comments + DocCommentScanner.Factory.preRegister(context); + + if (context.get(JavaFileManager.class) == null) + JavacFileManager.preRegister(context); + + return context; + } + + /** Construct a new compiler from a shared context. + */ + public JavaCompiler(Context context) { + super(preRegister(context)); + + context.put(compilerKey, this); + apt = Apt.instance(context); + + ClassReader classReader = ClassReader.instance(context); + classReader.preferSource = true; + + // TEMPORARY NOTE: bark==log, but while refactoring, we maintain their + // original identities, to remember the original intent. + log = Log.instance(context); + bark = Bark.instance(context); + + Options options = Options.instance(context); + classOutput = options.get("-retrofit") == null; + nocompile = options.get("-nocompile") != null; + print = options.get("-print") != null; + classesAsDecls= options.get("-XclassesAsDecls") != null; + + genSourceFileNames = new java.util.LinkedHashSet(); + genClassFileNames = new java.util.LinkedHashSet(); + + // this forces a copy of the line map to be kept in the tree, + // for use by com.sun.mirror.util.SourcePosition. + lineDebugInfo = true; + } + + /* Switches: + */ + + /** Emit class files. This switch is always set, except for the first + * phase of retrofitting, where signatures are parsed. + */ + public boolean classOutput; + + /** The internal printing annotation processor should be used. + */ + public boolean print; + + /** Compilation should not be done after annotation processing. + */ + public boolean nocompile; + + /** Are class files being treated as declarations + */ + public boolean classesAsDecls; + + /** Try to open input stream with given name. + * Report an error if this fails. + * @param filename The file name of the input stream to be opened. + */ + // PROVIDED FOR EXTREME BACKWARDS COMPATIBILITY + // There are some very obscure errors that can arise while translating + // the contents of a file from bytes to characters. In Tiger, these + // diagnostics were ignored. This method provides compatibility with + // that behavior. It would be better to honor those diagnostics, in which + // case, this method can be deleted. + @Override + public CharSequence readSource(JavaFileObject filename) { + try { + inputFiles.add(filename); + boolean prev = bark.setDiagnosticsIgnored(true); + try { + return filename.getCharContent(false); + } + finally { + bark.setDiagnosticsIgnored(prev); + } + } catch (IOException e) { + bark.error(Position.NOPOS, "cant.read.file", filename); + return null; + } + } + + /** Parse contents of input stream. + * @param filename The name of the file from which input stream comes. + * @param input The input stream to be parsed. + */ + // PROVIDED FOR BACKWARDS COMPATIBILITY + // In Tiger, diagnostics from the scanner and parser were ignored. + // This method provides compatibility with that behavior. + // It would be better to honor those diagnostics, in which + // case, this method can be deleted. + @Override + protected JCCompilationUnit parse(JavaFileObject filename, CharSequence content) { + boolean prev = bark.setDiagnosticsIgnored(true); + try { + return super.parse(filename, content); + } + finally { + bark.setDiagnosticsIgnored(prev); + } + } + + @Override + protected boolean keepComments() { + return true; // make doc comments available to mirror API impl. + } + + /** Track when the JavaCompiler has been used to compile something. */ + private boolean hasBeenUsed = false; + + /** Main method: compile a list of files, return all compiled classes + * @param filenames The names of all files to be compiled. + */ + public List compile(List filenames, + Map origOptions, + ClassLoader aptCL, + AnnotationProcessorFactory providedFactory, + java.util.Set > productiveFactories, + java.util.Set aggregateGenFiles) + throws Throwable { + // as a JavaCompiler can only be used once, throw an exception if + // it has been used before. + assert !hasBeenUsed : "attempt to reuse JavaCompiler"; + hasBeenUsed = true; + + this.aggregateGenFiles = aggregateGenFiles; + + long msec = System.currentTimeMillis(); + + ListBuffer classes = new ListBuffer(); + try { + //parse all files + ListBuffer trees = new ListBuffer(); + for (List l = filenames; l.nonEmpty(); l = l.tail) { + if (classesAsDecls) { + if (! l.head.endsWith(".java") ) { // process as class file + ClassSymbol cs = reader.enterClass(names.fromString(l.head)); + try { + cs.complete(); + } catch(Symbol.CompletionFailure cf) { + bark.aptError("CantFindClass", l); + continue; + } + + classes.append(cs); // add to list of classes + continue; + } + } + trees.append(parse(l.head)); + } + + //enter symbols for all files + List roots = trees.toList(); + + if (errorCount() == 0) { + boolean prev = bark.setDiagnosticsIgnored(true); + try { + enter.main(roots); + } + finally { + bark.setDiagnosticsIgnored(prev); + } + } + + if (errorCount() == 0) { + apt.main(roots, + classes, + origOptions, aptCL, + providedFactory, + productiveFactories); + genSourceFileNames.addAll(apt.getSourceFileNames()); + genClassFileNames.addAll(apt.getClassFileNames()); + } + + } catch (Abort ex) { + } + + if (verbose) + printVerbose("total", Long.toString(System.currentTimeMillis() - msec)); + + chk.reportDeferredDiagnostics(); + + printCount("error", errorCount()); + printCount("warn", warningCount()); + + return classes.toList(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/main/Main.java b/langtools/src/share/classes/com/sun/tools/apt/main/Main.java new file mode 100644 index 00000000000..5a0493d879a --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/main/Main.java @@ -0,0 +1,1329 @@ +/* + * Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.main; + +import java.io.File; +import java.io.FileOutputStream; +import java.io.FileWriter; +import java.io.IOException; +import java.io.PrintWriter; +import java.text.MessageFormat; +import java.util.ResourceBundle; +import java.util.MissingResourceException; +import java.util.StringTokenizer; +import java.util.Map; +import java.util.HashMap; +import java.util.Collections; +import java.util.Collection; + +import java.net.URLClassLoader; +import java.net.URL; +import java.io.File; +import java.net.MalformedURLException; + +import com.sun.tools.javac.util.Paths; +import com.sun.tools.javac.code.Source; +import com.sun.tools.javac.code.Symbol; +import com.sun.tools.javac.code.Type; +import com.sun.tools.javac.jvm.Target; +import com.sun.tools.javac.util.*; + +import com.sun.tools.apt.comp.AnnotationProcessingError; +import com.sun.tools.apt.comp.UsageMessageNeededException; +import com.sun.tools.apt.util.Bark; +import com.sun.mirror.apt.AnnotationProcessorFactory; + +/** This class provides a commandline interface to the apt build-time + * tool. + * + *

This is NOT part of any API supported by Sun Microsystems. + * If you write code that depends on this, you do so at your own + * risk. This code and its internal interfaces are subject to change + * or deletion without notice. + */ +public class Main { + + /** For testing: enter any options you want to be set implicitly + * here. + */ + static String[] forcedOpts = { + // Preserve parameter names from class files if the class was + // compiled with debug enabled + "-XDsave-parameter-names" + }; + + /** The name of the compiler, for use in diagnostics. + */ + String ownName; + + /** The writer to use for diagnostic output. + */ + PrintWriter out; + + + /** Instantiated factory to use in lieu of discovery process. + */ + AnnotationProcessorFactory providedFactory = null; + + /** Map representing original command-line arguments. + */ + Map origOptions = new HashMap(); + + /** Classloader to use for finding factories. + */ + ClassLoader aptCL = null; + + /** Result codes. + */ + static final int + EXIT_OK = 0, // Compilation completed with no errors. + EXIT_ERROR = 1, // Completed but reported errors. + EXIT_CMDERR = 2, // Bad command-line arguments + EXIT_SYSERR = 3, // System error or resource exhaustion. + EXIT_ABNORMAL = 4; // Compiler terminated abnormally + + /** This class represents an option recognized by the main program + */ + private class Option { + /** Whether or not the option is used only aptOnly. + */ + boolean aptOnly = false; + + /** Option string. + */ + String name; + + /** Documentation key for arguments. + */ + String argsNameKey; + + /** Documentation key for description. + */ + String descrKey; + + /** Suffix option (-foo=bar or -foo:bar) + */ + boolean hasSuffix; + + Option(String name, String argsNameKey, String descrKey) { + this.name = name; + this.argsNameKey = argsNameKey; + this.descrKey = descrKey; + char lastChar = name.charAt(name.length()-1); + hasSuffix = lastChar == ':' || lastChar == '='; + } + Option(String name, String descrKey) { + this(name, null, descrKey); + } + + public String toString() { + return name; + } + + /** Does this option take a (separate) operand? + */ + boolean hasArg() { + return argsNameKey != null && !hasSuffix; + } + + /** Does argument string match option pattern? + * @param arg The command line argument string. + */ + boolean matches(String arg) { + return hasSuffix ? arg.startsWith(name) : arg.equals(name); + } + + /** For javac-only options, print nothing. + */ + void help() { + } + + String helpSynopsis() { + return name + + (argsNameKey == null ? "" : + ((hasSuffix ? "" : " ") + + getLocalizedString(argsNameKey))); + } + + /** Print a line of documentation describing this option, if non-standard. + */ + void xhelp() {} + + /** Process the option (with arg). Return true if error detected. + */ + boolean process(String option, String arg) { + options.put(option, arg); + return false; + } + + /** Process the option (without arg). Return true if error detected. + */ + boolean process(String option) { + if (hasSuffix) + return process(name, option.substring(name.length())); + else + return process(option, option); + } + }; + + private class SharedOption extends Option { + SharedOption(String name, String argsNameKey, String descrKey) { + super(name, argsNameKey, descrKey); + } + + SharedOption(String name, String descrKey) { + super(name, descrKey); + } + + void help() { + String s = " " + helpSynopsis(); + out.print(s); + for (int j = s.length(); j < 29; j++) out.print(" "); + Bark.printLines(out, getLocalizedString(descrKey)); + } + + } + + private class AptOption extends Option { + AptOption(String name, String argsNameKey, String descrKey) { + super(name, argsNameKey, descrKey); + aptOnly = true; + } + + AptOption(String name, String descrKey) { + super(name, descrKey); + aptOnly = true; + } + + /** Print a line of documentation describing this option, if standard. + */ + void help() { + String s = " " + helpSynopsis(); + out.print(s); + for (int j = s.length(); j < 29; j++) out.print(" "); + Bark.printLines(out, getLocalizedString(descrKey)); + } + + } + + /** A nonstandard or extended (-X) option + */ + private class XOption extends Option { + XOption(String name, String argsNameKey, String descrKey) { + super(name, argsNameKey, descrKey); + } + XOption(String name, String descrKey) { + this(name, null, descrKey); + } + void help() {} + void xhelp() {} + }; + + /** A nonstandard or extended (-X) option + */ + private class AptXOption extends Option { + AptXOption(String name, String argsNameKey, String descrKey) { + super(name, argsNameKey, descrKey); + aptOnly = true; + } + AptXOption(String name, String descrKey) { + this(name, null, descrKey); + } + void xhelp() { + String s = " " + helpSynopsis(); + out.print(s); + for (int j = s.length(); j < 29; j++) out.print(" "); + Log.printLines(out, getLocalizedString(descrKey)); + } + }; + + /** A hidden (implementor) option + */ + private class HiddenOption extends Option { + HiddenOption(String name) { + super(name, null, null); + } + HiddenOption(String name, String argsNameKey) { + super(name, argsNameKey, null); + } + void help() {} + void xhelp() {} + }; + + private class AptHiddenOption extends HiddenOption { + AptHiddenOption(String name) { + super(name); + aptOnly = true; + } + AptHiddenOption(String name, String argsNameKey) { + super(name, argsNameKey); + aptOnly = true; + } + } + + private Option[] recognizedOptions = { + new Option("-g", "opt.g"), + new Option("-g:none", "opt.g.none") { + boolean process(String option) { + options.put("-g:", "none"); + return false; + } + }, + + new Option("-g:{lines,vars,source}", "opt.g.lines.vars.source") { + boolean matches(String s) { + return s.startsWith("-g:"); + } + boolean process(String option) { + String suboptions = option.substring(3); + options.put("-g:", suboptions); + // enter all the -g suboptions as "-g:suboption" + for (StringTokenizer t = new StringTokenizer(suboptions, ","); t.hasMoreTokens(); ) { + String tok = t.nextToken(); + String opt = "-g:" + tok; + options.put(opt, opt); + } + return false; + } + }, + + new XOption("-Xlint", "opt.Xlint"), + new XOption("-Xlint:{" + + "all," + + "cast,deprecation,divzero,empty,unchecked,fallthrough,path,serial,finally,overrides," + + "-cast,-deprecation,-divzero,-empty,-unchecked,-fallthrough,-path,-serial,-finally,-overrides," + + "none}", + "opt.Xlint.suboptlist") { + boolean matches(String s) { + return s.startsWith("-Xlint:"); + } + boolean process(String option) { + String suboptions = option.substring(7); + options.put("-Xlint:", suboptions); + // enter all the -Xlint suboptions as "-Xlint:suboption" + for (StringTokenizer t = new StringTokenizer(suboptions, ","); t.hasMoreTokens(); ) { + String tok = t.nextToken(); + String opt = "-Xlint:" + tok; + options.put(opt, opt); + } + return false; + } + }, + + new Option("-nowarn", "opt.nowarn"), + new Option("-verbose", "opt.verbose"), + + // -deprecation is retained for command-line backward compatibility + new Option("-deprecation", "opt.deprecation") { + boolean process(String option) { + options.put("-Xlint:deprecation", option); + return false; + } + }, + + new SharedOption("-classpath", "opt.arg.path", "opt.classpath"), + new SharedOption("-cp", "opt.arg.path", "opt.classpath") { + boolean process(String option, String arg) { + return super.process("-classpath", arg); + } + }, + new Option("-sourcepath", "opt.arg.path", "opt.sourcepath"), + new Option("-bootclasspath", "opt.arg.path", "opt.bootclasspath") { + boolean process(String option, String arg) { + options.remove("-Xbootclasspath/p:"); + options.remove("-Xbootclasspath/a:"); + return super.process(option, arg); + } + }, + new XOption("-Xbootclasspath/p:", "opt.arg.path", "opt.Xbootclasspath.p"), + new XOption("-Xbootclasspath/a:", "opt.arg.path", "opt.Xbootclasspath.a"), + new XOption("-Xbootclasspath:", "opt.arg.path", "opt.bootclasspath") { + boolean process(String option, String arg) { + options.remove("-Xbootclasspath/p:"); + options.remove("-Xbootclasspath/a:"); + return super.process("-bootclasspath", arg); + } + }, + new Option("-extdirs", "opt.arg.dirs", "opt.extdirs"), + new XOption("-Djava.ext.dirs=", "opt.arg.dirs", "opt.extdirs") { + boolean process(String option, String arg) { + return super.process("-extdirs", arg); + } + }, + new Option("-endorseddirs", "opt.arg.dirs", "opt.endorseddirs"), + new XOption("-Djava.endorsed.dirs=","opt.arg.dirs", "opt.endorseddirs") { + boolean process(String option, String arg) { + return super.process("-endorseddirs", arg); + } + }, + new Option("-proc:{none, only}", "opt.proc.none.only") { + public boolean matches(String s) { + return s.equals("-proc:none") || s.equals("-proc:only"); + } + }, + new Option("-processor", "opt.arg.class", "opt.processor"), + new Option("-processorpath", "opt.arg.path", "opt.processorpath"), + + new SharedOption("-d", "opt.arg.path", "opt.d"), + new SharedOption("-s", "opt.arg.path", "opt.s"), + new Option("-encoding", "opt.arg.encoding", "opt.encoding"), + new SharedOption("-source", "opt.arg.release", "opt.source") { + boolean process(String option, String operand) { + Source source = Source.lookup(operand); + if (source == null) { + error("err.invalid.source", operand); + return true; + } else if (source.compareTo(Source.JDK1_5) > 0) { + error("err.unsupported.source.version", operand); + return true; + } + return super.process(option, operand); + } + }, + new Option("-target", "opt.arg.release", "opt.target") { + boolean process(String option, String operand) { + Target target = Target.lookup(operand); + if (target == null) { + error("err.invalid.target", operand); + return true; + } else if (target.compareTo(Target.JDK1_5) > 0) { + error("err.unsupported.target.version", operand); + return true; + } + return super.process(option, operand); + } + }, + new AptOption("-version", "opt.version") { + boolean process(String option) { + Bark.printLines(out, ownName + " " + JavaCompiler.version()); + return super.process(option); + } + }, + new HiddenOption("-fullversion"), + new AptOption("-help", "opt.help") { + boolean process(String option) { + Main.this.help(); + return super.process(option); + } + }, + new SharedOption("-X", "opt.X") { + boolean process(String option) { + Main.this.xhelp(); + return super.process(option); + } + }, + + // This option exists only for the purpose of documenting itself. + // It's actually implemented by the launcher. + new AptOption("-J", "opt.arg.flag", "opt.J") { + String helpSynopsis() { + hasSuffix = true; + return super.helpSynopsis(); + } + boolean process(String option) { + throw new AssertionError + ("the -J flag should be caught by the launcher."); + } + }, + + + new SharedOption("-A", "opt.proc.flag", "opt.A") { + String helpSynopsis() { + hasSuffix = true; + return super.helpSynopsis(); + } + + boolean matches(String arg) { + return arg.startsWith("-A"); + } + + boolean hasArg() { + return false; + } + + boolean process(String option) { + return process(option, option); + } + }, + + new AptOption("-nocompile", "opt.nocompile"), + + new AptOption("-print", "opt.print"), + + new AptOption("-factorypath", "opt.arg.path", "opt.factorypath"), + + new AptOption("-factory", "opt.arg.class", "opt.factory"), + + new AptXOption("-XListAnnotationTypes", "opt.XListAnnotationTypes"), + + new AptXOption("-XListDeclarations", "opt.XListDeclarations"), + + new AptXOption("-XPrintAptRounds", "opt.XPrintAptRounds"), + + new AptXOption("-XPrintFactoryInfo", "opt.XPrintFactoryInfo"), + + /* + * Option to treat both classes and source files as + * declarations that can be given on the command line and + * processed as the result of an apt round. + */ + new AptXOption("-XclassesAsDecls", "opt.XClassesAsDecls"), + + // new Option("-moreinfo", "opt.moreinfo") { + new HiddenOption("-moreinfo") { + boolean process(String option) { + Type.moreInfo = true; + return super.process(option); + } + }, + + // treat warnings as errors + new HiddenOption("-Werror"), + + // use complex inference from context in the position of a method call argument + new HiddenOption("-complexinference"), + + // prompt after each error + // new Option("-prompt", "opt.prompt"), + new HiddenOption("-prompt"), + + // dump stack on error + new HiddenOption("-doe"), + + // display warnings for generic unchecked and unsafe operations + new HiddenOption("-warnunchecked") { + boolean process(String option) { + options.put("-Xlint:unchecked", option); + return false; + } + }, + + new HiddenOption("-Xswitchcheck") { + boolean process(String option) { + options.put("-Xlint:switchcheck", option); + return false; + } + }, + + // generate trace output for subtyping operations + new HiddenOption("-debugsubtyping"), + + new XOption("-Xmaxerrs", "opt.arg.number", "opt.maxerrs"), + new XOption("-Xmaxwarns", "opt.arg.number", "opt.maxwarns"), + new XOption("-Xstdout", "opt.arg.file", "opt.Xstdout") { + boolean process(String option, String arg) { + try { + out = new PrintWriter(new FileWriter(arg), true); + } catch (java.io.IOException e) { + error("err.error.writing.file", arg, e); + return true; + } + return super.process(option, arg); + } + }, + + new XOption("-Xprint", "opt.print"), + + new XOption("-XprintRounds", "opt.printRounds"), + + new XOption("-XprintProcessorInfo", "opt.printProcessorInfo"), + + + /* -O is a no-op, accepted for backward compatibility. */ + new HiddenOption("-O"), + + /* -Xjcov produces tables to support the code coverage tool jcov. */ + new HiddenOption("-Xjcov"), + + /* This is a back door to the compiler's option table. + * -Dx=y sets the option x to the value y. + * -Dx sets the option x to the value x. + */ + new HiddenOption("-XD") { + String s; + boolean matches(String s) { + this.s = s; + return s.startsWith(name); + } + boolean process(String option) { + s = s.substring(name.length()); + int eq = s.indexOf('='); + String key = (eq < 0) ? s : s.substring(0, eq); + String value = (eq < 0) ? s : s.substring(eq+1); + options.put(key, value); + return false; + } + }, + + new HiddenOption("sourcefile") { + String s; + boolean matches(String s) { + this.s = s; + return s.endsWith(".java") || + (options.get("-XclassesAsDecls") != null); + } + boolean process(String option) { + if (s.endsWith(".java")) { + if (!sourceFileNames.contains(s)) + sourceFileNames.add(s); + } else if (options.get("-XclassesAsDecls") != null) { + classFileNames.add(s); + } + return false; + } + }, + }; + + /** + * Construct a compiler instance. + */ + public Main(String name) { + this(name, new PrintWriter(System.err, true)); + } + + /** + * Construct a compiler instance. + */ + public Main(String name, PrintWriter out) { + this.ownName = name; + this.out = out; + } + + /** A table of all options that's passed to the JavaCompiler constructor. */ + private Options options = null; + + /** The list of source files to process + */ + java.util.List sourceFileNames = new java.util.LinkedList(); + + /** The list of class files to process + */ + java.util.List classFileNames = new java.util.LinkedList(); + + /** List of top level names of generated source files from most recent apt round. + */ + java.util.Set genSourceFileNames = new java.util.LinkedHashSet(); + + /** List of names of generated class files from most recent apt round. + */ + java.util.Set genClassFileNames = new java.util.LinkedHashSet(); + + /** + * List of all the generated source file names across all apt rounds. + */ + java.util.Set aggregateGenSourceFileNames = new java.util.LinkedHashSet(); + + /** + * List of all the generated class file names across all apt rounds. + */ + java.util.Set aggregateGenClassFileNames = new java.util.LinkedHashSet(); + + /** + * List of all the generated file names across all apt rounds. + */ + java.util.Set aggregateGenFiles = new java.util.LinkedHashSet(); + + /** + * Set of all factories that have provided a processor on some apt round. + */ + java.util.Set > productiveFactories = + new java.util.LinkedHashSet >(); + + + + /** Print a string that explains usage. + */ + void help() { + Bark.printLines(out, getLocalizedString("msg.usage.header", ownName)); + for (int i=0; i < recognizedOptions.length; i++) { + recognizedOptions[i].help(); + } + Bark.printLines(out, getLocalizedString("msg.usage.footer")); + out.println(); + } + + /** Print a string that explains usage for X options. + */ + void xhelp() { + for (int i=0; i processArgs(String[] flags) { + int ac = 0; + while (ac < flags.length) { + String flag = flags[ac]; + ac++; + + int j; + for (j=0; j < recognizedOptions.length; j++) + if (recognizedOptions[j].matches(flag)) + break; + + if (j == recognizedOptions.length) { + error("err.invalid.flag", flag); + return null; + } + + Option option = recognizedOptions[j]; + if (option.hasArg()) { + if (ac == flags.length) { + error("err.req.arg", flag); + return null; + } + String operand = flags[ac]; + ac++; + if (option.process(flag, operand)) + return null; + } else { + if (option.process(flag)) + return null; + } + } + + String sourceString = options.get("-source"); + Source source = (sourceString != null) + ? Source.lookup(sourceString) + : Source.JDK1_5; // JDK 5 is the latest supported source version + String targetString = options.get("-target"); + Target target = (targetString != null) + ? Target.lookup(targetString) + : Target.JDK1_5; // JDK 5 is the latest supported source version + // We don't check source/target consistency for CLDC, as J2ME + // profiles are not aligned with J2SE targets; moreover, a + // single CLDC target may have many profiles. In addition, + // this is needed for the continued functioning of the JSR14 + // prototype. + if (Character.isDigit(target.name.charAt(0)) && + target.compareTo(source.requiredTarget()) < 0) { + if (targetString != null) { + if (sourceString == null) { + warning("warn.target.default.source.conflict", + targetString, + source.requiredTarget().name); + } else { + warning("warn.source.target.conflict", + sourceString, + source.requiredTarget().name); + } + return null; + } else { + options.put("-target", source.requiredTarget().name); + } + } + return sourceFileNames; + } + + /** Programmatic interface for main function. + * @param args The command line parameters. + */ + public int compile(String[] args, AnnotationProcessorFactory factory) { + int returnCode = 0; + providedFactory = factory; + + Context context = new Context(); + options = Options.instance(context); + Bark bark; + + /* + * Process the command line options to create the intial + * options data. This processing is at least partially reused + * by any recursive apt calls. + */ + + // For testing: assume all arguments in forcedOpts are + // prefixed to command line arguments. + processArgs(forcedOpts); + + + /* + * A run of apt only gets passed the most recently generated + * files; the initial run of apt gets passed the files from + * the command line. + */ + + java.util.List origFilenames; + try { + // assign args the result of parse to capture results of + // '@file' expansion + origFilenames = processArgs((args=CommandLine.parse(args))); + if (origFilenames == null) { + return EXIT_CMDERR; + } else if (origFilenames.size() == 0) { + // it is allowed to compile nothing if just asking for help + if (options.get("-help") != null || + options.get("-X") != null) + return EXIT_OK; + } + } catch (java.io.FileNotFoundException e) { + Bark.printLines(out, ownName + ": " + + getLocalizedString("err.file.not.found", + e.getMessage())); + return EXIT_SYSERR; + } catch (IOException ex) { + ioMessage(ex); + return EXIT_SYSERR; + } catch (OutOfMemoryError ex) { + resourceMessage(ex); + return EXIT_SYSERR; + } catch (StackOverflowError ex) { + resourceMessage(ex); + return EXIT_SYSERR; + } catch (FatalError ex) { + feMessage(ex); + return EXIT_SYSERR; + } catch (sun.misc.ServiceConfigurationError sce) { + sceMessage(sce); + return EXIT_ABNORMAL; + } catch (Throwable ex) { + bugMessage(ex); + return EXIT_ABNORMAL; + } + + + boolean firstRound = true; + boolean needSourcePath = false; + boolean needClassPath = false; + boolean classesAsDecls = options.get("-XclassesAsDecls") != null; + + /* + * Create augumented classpath and sourcepath values. + * + * If any of the prior apt rounds generated any new source + * files, the n'th apt round (and any javac invocation) has the + * source destination path ("-s path") as the last element of + * the "-sourcepath" to the n'th call. + * + * If any of the prior apt rounds generated any new class files, + * the n'th apt round (and any javac invocation) has the class + * destination path ("-d path") as the last element of the + * "-classpath" to the n'th call. + */ + String augmentedSourcePath = ""; + String augmentedClassPath = ""; + String baseClassPath = ""; + + try { + /* + * Record original options for future annotation processor + * invocations. + */ + origOptions = new HashMap(options.size()); + for(String s: options.keySet()) { + String value; + if (s.equals(value = options.get(s))) + origOptions.put(s, (String)null); + else + origOptions.put(s, value); + } + origOptions = Collections.unmodifiableMap(origOptions); + + { + // Note: it might be necessary to check for an empty + // component ("") of the source path or class path + Paths paths = Paths.instance(context); + + String sourceDest = options.get("-s"); + if (paths.sourcePath() != null) { + for(File f: paths.sourcePath()) + augmentedSourcePath += (f + File.pathSeparator); + augmentedSourcePath += (sourceDest == null)?".":sourceDest; + } else { + augmentedSourcePath = "."; + + if (sourceDest != null) + augmentedSourcePath += (File.pathSeparator + sourceDest); + } + + String classDest = options.get("-d"); + if (paths.userClassPath() != null) { + for(File f: paths.userClassPath()) + baseClassPath += (f + File.pathSeparator); + // put baseClassPath into map to handle any + // value needed for the classloader + options.put("-classpath", baseClassPath); + + augmentedClassPath = baseClassPath + ((classDest == null)?".":classDest); + } else { + baseClassPath = "."; + if (classDest != null) + augmentedClassPath = baseClassPath + (File.pathSeparator + classDest); + } + assert options.get("-classpath") != null; + } + + /* + * Create base and augmented class loaders + */ + ClassLoader augmentedAptCL = null; + { + /* + * Use a url class loader to look for classes on the + * user-specified class path. Prepend computed bootclass + * path, which includes extdirs, to the URLClassLoader apt + * uses. + */ + String aptclasspath = ""; + Paths paths = Paths.instance(context); + String bcp = ""; + Collection bootclasspath = paths.bootClassPath(); + + if (bootclasspath != null) { + for(File f: bootclasspath) + bcp += (f + File.pathSeparator); + } + + // If the factory path is set, use that path + if (providedFactory == null) + aptclasspath = options.get("-factorypath"); + if (aptclasspath == null) + aptclasspath = options.get("-classpath"); + + assert aptclasspath != null; + aptclasspath = (bcp + aptclasspath); + aptCL = new URLClassLoader(pathToURLs(aptclasspath)); + + if (providedFactory == null && + options.get("-factorypath") != null) // same CL even if new class files written + augmentedAptCL = aptCL; + else { + // Create class loader in case new class files are + // written + augmentedAptCL = new URLClassLoader(pathToURLs(augmentedClassPath. + substring(baseClassPath.length())), + aptCL); + } + } + + int round = 0; // For -XPrintAptRounds + do { + round++; + + Context newContext = new Context(); + Options newOptions = Options.instance(newContext); // creates a new context + newOptions.putAll(options); + + // populate with old options... don't bother reparsing command line, etc. + + // if genSource files, must add destination to source path + if (genSourceFileNames.size() > 0 && !firstRound) { + newOptions.put("-sourcepath", augmentedSourcePath); + needSourcePath = true; + } + aggregateGenSourceFileNames.addAll(genSourceFileNames); + sourceFileNames.addAll(genSourceFileNames); + genSourceFileNames.clear(); + + // Don't really need to track this; just have to add -d + // "foo" to class path if any class files are generated + if (genClassFileNames.size() > 0) { + newOptions.put("-classpath", augmentedClassPath); + aptCL = augmentedAptCL; + needClassPath = true; + } + aggregateGenClassFileNames.addAll(genClassFileNames); + classFileNames.addAll(genClassFileNames); + genClassFileNames.clear(); + + options = newOptions; + + if (options.get("-XPrintAptRounds") != null) { + out.println("apt Round : " + round); + out.println("filenames: " + sourceFileNames); + if (classesAsDecls) + out.println("classnames: " + classFileNames); + out.println("options: " + options); + } + + returnCode = compile(args, newContext); + firstRound = false; + + // Check for reported errors before continuing + bark = Bark.instance(newContext); + } while(((genSourceFileNames.size() != 0 ) || + (classesAsDecls && genClassFileNames.size() != 0)) && + bark.nerrors == 0); + } catch (UsageMessageNeededException umne) { + help(); + return EXIT_CMDERR; // will cause usage message to be printed + } + + /* + * Do not compile if a processor has reported an error or if + * there are no source files to process. A more sophisticated + * test would also fail for syntax errors caught by javac. + */ + if (options.get("-nocompile") == null && + options.get("-print") == null && + bark.nerrors == 0 && + (origFilenames.size() > 0 || aggregateGenSourceFileNames.size() > 0 )) { + /* + * Need to create new argument string for calling javac: + * 1. apt specific arguments (e.g. -factory) must be stripped out + * 2. proper settings for sourcepath and classpath must be used + * 3. generated class names must be added + * 4. class file names as declarations must be removed + */ + + int newArgsLength = args.length + + (needSourcePath?1:0) + + (needClassPath?1:0) + + aggregateGenSourceFileNames.size(); + + // Null out apt-specific options and don't copy over into + // newArgs. This loop should be a lot faster; the options + // array should be replaced with a better data structure + // which includes a map from strings to options. + // + // If treating classes as declarations, must strip out + // class names from the javac argument list + argLoop: + for(int i = 0; i < args.length; i++) { + int matchPosition = -1; + + // "-A" by itself is recognized by apt but not javac + if (args[i] != null && args[i].equals("-A")) { + newArgsLength--; + args[i] = null; + continue argLoop; + } else { + optionLoop: + for(int j = 0; j < recognizedOptions.length; j++) { + if (args[i] != null && recognizedOptions[j].matches(args[i])) { + matchPosition = j; + break optionLoop; + } + } + + if (matchPosition != -1) { + Option op = recognizedOptions[matchPosition]; + if (op.aptOnly) { + newArgsLength--; + args[i] = null; + if (op.hasArg()) { + newArgsLength--; + args[i+1] = null; + } + } else { + if (op.hasArg()) { // skip over next string + i++; + continue argLoop; + } + + if ((options.get("-XclassesAsDecls") != null) && + (matchPosition == (recognizedOptions.length-1)) ){ + // Remove class file names from + // consideration by javac. + if (! args[i].endsWith(".java")) { + newArgsLength--; + args[i] = null; + } + } + } + } + } + } + + String newArgs[] = new String[newArgsLength]; + + int j = 0; + for(int i=0; i < args.length; i++) { + if (args[i] != null) + newArgs[j++] = args[i]; + } + + if (needClassPath) + newArgs[j++] = "-XD-classpath=" + augmentedClassPath; + + if (needSourcePath) { + newArgs[j++] = "-XD-sourcepath=" + augmentedSourcePath; + + for(String s: aggregateGenSourceFileNames) + newArgs[j++] = s; + } + + returnCode = com.sun.tools.javac.Main.compile(newArgs); + } + + return returnCode; + } + + /** Programmatic interface for main function. + * @param args The command line parameters. + */ + int compile(String[] args, Context context) { + boolean assertionsEnabled = false; + assert assertionsEnabled = true; + if (!assertionsEnabled) { + // Bark.printLines(out, "fatal error: assertions must be enabled when running javac"); + // return EXIT_ABNORMAL; + } + int exitCode = EXIT_OK; + + JavaCompiler comp = null; + try { + context.put(Bark.outKey, out); + + comp = JavaCompiler.instance(context); + if (comp == null) + return EXIT_SYSERR; + + java.util.List nameList = new java.util.LinkedList(); + nameList.addAll(sourceFileNames); + if (options.get("-XclassesAsDecls") != null) + nameList.addAll(classFileNames); + + List cs + = comp.compile(List.from(nameList.toArray(new String[0])), + origOptions, + aptCL, + providedFactory, + productiveFactories, + aggregateGenFiles); + + /* + * If there aren't new source files, we shouldn't bother + * running javac if there were errors. + * + * If there are new files, we should try running javac in + * case there were typing errors. + * + */ + + if (comp.errorCount() != 0 || + options.get("-Werror") != null && comp.warningCount() != 0) + return EXIT_ERROR; + } catch (IOException ex) { + ioMessage(ex); + return EXIT_SYSERR; + } catch (OutOfMemoryError ex) { + resourceMessage(ex); + return EXIT_SYSERR; + } catch (StackOverflowError ex) { + resourceMessage(ex); + return EXIT_SYSERR; + } catch (FatalError ex) { + feMessage(ex); + return EXIT_SYSERR; + } catch (UsageMessageNeededException umne) { + help(); + return EXIT_CMDERR; // will cause usage message to be printed + } catch (AnnotationProcessingError ex) { + apMessage(ex); + return EXIT_ABNORMAL; + } catch (sun.misc.ServiceConfigurationError sce) { + sceMessage(sce); + return EXIT_ABNORMAL; + } catch (Throwable ex) { + bugMessage(ex); + return EXIT_ABNORMAL; + } finally { + if (comp != null) { + comp.close(); + genSourceFileNames.addAll(comp.getSourceFileNames()); + genClassFileNames.addAll(comp.getClassFileNames()); + } + sourceFileNames = new java.util.LinkedList(); + classFileNames = new java.util.LinkedList(); + } + return exitCode; + } + + /** Print a message reporting an internal error. + */ + void bugMessage(Throwable ex) { + Bark.printLines(out, getLocalizedString("msg.bug", + JavaCompiler.version())); + ex.printStackTrace(out); + } + + /** Print a message reporting an fatal error. + */ + void apMessage(AnnotationProcessingError ex) { + Bark.printLines(out, getLocalizedString("misc.Problem")); + ex.getCause().printStackTrace(out); + } + + /** Print a message about sun.misc.Service problem. + */ + void sceMessage(sun.misc.ServiceConfigurationError ex) { + Bark.printLines(out, getLocalizedString("misc.SunMiscService")); + ex.printStackTrace(out); + } + + /** Print a message reporting an fatal error. + */ + void feMessage(Throwable ex) { + Bark.printLines(out, ex.toString()); + } + + /** Print a message reporting an input/output error. + */ + void ioMessage(Throwable ex) { + Bark.printLines(out, getLocalizedString("msg.io")); + ex.printStackTrace(out); + } + + /** Print a message reporting an out-of-resources error. + */ + void resourceMessage(Throwable ex) { + Bark.printLines(out, getLocalizedString("msg.resource")); + ex.printStackTrace(out); + } + + /* ************************************************************************ + * Internationalization + *************************************************************************/ + + /** Find a localized string in the resource bundle. + * @param key The key for the localized string. + */ + private static String getLocalizedString(String key, Object... args) { + return getText(key, args); + } + + private static final String javacRB = + "com.sun.tools.javac.resources.javac"; + + private static final String aptRB = + "com.sun.tools.apt.resources.apt"; + + private static ResourceBundle messageRBjavac; + private static ResourceBundle messageRBapt; + + /** Initialize ResourceBundle. + */ + private static void initResource() { + try { + messageRBapt = ResourceBundle.getBundle(aptRB); + messageRBjavac = ResourceBundle.getBundle(javacRB); + } catch (MissingResourceException e) { + Error x = new FatalError("Fatal Error: Resource for apt or javac is missing"); + x.initCause(e); + throw x; + } + } + + /** Get and format message string from resource. + */ + private static String getText(String key, Object... _args) { + String[] args = new String[_args.length]; + for (int i=0; i<_args.length; i++) { + args[i] = "" + _args[i]; + } + if (messageRBapt == null || messageRBjavac == null ) + initResource(); + try { + return MessageFormat.format(messageRBapt.getString("apt." + key), + (Object[]) args); + } catch (MissingResourceException e) { + try { + return MessageFormat.format(messageRBjavac.getString("javac." + key), + (Object[]) args); + } catch (MissingResourceException f) { + String msg = "apt or javac message file broken: key={0} " + + "arguments={1}, {2}"; + return MessageFormat.format(msg, (Object[]) args); + } + } + } + + // Borrowed from DocletInvoker + /** + * Utility method for converting a search path string to an array + * of directory and JAR file URLs. + * + * @param path the search path string + * @return the resulting array of directory and JAR file URLs + */ + static URL[] pathToURLs(String path) { + StringTokenizer st = new StringTokenizer(path, File.pathSeparator); + URL[] urls = new URL[st.countTokens()]; + int count = 0; + while (st.hasMoreTokens()) { + URL url = fileToURL(new File(st.nextToken())); + if (url != null) { + urls[count++] = url; + } + } + if (urls.length != count) { + URL[] tmp = new URL[count]; + System.arraycopy(urls, 0, tmp, 0, count); + urls = tmp; + } + return urls; + } + + /** + * Returns the directory or JAR file URL corresponding to the specified + * local file name. + * + * @param file the File object + * @return the resulting directory or JAR file URL, or null if unknown + */ + static URL fileToURL(File file) { + String name; + try { + name = file.getCanonicalPath(); + } catch (IOException e) { + name = file.getAbsolutePath(); + } + name = name.replace(File.separatorChar, '/'); + if (!name.startsWith("/")) { + name = "/" + name; + } + // If the file does not exist, then assume that it's a directory + if (!file.isFile()) { + name = name + "/"; + } + try { + return new URL("file", "", name); + } catch (MalformedURLException e) { + throw new IllegalArgumentException("file"); + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/AptEnv.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/AptEnv.java new file mode 100644 index 00000000000..d139bbaa0b7 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/AptEnv.java @@ -0,0 +1,107 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror; + + +import com.sun.tools.apt.mirror.declaration.DeclarationMaker; +import com.sun.tools.apt.mirror.type.TypeMaker; +import com.sun.tools.javac.code.*; +import com.sun.tools.javac.code.Symbol.CompletionFailure; +import com.sun.tools.javac.comp.Attr; +import com.sun.tools.javac.comp.Enter; +import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.util.Name; + + +/** + * The environment for a run of apt. + */ + +public class AptEnv { + + public Name.Table names; // javac's name table + public Symtab symtab; // javac's predefined symbols + public Types jctypes; // javac's type utilities + public Enter enter; // javac's enter phase + public Attr attr; // javac's attr phase (to evaluate + // constant initializers) + public TypeMaker typeMaker; // apt's internal type utilities + public DeclarationMaker declMaker; // apt's internal declaration utilities + + + private static final Context.Key aptEnvKey = + new Context.Key(); + + public static AptEnv instance(Context context) { + AptEnv instance = context.get(aptEnvKey); + if (instance == null) { + instance = new AptEnv(context); + } + return instance; + } + + private AptEnv(Context context) { + context.put(aptEnvKey, this); + + names = Name.Table.instance(context); + symtab = Symtab.instance(context); + jctypes = Types.instance(context); + enter = Enter.instance(context); + attr = Attr.instance(context); + typeMaker = TypeMaker.instance(context); + declMaker = DeclarationMaker.instance(context); + } + + + /** + * Does a symbol have a given flag? Forces symbol completion. + */ + public static boolean hasFlag(Symbol sym, long flag) { + return (getFlags(sym) & flag) != 0; + } + + /** + * Returns a symbol's flags. Forces completion. + */ + public static long getFlags(Symbol sym) { + complete(sym); + return sym.flags(); + } + + /** + * Completes a symbol, ignoring completion failures. + */ + private static void complete(Symbol sym) { + while (true) { + try { + sym.complete(); + return; + } catch (CompletionFailure e) { + // Should never see two in a row, but loop just to be sure. + } + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/AnnotationProcessorEnvironmentImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/AnnotationProcessorEnvironmentImpl.java new file mode 100644 index 00000000000..974d464a330 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/AnnotationProcessorEnvironmentImpl.java @@ -0,0 +1,184 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.apt; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.util.*; +import com.sun.mirror.apt.*; +import com.sun.tools.apt.mirror.apt.*; +import com.sun.tools.apt.mirror.declaration.DeclarationMaker; +import com.sun.tools.apt.mirror.util.*; +import com.sun.tools.apt.util.Bark; +import com.sun.tools.javac.util.Context; + +import com.sun.tools.apt.mirror.apt.FilerImpl; +import com.sun.tools.apt.mirror.apt.MessagerImpl; +import com.sun.tools.apt.mirror.apt.RoundStateImpl; +import com.sun.tools.apt.mirror.apt.RoundCompleteEventImpl; + +import com.sun.tools.javac.util.Context; + +import java.util.*; +import static com.sun.mirror.util.DeclarationVisitors.*; + +/* + * Annotation Processor Environment implementation. + */ +public class AnnotationProcessorEnvironmentImpl implements AnnotationProcessorEnvironment { + + Collection spectypedecls; + Collection typedecls; + Map origOptions; + DeclarationMaker declMaker; + Declarations declUtils; + Types typeUtils; + Messager messager; + FilerImpl filer; + Bark bark; + Set roundCompleteListeners; + + public AnnotationProcessorEnvironmentImpl(Collection spectypedecls, + Collection typedecls, + Map origOptions, + Context context) { + // Safer to copy collections before applying unmodifiable + // wrapper. + this.spectypedecls = Collections.unmodifiableCollection(spectypedecls); + this.typedecls = Collections.unmodifiableCollection(typedecls); + this.origOptions = Collections.unmodifiableMap(origOptions); + + declMaker = DeclarationMaker.instance(context); + declUtils = DeclarationsImpl.instance(context); + typeUtils = TypesImpl.instance(context); + messager = MessagerImpl.instance(context); + filer = FilerImpl.instance(context); + bark = Bark.instance(context); + roundCompleteListeners = new LinkedHashSet(); + } + + public Map getOptions() { + return origOptions; + } + + public Messager getMessager() { + return messager; + } + + public Filer getFiler() { + return filer; + } + + public Collection getSpecifiedTypeDeclarations() { + return spectypedecls; + } + + public PackageDeclaration getPackage(String name) { + return declMaker.getPackageDeclaration(name); + } + + public TypeDeclaration getTypeDeclaration(String name) { + return declMaker.getTypeDeclaration(name); + } + + public Collection getTypeDeclarations() { + return typedecls; + } + + public Collection getDeclarationsAnnotatedWith( + AnnotationTypeDeclaration a) { + /* + * create collection of Declarations annotated with a given + * annotation. + */ + + CollectingAP proc = new CollectingAP(this, a); + proc.process(); + return proc.decls; + } + + private static class CollectingAP implements AnnotationProcessor { + AnnotationProcessorEnvironment env; + Collection decls; + AnnotationTypeDeclaration atd; + CollectingAP(AnnotationProcessorEnvironment env, + AnnotationTypeDeclaration atd) { + this.env = env; + this.atd = atd; + decls = new HashSet(); + } + + private class CollectingVisitor extends SimpleDeclarationVisitor { + public void visitDeclaration(Declaration d) { + for(AnnotationMirror am: d.getAnnotationMirrors()) { + if (am.getAnnotationType().getDeclaration().equals(CollectingAP.this.atd)) + CollectingAP.this.decls.add(d); + } + } + } + + public void process() { + for(TypeDeclaration d: env.getSpecifiedTypeDeclarations()) + d.accept(getSourceOrderDeclarationScanner(new CollectingVisitor(), + NO_OP)); + } + } + + public Declarations getDeclarationUtils() { + return declUtils; + } + + public Types getTypeUtils() { + return typeUtils; + } + + public void addListener(AnnotationProcessorListener listener) { + if (listener == null) + throw new NullPointerException(); + else { + if (listener instanceof RoundCompleteListener) + roundCompleteListeners.add((RoundCompleteListener)listener); + } + } + + public void removeListener(AnnotationProcessorListener listener) { + if (listener == null) + throw new NullPointerException(); + else + roundCompleteListeners.remove(listener); + } + + public void roundComplete() { + RoundState roundState = new RoundStateImpl(bark.nerrors > 0, + filer.getSourceFileNames().size() > 0, + filer.getClassFileNames().size() > 0, + origOptions); + RoundCompleteEvent roundCompleteEvent = new RoundCompleteEventImpl(this, roundState); + + filer.roundOver(); + for(RoundCompleteListener rcl: roundCompleteListeners) + rcl.roundComplete(roundCompleteEvent); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/FilerImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/FilerImpl.java new file mode 100644 index 00000000000..fb01d6b33d5 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/FilerImpl.java @@ -0,0 +1,354 @@ +/* + * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.apt; + + +import java.io.*; +import java.util.Collection; +import java.util.EnumMap; +import java.util.HashSet; +import java.util.Set; + +import com.sun.mirror.apt.Filer; +import com.sun.tools.apt.mirror.declaration.DeclarationMaker; +import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.util.Options; +import com.sun.tools.javac.util.Position; +import com.sun.tools.apt.util.Bark; + +import static com.sun.mirror.apt.Filer.Location.*; + + +/** + * Implementation of Filer. + */ + +public class FilerImpl implements Filer { + /* + * The Filer class must maintain a number of constraints. First, + * multiple attempts to open the same path within the same + * invocation of apt results in an IOException being thrown. For + * example, trying to open the same source file twice: + * + * createSourceFile("foo.Bar") + * ... + * createSourceFile("foo.Bar") + * + * is disallowed as is opening a text file that happens to have + * the same name as a source file: + * + * createSourceFile("foo.Bar") + * ... + * createTextFile(SOURCE_TREE, "foo", new File("Bar"), null) + * + * Additionally, creating a source file that corresponds to an + * already created class file (or vice versa) generates at least a + * warning. This is an error if -XclassesAsDecls is being used + * since you can't create the same type twice. However, if the + * Filer is used to create a text file named *.java that happens + * to correspond to an existing class file, a warning is *not* + * generated. Similarly, a warning is not generated for a binary + * file named *.class and an existing source file. + * + * The reason for this difference is that source files and class + * files are registered with apt and can get passed on as + * declarations to the next round of processing. Files that are + * just named *.java and *.class are not processed in that manner; + * although having extra source files and class files on the + * source path and class path can alter the behavior of the tool + * and any final compile. + */ + + private enum FileKind { + SOURCE { + void register(File file, String name, FilerImpl that) throws IOException { + // Check for corresponding class file + if (that.filesCreated.contains(new File(that.locations.get(CLASS_TREE), + that.nameToPath(name, ".class")))) { + + that.bark.aptWarning("CorrespondingClassFile", name); + if (that.opts.get("-XclassesAsDecls") != null) + throw new IOException(); + } + that.sourceFileNames.add(file.getPath()); + } + }, + + CLASS { + void register(File file, String name, FilerImpl that) throws IOException { + if (that.filesCreated.contains(new File(that.locations.get(SOURCE_TREE), + that.nameToPath(name, ".java")))) { + that.bark.aptWarning("CorrespondingSourceFile", name); + if (that.opts.get("-XclassesAsDecls") != null) + throw new IOException(); + } + // Track the binary name instead of the filesystem location + that.classFileNames.add(name); + } + }, + + OTHER { + // Nothing special to do + void register(File file, String name, FilerImpl that) throws IOException {} + }; + + abstract void register(File file, String name, FilerImpl that) throws IOException; + } + + private final Options opts; + private final DeclarationMaker declMaker; + private final com.sun.tools.apt.main.JavaCompiler comp; + + // Platform's default encoding + private final static String DEFAULT_ENCODING = + new OutputStreamWriter(new ByteArrayOutputStream()).getEncoding(); + + private String encoding; // name of charset used for source files + + private final EnumMap locations; // where new files go + + + private static final Context.Key filerKey = + new Context.Key(); + + // Set of files opened. + private Collection wc; + + private Bark bark; + + // All created files. + private final Set filesCreated; + + // Names of newly created source files + private HashSet sourceFileNames = new HashSet(); + + // Names of newly created class files + private HashSet classFileNames = new HashSet(); + + private boolean roundOver; + + public static FilerImpl instance(Context context) { + FilerImpl instance = context.get(filerKey); + if (instance == null) { + instance = new FilerImpl(context); + } + return instance; + } + + // flush all output streams; + public void flush() { + for(Flushable opendedFile: wc) { + try { + opendedFile.flush(); + if (opendedFile instanceof FileOutputStream) { + try { + ((FileOutputStream) opendedFile).getFD().sync() ; + } catch (java.io.SyncFailedException sfe) {} + } + } catch (IOException e) { } + } + } + + private FilerImpl(Context context) { + context.put(filerKey, this); + opts = Options.instance(context); + declMaker = DeclarationMaker.instance(context); + bark = Bark.instance(context); + comp = com.sun.tools.apt.main.JavaCompiler.instance(context); + roundOver = false; + this.filesCreated = comp.getAggregateGenFiles(); + + // Encoding + encoding = opts.get("-encoding"); + if (encoding == null) { + encoding = DEFAULT_ENCODING; + } + + wc = new HashSet(); + + // Locations + locations = new EnumMap(Location.class); + String s = opts.get("-s"); // location for new source files + String d = opts.get("-d"); // location for new class files + locations.put(SOURCE_TREE, new File(s != null ? s : ".")); + locations.put(CLASS_TREE, new File(d != null ? d : ".")); + } + + + /** + * {@inheritDoc} + */ + public PrintWriter createSourceFile(String name) throws IOException { + String pathname = nameToPath(name, ".java"); + File file = new File(locations.get(SOURCE_TREE), + pathname); + PrintWriter pw = getPrintWriter(file, encoding, name, FileKind.SOURCE); + return pw; + } + + /** + * {@inheritDoc} + */ + public OutputStream createClassFile(String name) throws IOException { + String pathname = nameToPath(name, ".class"); + File file = new File(locations.get(CLASS_TREE), + pathname); + OutputStream os = getOutputStream(file, name, FileKind.CLASS); + return os; + } + + /** + * {@inheritDoc} + */ + public PrintWriter createTextFile(Location loc, + String pkg, + File relPath, + String charsetName) throws IOException { + File file = (pkg.length() == 0) + ? relPath + : new File(nameToPath(pkg), relPath.getPath()); + if (charsetName == null) { + charsetName = encoding; + } + return getPrintWriter(loc, file.getPath(), charsetName, null, FileKind.OTHER); + } + + /** + * {@inheritDoc} + */ + public OutputStream createBinaryFile(Location loc, + String pkg, + File relPath) throws IOException { + File file = (pkg.length() == 0) + ? relPath + : new File(nameToPath(pkg), relPath.getPath()); + return getOutputStream(loc, file.getPath(), null, FileKind.OTHER); + } + + + /** + * Converts the canonical name of a top-level type or package to a + * pathname. Suffix is ".java" or ".class" or "". + */ + private String nameToPath(String name, String suffix) throws IOException { + if (!DeclarationMaker.isJavaIdentifier(name.replace('.', '_'))) { + bark.aptWarning("IllegalFileName", name); + throw new IOException(); + } + return name.replace('.', File.separatorChar) + suffix; + } + + private String nameToPath(String name) throws IOException { + return nameToPath(name, ""); + } + + /** + * Returns a writer for a text file given its location, its + * pathname relative to that location, and its encoding. + */ + private PrintWriter getPrintWriter(Location loc, String pathname, + String encoding, String name, FileKind kind) throws IOException { + File file = new File(locations.get(loc), pathname); + return getPrintWriter(file, encoding, name, kind); + } + + /** + * Returns a writer for a text file given its encoding. + */ + private PrintWriter getPrintWriter(File file, + String encoding, String name, FileKind kind) throws IOException { + prepareFile(file, name, kind); + PrintWriter pw = + new PrintWriter( + new BufferedWriter( + new OutputStreamWriter(new FileOutputStream(file), + encoding))); + wc.add(pw); + return pw; + } + + /** + * Returns an output stream for a binary file given its location + * and its pathname relative to that location. + */ + private OutputStream getOutputStream(Location loc, String pathname, String name, FileKind kind) + throws IOException { + File file = new File(locations.get(loc), pathname); + return getOutputStream(file, name, kind); + } + + private OutputStream getOutputStream(File file, String name, FileKind kind) throws IOException { + prepareFile(file, name, kind); + OutputStream os = new FileOutputStream(file); + wc.add(os); + return os; + + } + + public Set getSourceFileNames() { + return sourceFileNames; + } + + public Set getClassFileNames() { + return classFileNames; + } + + public void roundOver() { + roundOver = true; + } + + /** + * Checks that the file has not already been created during this + * invocation. If not, creates intermediate directories, and + * deletes the file if it already exists. + */ + private void prepareFile(File file, String name, FileKind kind) throws IOException { + if (roundOver) { + bark.aptWarning("NoNewFilesAfterRound", file.toString()); + throw new IOException(); + } + + if (filesCreated.contains(file)) { + bark.aptWarning("FileReopening", file.toString()); + throw new IOException(); + } else { + if (file.exists()) { + file.delete(); + } else { + File parent = file.getParentFile(); + if (parent != null && !parent.exists()) { + if(!parent.mkdirs()) { + bark.aptWarning("BadParentDirectory", file.toString()); + throw new IOException(); + } + } + } + + kind.register(file, name, this); + filesCreated.add(file); + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/MessagerImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/MessagerImpl.java new file mode 100644 index 00000000000..12808476d51 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/MessagerImpl.java @@ -0,0 +1,121 @@ +/* + * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.apt; + +import javax.tools.JavaFileObject; +import com.sun.mirror.apt.Messager; +import com.sun.tools.apt.mirror.util.SourcePositionImpl; +import com.sun.mirror.util.SourcePosition; +import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.util.Name; +import com.sun.tools.javac.util.Position; +import com.sun.tools.apt.util.Bark; + + +/** + * Implementation of Messager. + */ + +public class MessagerImpl implements Messager { + private final Bark bark; + + private static final Context.Key messagerKey = + new Context.Key(); + + public static MessagerImpl instance(Context context) { + MessagerImpl instance = context.get(messagerKey); + if (instance == null) { + instance = new MessagerImpl(context); + } + return instance; + } + + private MessagerImpl(Context context) { + context.put(messagerKey, this); + bark = Bark.instance(context); + } + + + /** + * {@inheritDoc} + */ + public void printError(String msg) { + bark.aptError("Messager", msg); + } + + /** + * {@inheritDoc} + */ + public void printError(SourcePosition pos, String msg) { + if (pos instanceof SourcePositionImpl) { + SourcePositionImpl posImpl = (SourcePositionImpl) pos; + JavaFileObject prev = bark.useSource(posImpl.getSource()); + bark.aptError(posImpl.getJavacPosition(), "Messager", msg); + bark.useSource(prev); + } else + printError(msg); + } + + /** + * {@inheritDoc} + */ + public void printWarning(String msg) { + bark.aptWarning("Messager", msg); + } + + /** + * {@inheritDoc} + */ + public void printWarning(SourcePosition pos, String msg) { + if (pos instanceof SourcePositionImpl) { + SourcePositionImpl posImpl = (SourcePositionImpl) pos; + JavaFileObject prev = bark.useSource(posImpl.getSource()); + bark.aptWarning(posImpl.getJavacPosition(), "Messager", msg); + bark.useSource(prev); + } else + printWarning(msg); + } + + /** + * {@inheritDoc} + */ + public void printNotice(String msg) { + bark.aptNote("Messager", msg); + } + + /** + * {@inheritDoc} + */ + public void printNotice(SourcePosition pos, String msg) { + if (pos instanceof SourcePositionImpl) { + SourcePositionImpl posImpl = (SourcePositionImpl) pos; + JavaFileObject prev = bark.useSource(posImpl.getSource()); + bark.aptNote(posImpl.getJavacPosition(), "Messager", msg); + bark.useSource(prev); + } else + printNotice(msg); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/RoundCompleteEventImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/RoundCompleteEventImpl.java new file mode 100644 index 00000000000..ae3a2258e6b --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/RoundCompleteEventImpl.java @@ -0,0 +1,37 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.apt; + +import com.sun.mirror.apt.AnnotationProcessorEnvironment; +import com.sun.mirror.apt.RoundCompleteEvent; +import com.sun.mirror.apt.RoundState; + +public class RoundCompleteEventImpl extends RoundCompleteEvent { + public RoundCompleteEventImpl(AnnotationProcessorEnvironment source, + RoundState rs) { + super(source, rs); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/RoundStateImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/RoundStateImpl.java new file mode 100644 index 00000000000..28edfde00a3 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/apt/RoundStateImpl.java @@ -0,0 +1,81 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.apt; + +import com.sun.mirror.apt.RoundState; +import java.util.Map; + +public class RoundStateImpl implements RoundState { + private final boolean finalRound; + private final boolean errorRaised; + private final boolean sourceFilesCreated; + private final boolean classFilesCreated; + + public RoundStateImpl(boolean errorRaised, + boolean sourceFilesCreated, + boolean classFilesCreated, + Map options) { + /* + * In the default mode of operation, this round is the final + * round if an error was raised OR there were no new source + * files generated. If classes are being treated as + * declarations, this is the final round if an error was + * raised OR neither new source files nor new class files were + * generated. + */ + this.finalRound = + errorRaised || + (!sourceFilesCreated && + !(classFilesCreated && options.keySet().contains("-XclassesAsDecls")) ); + this.errorRaised = errorRaised; + this.sourceFilesCreated = sourceFilesCreated; + this.classFilesCreated = classFilesCreated; + } + + public boolean finalRound() { + return finalRound; + } + + public boolean errorRaised() { + return errorRaised; + } + + public boolean sourceFilesCreated() { + return sourceFilesCreated; + } + + public boolean classFilesCreated() { + return classFilesCreated; + } + + public String toString() { + return + "[final round: " + finalRound + + ", error raised: " + errorRaised + + ", source files created: " + sourceFilesCreated + + ", class files created: " + classFilesCreated + "]"; + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationMirrorImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationMirrorImpl.java new file mode 100644 index 00000000000..acde7c6cdd7 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationMirrorImpl.java @@ -0,0 +1,136 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import java.util.LinkedHashMap; +import java.util.Map; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.type.AnnotationType; +import com.sun.mirror.util.SourcePosition; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.Attribute; +import com.sun.tools.javac.code.Symbol.*; +import com.sun.tools.javac.util.Name; +import com.sun.tools.javac.util.Pair; + + +/** + * Implementation of AnnotationMirror + */ + +public class AnnotationMirrorImpl implements AnnotationMirror { + + protected final AptEnv env; + protected final Attribute.Compound anno; + protected final Declaration decl; + + + AnnotationMirrorImpl(AptEnv env, Attribute.Compound anno, Declaration decl) { + this.env = env; + this.anno = anno; + this.decl = decl; + } + + + /** + * Returns a string representation of this annotation. + * String is of one of the forms: + * @com.example.foo(name1=val1, name2=val2) + * @com.example.foo(val) + * @com.example.foo + * Omit parens for marker annotations, and omit "value=" when allowed. + */ + public String toString() { + StringBuilder sb = new StringBuilder("@"); + Constants.Formatter fmtr = Constants.getFormatter(sb); + + fmtr.append(anno.type.tsym); + + int len = anno.values.length(); + if (len > 0) { // omit parens for marker annotations + sb.append('('); + boolean first = true; + for (Pair val : anno.values) { + if (!first) { + sb.append(", "); + } + first = false; + + Name name = val.fst.name; + if (len > 1 || name != env.names.value) { + fmtr.append(name); + sb.append('='); + } + sb.append(new AnnotationValueImpl(env, val.snd, this)); + } + sb.append(')'); + } + return fmtr.toString(); + } + + /** + * {@inheritDoc} + */ + public AnnotationType getAnnotationType() { + return (AnnotationType) env.typeMaker.getType(anno.type); + } + + /** + * {@inheritDoc} + */ + public Map + getElementValues() { + Map res = + new LinkedHashMap(); // whew! + for (Pair val : anno.values) { + res.put(getElement(val.fst), + new AnnotationValueImpl(env, val.snd, this)); + } + return res; + } + + public SourcePosition getPosition() { + // Return position of the declaration on which this annotation + // appears. + return (decl == null) ? null : decl.getPosition(); + + } + + public Declaration getDeclaration() { + return this.decl; + } + + /** + * Returns the annotation type element for a symbol. + */ + private AnnotationTypeElementDeclaration getElement(MethodSymbol m) { + return (AnnotationTypeElementDeclaration) + env.declMaker.getExecutableDeclaration(m); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java new file mode 100644 index 00000000000..4e90ad1cc29 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationProxyMaker.java @@ -0,0 +1,347 @@ +/* + * Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import java.lang.annotation.*; +import java.lang.reflect.Array; +import java.lang.reflect.Method; +import java.util.*; +import sun.reflect.annotation.*; + +import com.sun.mirror.type.TypeMirror; +import com.sun.mirror.type.MirroredTypeException; +import com.sun.mirror.type.MirroredTypesException; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.*; +import com.sun.tools.javac.code.Symbol.*; +import com.sun.tools.javac.util.Name; +import com.sun.tools.javac.util.Pair; + + +/** + * A generator of dynamic proxy implementations of + * java.lang.annotation.Annotation. + * + *

The "dynamic proxy return form" of an attribute element value is + * the form used by sun.reflect.annotation.AnnotationInvocationHandler. + */ + +class AnnotationProxyMaker { + + private final AptEnv env; + private final Attribute.Compound attrs; + private final Class annoType; + + + private AnnotationProxyMaker(AptEnv env, + Attribute.Compound attrs, + Class annoType) { + this.env = env; + this.attrs = attrs; + this.annoType = annoType; + } + + + /** + * Returns a dynamic proxy for an annotation mirror. + */ + public static A generateAnnotation( + AptEnv env, Attribute.Compound attrs, Class annoType) { + AnnotationProxyMaker apm = new AnnotationProxyMaker(env, attrs, annoType); + return annoType.cast(apm.generateAnnotation()); + } + + + /** + * Returns a dynamic proxy for an annotation mirror. + */ + private Annotation generateAnnotation() { + return AnnotationParser.annotationForMap(annoType, + getAllReflectedValues()); + } + + /** + * Returns a map from element names to their values in "dynamic + * proxy return form". Includes all elements, whether explicit or + * defaulted. + */ + private Map getAllReflectedValues() { + Map res = new LinkedHashMap(); + + for (Map.Entry entry : + getAllValues().entrySet()) { + MethodSymbol meth = entry.getKey(); + Object value = generateValue(meth, entry.getValue()); + if (value != null) { + res.put(meth.name.toString(), value); + } else { + // Ignore this element. May lead to + // IncompleteAnnotationException somewhere down the line. + } + } + return res; + } + + /** + * Returns a map from element symbols to their values. + * Includes all elements, whether explicit or defaulted. + */ + private Map getAllValues() { + Map res = + new LinkedHashMap(); + + // First find the default values. + ClassSymbol sym = (ClassSymbol) attrs.type.tsym; + for (Scope.Entry e = sym.members().elems; e != null; e = e.sibling) { + if (e.sym.kind == Kinds.MTH) { + MethodSymbol m = (MethodSymbol) e.sym; + Attribute def = m.defaultValue; + if (def != null) { + res.put(m, def); + } + } + } + // Next find the explicit values, possibly overriding defaults. + for (Pair p : attrs.values) { + res.put(p.fst, p.snd); + } + return res; + } + + /** + * Converts an element value to its "dynamic proxy return form". + * Returns an exception proxy on some errors, but may return null if + * a useful exception cannot or should not be generated at this point. + */ + private Object generateValue(MethodSymbol meth, Attribute attr) { + ValueVisitor vv = new ValueVisitor(meth); + return vv.getValue(attr); + } + + + private class ValueVisitor implements Attribute.Visitor { + + private MethodSymbol meth; // annotation element being visited + private Class runtimeType; // runtime type of annotation element + private Object value; // value in "dynamic proxy return form" + + ValueVisitor(MethodSymbol meth) { + this.meth = meth; + } + + Object getValue(Attribute attr) { + Method method; // runtime method of annotation element + try { + method = annoType.getMethod(meth.name.toString()); + } catch (NoSuchMethodException e) { + return null; + } + runtimeType = method.getReturnType(); + attr.accept(this); + if (!(value instanceof ExceptionProxy) && + !AnnotationType.invocationHandlerReturnType(runtimeType) + .isInstance(value)) { + typeMismatch(method, attr); + } + return value; + } + + + public void visitConstant(Attribute.Constant c) { + value = Constants.decodeConstant(c.value, c.type); + } + + public void visitClass(Attribute.Class c) { + value = new MirroredTypeExceptionProxy( + env.typeMaker.getType(c.type)); + } + + public void visitArray(Attribute.Array a) { + Type elemtype = env.jctypes.elemtype(a.type); + + if (elemtype.tsym == env.symtab.classType.tsym) { // Class[] + // Construct a proxy for a MirroredTypesException + ArrayList elems = new ArrayList(); + for (int i = 0; i < a.values.length; i++) { + Type elem = ((Attribute.Class) a.values[i]).type; + elems.add(env.typeMaker.getType(elem)); + } + value = new MirroredTypesExceptionProxy(elems); + + } else { + int len = a.values.length; + Class runtimeTypeSaved = runtimeType; + runtimeType = runtimeType.getComponentType(); + try { + Object res = Array.newInstance(runtimeType, len); + for (int i = 0; i < len; i++) { + a.values[i].accept(this); + if (value == null || value instanceof ExceptionProxy) { + return; + } + try { + Array.set(res, i, value); + } catch (IllegalArgumentException e) { + value = null; // indicates a type mismatch + return; + } + } + value = res; + } finally { + runtimeType = runtimeTypeSaved; + } + } + } + + @SuppressWarnings("unchecked") + public void visitEnum(Attribute.Enum e) { + if (runtimeType.isEnum()) { + String constName = e.value.toString(); + try { + value = Enum.valueOf((Class)runtimeType, constName); + } catch (IllegalArgumentException ex) { + value = new EnumConstantNotPresentExceptionProxy( + (Class)runtimeType, constName); + } + } else { + value = null; // indicates a type mismatch + } + } + + public void visitCompound(Attribute.Compound c) { + try { + Class nested = + runtimeType.asSubclass(Annotation.class); + value = generateAnnotation(env, c, nested); + } catch (ClassCastException ex) { + value = null; // indicates a type mismatch + } + } + + public void visitError(Attribute.Error e) { + value = null; // indicates a type mismatch + } + + + /** + * Sets "value" to an ExceptionProxy indicating a type mismatch. + */ + private void typeMismatch(final Method method, final Attribute attr) { + value = new ExceptionProxy() { + public String toString() { + return ""; // eg: @Anno(value=) + } + protected RuntimeException generateException() { + return new AnnotationTypeMismatchException(method, + attr.type.toString()); + } + }; + } + } + + + /** + * ExceptionProxy for MirroredTypeException. + * The toString, hashCode, and equals methods foward to the underlying + * type. + */ + private static class MirroredTypeExceptionProxy extends ExceptionProxy { + + private MirroredTypeException ex; + + MirroredTypeExceptionProxy(TypeMirror t) { + // It would be safer if we could construct the exception in + // generateException(), but there would be no way to do + // that properly following deserialization. + ex = new MirroredTypeException(t); + } + + public String toString() { + return ex.getQualifiedName(); + } + + public int hashCode() { + TypeMirror t = ex.getTypeMirror(); + return (t != null) + ? t.hashCode() + : ex.getQualifiedName().hashCode(); + } + + public boolean equals(Object obj) { + TypeMirror t = ex.getTypeMirror(); + return t != null && + obj instanceof MirroredTypeExceptionProxy && + t.equals( + ((MirroredTypeExceptionProxy) obj).ex.getTypeMirror()); + } + + protected RuntimeException generateException() { + return (RuntimeException) ex.fillInStackTrace(); + } + } + + + /** + * ExceptionProxy for MirroredTypesException. + * The toString, hashCode, and equals methods foward to the underlying + * types. + */ + private static class MirroredTypesExceptionProxy extends ExceptionProxy { + + private MirroredTypesException ex; + + MirroredTypesExceptionProxy(Collection ts) { + // It would be safer if we could construct the exception in + // generateException(), but there would be no way to do + // that properly following deserialization. + ex = new MirroredTypesException(ts); + } + + public String toString() { + return ex.getQualifiedNames().toString(); + } + + public int hashCode() { + Collection ts = ex.getTypeMirrors(); + return (ts != null) + ? ts.hashCode() + : ex.getQualifiedNames().hashCode(); + } + + public boolean equals(Object obj) { + Collection ts = ex.getTypeMirrors(); + return ts != null && + obj instanceof MirroredTypesExceptionProxy && + ts.equals( + ((MirroredTypesExceptionProxy) obj).ex.getTypeMirrors()); + } + + protected RuntimeException generateException() { + return (RuntimeException) ex.fillInStackTrace(); + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationTypeDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationTypeDeclarationImpl.java new file mode 100644 index 00000000000..59a9e6f834f --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationTypeDeclarationImpl.java @@ -0,0 +1,63 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import java.util.Collection; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.util.DeclarationVisitor; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.Symbol.*; + + +/** + * Implementation of AnnotationTypeDeclaration + */ + +public class AnnotationTypeDeclarationImpl extends InterfaceDeclarationImpl + implements AnnotationTypeDeclaration +{ + AnnotationTypeDeclarationImpl(AptEnv env, ClassSymbol sym) { + super(env, sym); + } + + + /** + * {@inheritDoc} + */ + public Collection getMethods() { + return identityFilter.filter(super.getMethods(), + AnnotationTypeElementDeclaration.class); + } + + /** + * {@inheritDoc} + */ + public void accept(DeclarationVisitor v) { + v.visitAnnotationTypeDeclaration(this); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationTypeElementDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationTypeElementDeclarationImpl.java new file mode 100644 index 00000000000..c6086385aa8 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationTypeElementDeclarationImpl.java @@ -0,0 +1,68 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import com.sun.mirror.declaration.*; +import com.sun.mirror.util.DeclarationVisitor; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.Symbol.MethodSymbol; + + +/** + * Implementation of AnnotationTypeElementDeclaration + */ + +public class AnnotationTypeElementDeclarationImpl extends MethodDeclarationImpl + implements AnnotationTypeElementDeclaration { + + AnnotationTypeElementDeclarationImpl(AptEnv env, MethodSymbol sym) { + super(env, sym); + } + + /** + * {@inheritDoc} + */ + public AnnotationTypeDeclaration getDeclaringType() { + return (AnnotationTypeDeclaration) super.getDeclaringType(); + } + + /** + * {@inheritDoc} + */ + public AnnotationValue getDefaultValue() { + return (sym.defaultValue == null) + ? null + : new AnnotationValueImpl(env, sym.defaultValue, null); + } + + /** + * {@inheritDoc} + */ + public void accept(DeclarationVisitor v) { + v.visitAnnotationTypeElementDeclaration(this); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationValueImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationValueImpl.java new file mode 100644 index 00000000000..a217393c375 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/AnnotationValueImpl.java @@ -0,0 +1,121 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import java.util.Collection; +import java.util.ArrayList; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.util.SourcePosition; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.Attribute; +import com.sun.tools.javac.code.Symbol.*; +import com.sun.tools.javac.code.TypeTags; + + +/** + * Implementation of AnnotationValue + */ + +public class AnnotationValueImpl implements AnnotationValue { + + protected final AptEnv env; + protected final Attribute attr; + protected final AnnotationMirrorImpl annotation; + + AnnotationValueImpl(AptEnv env, Attribute attr, AnnotationMirrorImpl annotation) { + this.env = env; + this.attr = attr; + this.annotation = annotation; + } + + + /** + * {@inheritDoc} + */ + public String toString() { + StringBuilder sb = new StringBuilder(); + Constants.Formatter fmtr = Constants.getFormatter(sb); + + fmtr.append(getValue()); + return fmtr.toString(); + } + + /** + * {@inheritDoc} + */ + public Object getValue() { + ValueVisitor vv = new ValueVisitor(); + attr.accept(vv); + return vv.value; + } + + + public SourcePosition getPosition() { + // Imprecise implementation; just return position of enclosing + // annotation. + return (annotation == null) ? null : annotation.getPosition(); + } + + private class ValueVisitor implements Attribute.Visitor { + + public Object value; + + public void visitConstant(Attribute.Constant c) { + value = Constants.decodeConstant(c.value, c.type); + } + + public void visitClass(Attribute.Class c) { + value = env.typeMaker.getType( + env.jctypes.erasure(c.type)); + } + + public void visitEnum(Attribute.Enum e) { + value = env.declMaker.getFieldDeclaration(e.value); + } + + public void visitCompound(Attribute.Compound c) { + value = new AnnotationMirrorImpl(env, c, + (annotation == null) ? + null : + annotation.getDeclaration()); + } + + public void visitArray(Attribute.Array a) { + ArrayList vals = + new ArrayList(a.values.length); + for (Attribute elem : a.values) { + vals.add(new AnnotationValueImpl(env, elem, annotation)); + } + value = vals; + } + + public void visitError(Attribute.Error e) { + value = ""; // javac will already have logged an error msg + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ClassDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ClassDeclarationImpl.java new file mode 100644 index 00000000000..600be2906b7 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ClassDeclarationImpl.java @@ -0,0 +1,115 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import java.lang.annotation.Annotation; +import java.lang.annotation.Inherited; +import java.util.ArrayList; +import java.util.Collection; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.type.ClassType; +import com.sun.mirror.util.DeclarationVisitor; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.*; +import com.sun.tools.javac.code.Symbol.*; + + +/** + * Implementation of ClassDeclaration + */ + +public class ClassDeclarationImpl extends TypeDeclarationImpl + implements ClassDeclaration { + + ClassDeclarationImpl(AptEnv env, ClassSymbol sym) { + super(env, sym); + } + + + /** + * {@inheritDoc} + * Overridden here to handle @Inherited. + */ + public A getAnnotation(Class annoType) { + + boolean inherited = annoType.isAnnotationPresent(Inherited.class); + for (Type t = sym.type; + t.tsym != env.symtab.objectType.tsym && !t.isErroneous(); + t = env.jctypes.supertype(t)) { + + A result = getAnnotation(annoType, t.tsym); + if (result != null || !inherited) { + return result; + } + } + return null; + } + + /** + * {@inheritDoc} + */ + public ClassType getSuperclass() { + // java.lang.Object has no superclass + if (sym == env.symtab.objectType.tsym) { + return null; + } + Type t = env.jctypes.supertype(sym.type); + return (ClassType) env.typeMaker.getType(t); + } + + /** + * {@inheritDoc} + */ + public Collection getConstructors() { + ArrayList res = + new ArrayList(); + for (Symbol s : getMembers(true)) { + if (s.isConstructor()) { + MethodSymbol m = (MethodSymbol) s; + res.add((ConstructorDeclaration) + env.declMaker.getExecutableDeclaration(m)); + } + } + return res; + } + + /** + * {@inheritDoc} + */ + public Collection getMethods() { + return identityFilter.filter(super.getMethods(), + MethodDeclaration.class); + } + + /** + * {@inheritDoc} + */ + public void accept(DeclarationVisitor v) { + v.visitClassDeclaration(this); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/Constants.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/Constants.java new file mode 100644 index 00000000000..e589735de41 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/Constants.java @@ -0,0 +1,293 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import java.util.Collection; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.type.TypeMirror; +import com.sun.tools.apt.mirror.type.TypeMirrorImpl; +import com.sun.tools.javac.code.Type; + +import static com.sun.tools.javac.code.TypeTags.*; + + +/** + * Utility class for operating on constant expressions. + */ +class Constants { + + /** + * Converts a constant in javac's internal representation (in which + * boolean, char, byte, short, and int are each represented by an Integer) + * into standard representation. Other values (including null) are + * returned unchanged. + */ + static Object decodeConstant(Object value, Type type) { + if (value instanceof Integer) { + int i = ((Integer) value).intValue(); + switch (type.tag) { + case BOOLEAN: return Boolean.valueOf(i != 0); + case CHAR: return Character.valueOf((char) i); + case BYTE: return Byte.valueOf((byte) i); + case SHORT: return Short.valueOf((short) i); + } + } + return value; + } + + /** + * Returns a formatter for generating the text of constant + * expressions. Equivalent to + * getFormatter(new StringBuilder()). + */ + static Formatter getFormatter() { + return new Formatter(new StringBuilder()); + } + + /** + * Returns a formatter for generating the text of constant + * expressions. Also generates the text of constant + * "pseudo-expressions" for annotations and array-valued + * annotation elements. + * + * @param buf where the expression is written + */ + static Formatter getFormatter(StringBuilder buf) { + return new Formatter(buf); + } + + + /** + * Utility class used to generate the text of constant + * expressions. Also generates the text of constant + * "pseudo-expressions" for annotations and array-valued + * annotation elements. + */ + static class Formatter { + + private StringBuilder buf; // where the output goes + + private Formatter(StringBuilder buf) { + this.buf = buf; + } + + + public String toString() { + return buf.toString(); + } + + /** + * Appends a constant whose type is not statically known + * by dispatching to the appropriate overloaded append method. + */ + void append(Object val) { + if (val instanceof String) { + append((String) val); + } else if (val instanceof Character) { + append((Character) val); + } else if (val instanceof Boolean) { + append((Boolean) val); + } else if (val instanceof Byte) { + append((Byte) val); + } else if (val instanceof Short) { + append((Short) val); + } else if (val instanceof Integer) { + append((Integer) val); + } else if (val instanceof Long) { + append((Long) val); + } else if (val instanceof Float) { + append((Float) val); + } else if (val instanceof Double) { + append((Double) val); + } else if (val instanceof TypeMirror) { + append((TypeMirrorImpl) val); + } else if (val instanceof EnumConstantDeclaration) { + append((EnumConstantDeclarationImpl) val); + } else if (val instanceof AnnotationMirror) { + append((AnnotationMirrorImpl) val); + } else if (val instanceof Collection) { + append((Collection) val); + } else { + appendUnquoted(val.toString()); + } + } + + /** + * Appends a string, escaped (as needed) and quoted. + */ + void append(String val) { + buf.append('"'); + appendUnquoted(val); + buf.append('"'); + } + + /** + * Appends a Character, escaped (as needed) and quoted. + */ + void append(Character val) { + buf.append('\''); + appendUnquoted(val.charValue()); + buf.append('\''); + } + + void append(Boolean val) { + buf.append(val); + } + + void append(Byte val) { + buf.append(String.format("0x%02x", val)); + } + + void append(Short val) { + buf.append(val); + } + + void append(Integer val) { + buf.append(val); + } + + void append(Long val) { + buf.append(val).append('L'); + } + + void append(Float val) { + if (val.isNaN()) { + buf.append("0.0f/0.0f"); + } else if (val.isInfinite()) { + if (val.floatValue() < 0) { + buf.append('-'); + } + buf.append("1.0f/0.0f"); + } else { + buf.append(val).append('f'); + } + } + + void append(Double val) { + if (val.isNaN()) { + buf.append("0.0/0.0"); + } else if (val.isInfinite()) { + if (val.doubleValue() < 0) { + buf.append('-'); + } + buf.append("1.0/0.0"); + } else { + buf.append(val); + } + } + + /** + * Appends the class literal corresponding to a type. Should + * only be invoked for types that have an associated literal. + * e.g: "java.lang.String.class" + * "boolean.class" + * "int[].class" + */ + void append(TypeMirrorImpl t) { + appendUnquoted(t.type.toString()); + buf.append(".class"); + } + + /** + * Appends the fully qualified name of an enum constant. + * e.g: "java.math.RoundingMode.UP" + */ + void append(EnumConstantDeclarationImpl e) { + appendUnquoted(e.sym.enclClass() + "." + e); + } + + /** + * Appends the text of an annotation pseudo-expression. + * e.g: "@pkg.Format(linesep='\n')" + */ + void append(AnnotationMirrorImpl anno) { + appendUnquoted(anno.toString()); + } + + /** + * Appends the elements of a collection, enclosed within braces + * and separated by ", ". Useful for array-valued annotation + * elements. + */ + void append(Collection vals) { + buf.append('{'); + boolean first = true; + for (Object val : vals) { + if (first) { + first = false; + } else { + buf.append(", "); + } + append(((AnnotationValue) val).getValue()); + } + buf.append('}'); + } + + + /** + * For each char of a string, append using appendUnquoted(char). + */ + private void appendUnquoted(String s) { + for (char c : s.toCharArray()) { + appendUnquoted(c); + } + } + + /** + * Appends a char (unquoted), using escapes for those that are not + * printable ASCII. We don't know what is actually printable in + * the locale in which this result will be used, so ASCII is our + * best guess as to the least common denominator. + */ + private void appendUnquoted(char c) { + switch (c) { + case '\b': buf.append("\\b"); break; + case '\t': buf.append("\\t"); break; + case '\n': buf.append("\\n"); break; + case '\f': buf.append("\\f"); break; + case '\r': buf.append("\\r"); break; + case '\"': buf.append("\\\""); break; + case '\'': buf.append("\\\'"); break; + case '\\': buf.append("\\\\"); break; + default: + if (isPrintableAscii(c)) { + buf.append(c); + } else { + buf.append(String.format("\\u%04x", (int) c)); + } + } + } + + /** + * Is c a printable ASCII character? + */ + private static boolean isPrintableAscii(char c) { + return c >= ' ' && c <= '~'; + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ConstructorDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ConstructorDeclarationImpl.java new file mode 100644 index 00000000000..936dfd8145e --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ConstructorDeclarationImpl.java @@ -0,0 +1,65 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import java.util.ArrayList; +import java.util.Collection; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.util.DeclarationVisitor; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.Flags; +import com.sun.tools.javac.code.Symbol.MethodSymbol; + + +/** + * Implementation of ConstructorDeclaration + */ + +public class ConstructorDeclarationImpl extends ExecutableDeclarationImpl + implements ConstructorDeclaration { + + ConstructorDeclarationImpl(AptEnv env, MethodSymbol sym) { + super(env, sym); + } + + + /** + * {@inheritDoc} + * Returns the simple name of the declaring class. + */ + public String getSimpleName() { + return sym.enclClass().name.toString(); + } + + /** + * {@inheritDoc} + */ + public void accept(DeclarationVisitor v) { + v.visitConstructorDeclaration(this); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationImpl.java new file mode 100644 index 00000000000..bb2b097aba8 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationImpl.java @@ -0,0 +1,254 @@ +/* + * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import java.lang.annotation.Annotation; +import java.util.ArrayList; +import java.util.LinkedList; +import java.util.Collection; +import java.util.EnumSet; +import javax.tools.JavaFileObject; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.util.*; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.apt.mirror.util.SourcePositionImpl; +import com.sun.tools.javac.code.*; +import com.sun.tools.javac.code.Symbol.*; +import com.sun.tools.javac.comp.AttrContext; +import com.sun.tools.javac.comp.Env; +import com.sun.tools.javac.tree.*; +import com.sun.tools.javac.util.Name; +import com.sun.tools.javac.util.Position; + +import static com.sun.mirror.declaration.Modifier.*; +import static com.sun.tools.javac.code.Kinds.*; + + +/** + * Implementation of Declaration + */ + +public abstract class DeclarationImpl implements Declaration { + + protected final AptEnv env; + public final Symbol sym; + + protected static DeclarationFilter identityFilter = + new DeclarationFilter(); + + + /** + * "sym" should be completed before this constructor is called. + */ + protected DeclarationImpl(AptEnv env, Symbol sym) { + this.env = env; + this.sym = sym; + } + + + /** + * {@inheritDoc} + *

ParameterDeclarationImpl overrides this implementation. + */ + public boolean equals(Object obj) { + if (obj instanceof DeclarationImpl) { + DeclarationImpl that = (DeclarationImpl) obj; + return sym == that.sym && env == that.env; + } else { + return false; + } + } + + /** + * {@inheritDoc} + *

ParameterDeclarationImpl overrides this implementation. + */ + public int hashCode() { + return sym.hashCode() + env.hashCode(); + } + + /** + * {@inheritDoc} + */ + public String getDocComment() { + // Our doc comment is contained in a map in our toplevel, + // indexed by our tree. Find our enter environment, which gives + // us our toplevel. It also gives us a tree that contains our + // tree: walk it to find our tree. This is painful. + Env enterEnv = getEnterEnv(); + if (enterEnv == null) + return null; + JCTree tree = TreeInfo.declarationFor(sym, enterEnv.tree); + return enterEnv.toplevel.docComments.get(tree); + } + + /** + * {@inheritDoc} + */ + public Collection getAnnotationMirrors() { + Collection res = + new ArrayList(); + for (Attribute.Compound a : sym.getAnnotationMirrors()) { + res.add(env.declMaker.getAnnotationMirror(a, this)); + } + return res; + } + + /** + * {@inheritDoc} + * Overridden by ClassDeclarationImpl to handle @Inherited. + */ + public A getAnnotation(Class annoType) { + return getAnnotation(annoType, sym); + } + + protected A getAnnotation(Class annoType, + Symbol annotated) { + if (!annoType.isAnnotation()) { + throw new IllegalArgumentException( + "Not an annotation type: " + annoType); + } + String name = annoType.getName(); + for (Attribute.Compound attr : annotated.getAnnotationMirrors()) { + if (name.equals(attr.type.tsym.flatName().toString())) { + return AnnotationProxyMaker.generateAnnotation(env, attr, + annoType); + } + } + return null; + } + + // Cache for modifiers. + private EnumSet modifiers = null; + + /** + * {@inheritDoc} + */ + public Collection getModifiers() { + if (modifiers == null) { + modifiers = EnumSet.noneOf(Modifier.class); + long flags = AptEnv.getFlags(sym); + + if (0 != (flags & Flags.PUBLIC)) modifiers.add(PUBLIC); + if (0 != (flags & Flags.PROTECTED)) modifiers.add(PROTECTED); + if (0 != (flags & Flags.PRIVATE)) modifiers.add(PRIVATE); + if (0 != (flags & Flags.ABSTRACT)) modifiers.add(ABSTRACT); + if (0 != (flags & Flags.STATIC)) modifiers.add(STATIC); + if (0 != (flags & Flags.FINAL)) modifiers.add(FINAL); + if (0 != (flags & Flags.TRANSIENT)) modifiers.add(TRANSIENT); + if (0 != (flags & Flags.VOLATILE)) modifiers.add(VOLATILE); + if (0 != (flags & Flags.SYNCHRONIZED)) modifiers.add(SYNCHRONIZED); + if (0 != (flags & Flags.NATIVE)) modifiers.add(NATIVE); + if (0 != (flags & Flags.STRICTFP)) modifiers.add(STRICTFP); + } + return modifiers; + } + + /** + * {@inheritDoc} + * Overridden in some subclasses. + */ + public String getSimpleName() { + return sym.name.toString(); + } + + /** + * {@inheritDoc} + */ + public SourcePosition getPosition() { + // Find the toplevel. From there use a tree-walking utility + // that finds the tree for our symbol, and with it the position. + Env enterEnv = getEnterEnv(); + if (enterEnv == null) + return null; + JCTree.JCCompilationUnit toplevel = enterEnv.toplevel; + JavaFileObject sourcefile = toplevel.sourcefile; + if (sourcefile == null) + return null; + int pos = TreeInfo.positionFor(sym, toplevel); + + return new SourcePositionImpl(sourcefile, pos, toplevel.lineMap); + } + + /** + * Applies a visitor to this declaration. + * + * @param v the visitor operating on this declaration + */ + public void accept(DeclarationVisitor v) { + v.visitDeclaration(this); + } + + + private Collection members = null; // cache for getMembers() + + /** + * Returns the symbols of type or package members (and constructors) + * that are not synthetic or otherwise unwanted. + * Caches the result if "cache" is true. + */ + protected Collection getMembers(boolean cache) { + if (members != null) { + return members; + } + LinkedList res = new LinkedList(); + for (Scope.Entry e = sym.members().elems; e != null; e = e.sibling) { + if (e.sym != null && !unwanted(e.sym)) { + res.addFirst(e.sym); + } + } + return cache ? (members = res) : res; + } + + /** + * Tests whether this is a symbol that should never be seen by clients, + * such as a synthetic class. + * Note that a class synthesized by the compiler may not be flagged as + * synthetic: see bugid 4959932. + */ + private static boolean unwanted(Symbol s) { + return AptEnv.hasFlag(s, Flags.SYNTHETIC) || + (s.kind == TYP && + !DeclarationMaker.isJavaIdentifier(s.name.toString())); + } + + /** + * Returns this declaration's enter environment, or null if it + * has none. + */ + private Env getEnterEnv() { + // Get enclosing class of sym, or sym itself if it is a class + // or package. + TypeSymbol ts = (sym.kind != PCK) + ? sym.enclClass() + : (PackageSymbol) sym; + return (ts != null) + ? env.enter.getEnv(ts) + : null; + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationMaker.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationMaker.java new file mode 100644 index 00000000000..09eeee29ab2 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/DeclarationMaker.java @@ -0,0 +1,270 @@ +/* + * Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import java.util.HashMap; +import java.util.Map; + +import com.sun.mirror.declaration.*; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.*; +import com.sun.tools.javac.code.Symbol.*; +import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.util.Name; +import com.sun.tools.javac.main.JavaCompiler; + +/** + * Utilities for constructing and caching declarations. + */ + +public class DeclarationMaker { + + private AptEnv env; + private Context context; + private JavaCompiler javacompiler; + private static final Context.Key declarationMakerKey = + new Context.Key(); + + public static DeclarationMaker instance(Context context) { + DeclarationMaker instance = context.get(declarationMakerKey); + if (instance == null) { + instance = new DeclarationMaker(context); + } + return instance; + } + + private DeclarationMaker(Context context) { + context.put(declarationMakerKey, this); + env = AptEnv.instance(context); + this.context = context; + this.javacompiler = JavaCompiler.instance(context); + } + + + + // Cache of package declarations + private Map packageDecls = + new HashMap(); + + /** + * Returns the package declaration for a package symbol. + */ + public PackageDeclaration getPackageDeclaration(PackageSymbol p) { + PackageDeclaration res = packageDecls.get(p); + if (res == null) { + res = new PackageDeclarationImpl(env, p); + packageDecls.put(p, res); + } + return res; + } + + /** + * Returns the package declaration for the package with the given name. + * Name is fully-qualified, or "" for the unnamed package. + * Returns null if package declaration not found. + */ + public PackageDeclaration getPackageDeclaration(String name) { + PackageSymbol p = null; + if (name.equals("") ) + p = env.symtab.unnamedPackage; + else { + if (!isJavaName(name)) + return null; + Symbol s = nameToSymbol(name, false); + if (s instanceof PackageSymbol) { + p = (PackageSymbol) s; + if (!p.exists()) + return null; + } else + return null; + } + return getPackageDeclaration(p); + } + + // Cache of type declarations + private Map typeDecls = + new HashMap(); + + /** + * Returns the type declaration for a class symbol. + * Forces completion, and returns null on error. + */ + public TypeDeclaration getTypeDeclaration(ClassSymbol c) { + long flags = AptEnv.getFlags(c); // forces symbol completion + if (c.kind == Kinds.ERR) { + return null; + } + TypeDeclaration res = typeDecls.get(c); + if (res == null) { + if ((flags & Flags.ANNOTATION) != 0) { + res = new AnnotationTypeDeclarationImpl(env, c); + } else if ((flags & Flags.INTERFACE) != 0) { + res = new InterfaceDeclarationImpl(env, c); + } else if ((flags & Flags.ENUM) != 0) { + res = new EnumDeclarationImpl(env, c); + } else { + res = new ClassDeclarationImpl(env, c); + } + typeDecls.put(c, res); + } + return res; + } + + /** + * Returns the type declaration for the type with the given canonical name. + * Returns null if type declaration not found. + */ + public TypeDeclaration getTypeDeclaration(String name) { + if (!isJavaName(name)) + return null; + Symbol s = nameToSymbol(name, true); + if (s instanceof ClassSymbol) { + ClassSymbol c = (ClassSymbol) s; + return getTypeDeclaration(c); + } else + return null; + } + + /** + * Returns a symbol given the type's or packages's canonical name, + * or null if the name isn't found. + */ + private Symbol nameToSymbol(String name, boolean classCache) { + Symbol s = null; + Name nameName = env.names.fromString(name); + if (classCache) + s = env.symtab.classes.get(nameName); + else + s = env.symtab.packages.get(nameName); + + if (s != null && s.exists()) + return s; + + s = javacompiler.resolveIdent(name); + if (s.kind == Kinds.ERR ) + return null; + + if (s.kind == Kinds.PCK) + s.complete(); + + return s; + } + + // Cache of method and constructor declarations + private Map executableDecls = + new HashMap(); + + /** + * Returns the method or constructor declaration for a method symbol. + */ + ExecutableDeclaration getExecutableDeclaration(MethodSymbol m) { + ExecutableDeclaration res = executableDecls.get(m); + if (res == null) { + if (m.isConstructor()) { + res = new ConstructorDeclarationImpl(env, m); + } else if (isAnnotationTypeElement(m)) { + res = new AnnotationTypeElementDeclarationImpl(env, m); + } else { + res = new MethodDeclarationImpl(env, m); + } + executableDecls.put(m, res); + } + return res; + } + + // Cache of field declarations + private Map fieldDecls = + new HashMap(); + + /** + * Returns the field declaration for a var symbol. + */ + FieldDeclaration getFieldDeclaration(VarSymbol v) { + FieldDeclaration res = fieldDecls.get(v); + if (res == null) { + if (hasFlag(v, Flags.ENUM)) { + res = new EnumConstantDeclarationImpl(env, v); + } else { + res = new FieldDeclarationImpl(env, v); + } + fieldDecls.put(v, res); + } + return res; + } + + /** + * Returns a parameter declaration. + */ + ParameterDeclaration getParameterDeclaration(VarSymbol v) { + return new ParameterDeclarationImpl(env, v); + } + + /** + * Returns a type parameter declaration. + */ + public TypeParameterDeclaration getTypeParameterDeclaration(TypeSymbol t) { + return new TypeParameterDeclarationImpl(env, t); + } + + /** + * Returns an annotation. + */ + AnnotationMirror getAnnotationMirror(Attribute.Compound a, Declaration decl) { + return new AnnotationMirrorImpl(env, a, decl); + } + + + /** + * Is a string a valid Java identifier? + */ + public static boolean isJavaIdentifier(String id) { + return javax.lang.model.SourceVersion.isIdentifier(id); + } + + public static boolean isJavaName(String name) { + for(String id: name.split("\\.")) { + if (! isJavaIdentifier(id)) + return false; + } + return true; + } + + /** + * Is a method an annotation type element? + * It is if it's declared in an annotation type. + */ + private static boolean isAnnotationTypeElement(MethodSymbol m) { + return hasFlag(m.enclClass(), Flags.ANNOTATION); + } + + /** + * Does a symbol have a given flag? + */ + private static boolean hasFlag(Symbol s, long flag) { + return AptEnv.hasFlag(s, flag); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/EnumConstantDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/EnumConstantDeclarationImpl.java new file mode 100644 index 00000000000..7d4ae315bf3 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/EnumConstantDeclarationImpl.java @@ -0,0 +1,59 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import com.sun.mirror.declaration.*; +import com.sun.mirror.util.DeclarationVisitor; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.Symbol.VarSymbol; + + +/** + * Implementation of EnumConstantDeclaration + */ + +public class EnumConstantDeclarationImpl extends FieldDeclarationImpl + implements EnumConstantDeclaration { + + EnumConstantDeclarationImpl(AptEnv env, VarSymbol sym) { + super(env, sym); + } + + /** + * {@inheritDoc} + */ + public EnumDeclaration getDeclaringType() { + return (EnumDeclaration) super.getDeclaringType(); + } + + /** + * {@inheritDoc} + */ + public void accept(DeclarationVisitor v) { + v.visitEnumConstantDeclaration(this); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/EnumDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/EnumDeclarationImpl.java new file mode 100644 index 00000000000..2a498d24a77 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/EnumDeclarationImpl.java @@ -0,0 +1,63 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import java.util.Collection; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.util.*; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.Symbol.*; + + +/** + * Implementation of EnumDeclaration + */ + +public class EnumDeclarationImpl extends ClassDeclarationImpl + implements EnumDeclaration { + + EnumDeclarationImpl(AptEnv env, ClassSymbol sym) { + super(env, sym); + } + + + /** + * {@inheritDoc} + */ + public Collection getEnumConstants() { + return identityFilter.filter(getFields(), + EnumConstantDeclaration.class); + } + + /** + * {@inheritDoc} + */ + public void accept(DeclarationVisitor v) { + v.visitEnumDeclaration(this); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ExecutableDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ExecutableDeclarationImpl.java new file mode 100644 index 00000000000..b5d758fef51 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ExecutableDeclarationImpl.java @@ -0,0 +1,89 @@ +/* + * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import java.util.Collection; +import java.util.ArrayList; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.type.ReferenceType; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.*; +import com.sun.tools.javac.code.Symbol.*; + + +/** + * Implementation of ExecutableDeclaration + */ + +public abstract class ExecutableDeclarationImpl extends MemberDeclarationImpl + implements ExecutableDeclaration { + public MethodSymbol sym; + + protected ExecutableDeclarationImpl(AptEnv env, MethodSymbol sym) { + super(env, sym); + this.sym = sym; + } + + + /** + * Returns type parameters (if any), method name, and signature + * (value parameter types). + */ + public String toString() { + return sym.toString(); + } + + /** + * {@inheritDoc} + */ + public boolean isVarArgs() { + return AptEnv.hasFlag(sym, Flags.VARARGS); + } + + /** + * {@inheritDoc} + */ + public Collection getParameters() { + Collection res = + new ArrayList(); + for (VarSymbol param : sym.params()) + res.add(env.declMaker.getParameterDeclaration(param)); + return res; + } + + /** + * {@inheritDoc} + */ + public Collection getThrownTypes() { + ArrayList res = new ArrayList(); + for (Type t : sym.type.getThrownTypes()) { + res.add((ReferenceType) env.typeMaker.getType(t)); + } + return res; + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/FieldDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/FieldDeclarationImpl.java new file mode 100644 index 00000000000..2ab22fdea4f --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/FieldDeclarationImpl.java @@ -0,0 +1,98 @@ +/* + * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import java.util.Collection; +import java.util.ArrayList; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.type.TypeMirror; +import com.sun.mirror.util.DeclarationVisitor; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.Symbol.*; +import com.sun.tools.javac.code.TypeTags; + + +/** + * Implementation of FieldDeclaration + */ + +class FieldDeclarationImpl extends MemberDeclarationImpl + implements FieldDeclaration { + + protected VarSymbol sym; + + FieldDeclarationImpl(AptEnv env, VarSymbol sym) { + super(env, sym); + this.sym = sym; + } + + + /** + * Returns the field's name. + */ + public String toString() { + return getSimpleName(); + } + + /** + * {@inheritDoc} + */ + public TypeMirror getType() { + return env.typeMaker.getType(sym.type); + } + + /** + * {@inheritDoc} + */ + public Object getConstantValue() { + Object val = sym.getConstValue(); + // val may be null, indicating that this is not a constant. + + return Constants.decodeConstant(val, sym.type); + } + + /** + * {@inheritDoc} + */ + public String getConstantExpression() { + Object val = getConstantValue(); + if (val == null) { + return null; + } + Constants.Formatter fmtr = Constants.getFormatter(); + fmtr.append(val); + return fmtr.toString(); + } + + /** + * {@inheritDoc} + */ + public void accept(DeclarationVisitor v) { + v.visitFieldDeclaration(this); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/InterfaceDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/InterfaceDeclarationImpl.java new file mode 100644 index 00000000000..866c66d9dc8 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/InterfaceDeclarationImpl.java @@ -0,0 +1,52 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import com.sun.mirror.declaration.*; +import com.sun.mirror.util.DeclarationVisitor; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.Symbol.*; + + +/** + * Implementation of InterfaceDeclaration + */ + +public class InterfaceDeclarationImpl extends TypeDeclarationImpl + implements InterfaceDeclaration { + + InterfaceDeclarationImpl(AptEnv env, ClassSymbol sym) { + super(env, sym); + } + + /** + * {@inheritDoc} + */ + public void accept(DeclarationVisitor v) { + v.visitInterfaceDeclaration(this); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/MemberDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/MemberDeclarationImpl.java new file mode 100644 index 00000000000..e47d706332e --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/MemberDeclarationImpl.java @@ -0,0 +1,111 @@ +/* + * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import java.util.Collection; +import java.util.ArrayList; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.util.DeclarationVisitor; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.Symbol; +import com.sun.tools.javac.code.Symbol.ClassSymbol; +import com.sun.tools.javac.code.Type; + + +/** + * Implementation of MemberDeclaration + */ + +public abstract class MemberDeclarationImpl extends DeclarationImpl + implements MemberDeclaration { + + protected MemberDeclarationImpl(AptEnv env, Symbol sym) { + super(env, sym); + } + + + /** + * {@inheritDoc} + */ + public TypeDeclaration getDeclaringType() { + ClassSymbol c = getDeclaringClassSymbol(); + return (c == null) + ? null + : env.declMaker.getTypeDeclaration(c); + } + + /** + * {@inheritDoc} + * For methods, constructors, and types. + */ + public Collection getFormalTypeParameters() { + ArrayList res = + new ArrayList(); + for (Type t : sym.type.getTypeArguments()) { + res.add(env.declMaker.getTypeParameterDeclaration(t.tsym)); + } + return res; + } + + /** + * {@inheritDoc} + */ + public void accept(DeclarationVisitor v) { + v.visitMemberDeclaration(this); + } + + + /** + * Returns the ClassSymbol of the declaring type, + * or null if this is a top-level type. + */ + private ClassSymbol getDeclaringClassSymbol() { + return sym.owner.enclClass(); + } + + /** + * Returns the formal type parameters of a type, member or constructor + * as an angle-bracketed string. Each parameter consists of the simple + * type variable name and any bounds (with no implicit "extends Object" + * clause added). Type names are qualified. + * Returns "" if there are no type parameters. + */ + protected static String typeParamsToString(AptEnv env, Symbol sym) { + if (sym.type.getTypeArguments().isEmpty()) { + return ""; + } + StringBuilder s = new StringBuilder(); + for (Type t : sym.type.getTypeArguments()) { + Type.TypeVar tv = (Type.TypeVar) t; + s.append(s.length() == 0 ? "<" : ", ") + .append(TypeParameterDeclarationImpl.toString(env, tv)); + } + s.append(">"); + return s.toString(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/MethodDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/MethodDeclarationImpl.java new file mode 100644 index 00000000000..fff004122b7 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/MethodDeclarationImpl.java @@ -0,0 +1,61 @@ +/* + * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import com.sun.mirror.declaration.*; +import com.sun.mirror.util.DeclarationVisitor; +import com.sun.mirror.type.TypeMirror; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.Symbol.MethodSymbol; + + +/** + * Implementation of MethodDeclaration + */ + +public class MethodDeclarationImpl extends ExecutableDeclarationImpl + implements MethodDeclaration { + + MethodDeclarationImpl(AptEnv env, MethodSymbol sym) { + super(env, sym); + } + + + /** + * {@inheritDoc} + */ + public TypeMirror getReturnType() { + return env.typeMaker.getType(sym.type.getReturnType()); + } + + /** + * {@inheritDoc} + */ + public void accept(DeclarationVisitor v) { + v.visitMethodDeclaration(this); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/PackageDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/PackageDeclarationImpl.java new file mode 100644 index 00000000000..2edbeb4314b --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/PackageDeclarationImpl.java @@ -0,0 +1,126 @@ +/* + * Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import java.util.ArrayList; +import java.util.Collection; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.util.*; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.*; +import com.sun.tools.javac.code.Symbol.*; + + +/** + * Implementation of PackageDeclaration. + */ + +public class PackageDeclarationImpl extends DeclarationImpl + implements PackageDeclaration { + + private PackageSymbol sym; + + + public PackageDeclarationImpl(AptEnv env, PackageSymbol sym) { + super(env, sym); + this.sym = sym; + } + + + /** + * Returns the qualified name. + */ + public String toString() { + return getQualifiedName(); + } + + /** + * {@inheritDoc} + */ + public String getQualifiedName() { + return sym.getQualifiedName().toString(); + } + + /** + * {@inheritDoc} + */ + public Collection getClasses() { + return identityFilter.filter(getAllTypes(), + ClassDeclaration.class); + } + + /** + * {@inheritDoc} + */ + public Collection getEnums() { + return identityFilter.filter(getAllTypes(), + EnumDeclaration.class); + } + + /** + * {@inheritDoc} + */ + public Collection getInterfaces() { + return identityFilter.filter(getAllTypes(), + InterfaceDeclaration.class); + } + + /** + * {@inheritDoc} + */ + public Collection getAnnotationTypes() { + return identityFilter.filter(getAllTypes(), + AnnotationTypeDeclaration.class); + } + + /** + * {@inheritDoc} + */ + public void accept(DeclarationVisitor v) { + v.visitPackageDeclaration(this); + } + + + // Cache of all top-level type declarations in this package. + private Collection allTypes = null; + + /** + * Caches and returns all top-level type declarations in this package. + * Omits synthetic types. + */ + private Collection getAllTypes() { + if (allTypes != null) { + return allTypes; + } + allTypes = new ArrayList(); + for (Symbol s : getMembers(false)) { + allTypes.add(env.declMaker.getTypeDeclaration((ClassSymbol) s)); + } + return allTypes; + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ParameterDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ParameterDeclarationImpl.java new file mode 100644 index 00000000000..9016b8073fd --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/ParameterDeclarationImpl.java @@ -0,0 +1,100 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import java.util.Collection; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.type.TypeMirror; +import com.sun.mirror.util.DeclarationVisitor; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.*; +import com.sun.tools.javac.code.Symbol.VarSymbol; + + +/** + * Implementation of ParameterDeclaration + */ + +public class ParameterDeclarationImpl extends DeclarationImpl + implements ParameterDeclaration +{ + protected VarSymbol sym; + + + ParameterDeclarationImpl(AptEnv env, VarSymbol sym) { + super(env, sym); + this.sym = sym; + } + + + /** + * Returns the simple name of the parameter. + */ + public String toString() { + return getType() + " " + sym.name; + } + + /** + * {@inheritDoc} + */ + public boolean equals(Object obj) { + // Neither ParameterDeclarationImpl objects nor their symbols + // are cached by the current implementation, so check symbol + // owners and names. + + if (obj instanceof ParameterDeclarationImpl) { + ParameterDeclarationImpl that = (ParameterDeclarationImpl) obj; + return sym.owner == that.sym.owner && + sym.name == that.sym.name && + env == that.env; + } else { + return false; + } + } + + /** + * {@inheritDoc} + */ + public int hashCode() { + return sym.owner.hashCode() + sym.name.hashCode() + env.hashCode(); + } + + /** + * {@inheritDoc} + */ + public TypeMirror getType() { + return env.typeMaker.getType(sym.type); + } + + /** + * {@inheritDoc} + */ + public void accept(DeclarationVisitor v) { + v.visitParameterDeclaration(this); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/TypeDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/TypeDeclarationImpl.java new file mode 100644 index 00000000000..d67d6f21e10 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/TypeDeclarationImpl.java @@ -0,0 +1,157 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import java.util.Collection; +import java.util.ArrayList; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.type.*; +import com.sun.mirror.util.DeclarationVisitor; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.*; +import com.sun.tools.javac.code.Symbol.*; +import com.sun.tools.javac.util.Name; + +/** + * Implementation of TypeDeclaration + */ + +public class TypeDeclarationImpl extends MemberDeclarationImpl + implements TypeDeclaration { + + public ClassSymbol sym; + + + /** + * "sym" should be completed before this constructor is called. + */ + protected TypeDeclarationImpl(AptEnv env, ClassSymbol sym) { + super(env, sym); + this.sym = sym; + } + + + /** + * Returns the type's name, with any type parameters (including those + * of outer classes). Type names are qualified. + */ + public String toString() { + return toString(env, sym); + } + + /** + * {@inheritDoc} + */ + public PackageDeclaration getPackage() { + return env.declMaker.getPackageDeclaration(sym.packge()); + } + + /** + * {@inheritDoc} + */ + public String getQualifiedName() { + return sym.toString(); + } + + /** + * {@inheritDoc} + */ + public Collection getSuperinterfaces() { + return env.typeMaker.getTypes(env.jctypes.interfaces(sym.type), + InterfaceType.class); + } + + /** + * {@inheritDoc} + */ + public Collection getFields() { + ArrayList res = new ArrayList(); + for (Symbol s : getMembers(true)) { + if (s.kind == Kinds.VAR) { + res.add(env.declMaker.getFieldDeclaration((VarSymbol) s)); + } + } + return res; + } + + /** + * {@inheritDoc} + */ + public Collection getMethods() { + ArrayList res = new ArrayList(); + for (Symbol s : getMembers(true)) { + if (s.kind == Kinds.MTH && !s.isConstructor() && + !env.names.clinit.equals(s.name) ) { // screen out static initializers + MethodSymbol m = (MethodSymbol) s; + res.add((MethodDeclaration) + env.declMaker.getExecutableDeclaration(m)); + } + } + return res; + } + + /** + * {@inheritDoc} + */ + public Collection getNestedTypes() { + ArrayList res = new ArrayList(); + for (Symbol s : getMembers(true)) { + if (s.kind == Kinds.TYP) { + res.add(env.declMaker.getTypeDeclaration((ClassSymbol) s)); + } + } + return res; + } + + /** + * {@inheritDoc} + */ + public void accept(DeclarationVisitor v) { + v.visitTypeDeclaration(this); + } + + + /** + * Returns a type's name, with any type parameters (including those + * of outer classes). Type names are qualified. + */ + static String toString(AptEnv env, ClassSymbol c) { + StringBuilder sb = new StringBuilder(); + if (c.isInner()) { + // c is an inner class, so include type params of outer. + ClassSymbol enclosing = c.owner.enclClass(); + sb.append(toString(env, enclosing)) + .append('.') + .append(c.name); + } else { + sb.append(c); + } + sb.append(typeParamsToString(env, c)); + return sb.toString(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/TypeParameterDeclarationImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/TypeParameterDeclarationImpl.java new file mode 100644 index 00000000000..b169f47509f --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/declaration/TypeParameterDeclarationImpl.java @@ -0,0 +1,121 @@ +/* + * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.declaration; + + +import java.util.Collection; +import java.util.ArrayList; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.type.ReferenceType; +import com.sun.mirror.util.DeclarationVisitor; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.*; +import com.sun.tools.javac.code.Symbol.*; + + +/** + * Implementation of TypeParameterDeclaration + */ + +public class TypeParameterDeclarationImpl extends DeclarationImpl + implements TypeParameterDeclaration +{ + protected TypeSymbol sym; + + + TypeParameterDeclarationImpl(AptEnv env, TypeSymbol sym) { + super(env, sym); + this.sym = sym; + } + + + /** + * Returns the type parameter's name along with any "extends" clause. + * Class names are qualified. No implicit "extends Object" is added. + */ + public String toString() { + return toString(env, (Type.TypeVar) sym.type); + } + + /** + * {@inheritDoc} + */ + public Collection getBounds() { + ArrayList res = new ArrayList(); + for (Type t : env.jctypes.getBounds((Type.TypeVar) sym.type)) { + res.add((ReferenceType) env.typeMaker.getType(t)); + } + return res; + } + + /** + * {@inheritDoc} + */ + public Declaration getOwner() { + Symbol owner = sym.owner; + return ((owner.kind & Kinds.TYP) != 0) + ? env.declMaker.getTypeDeclaration((ClassSymbol) owner) + : env.declMaker.getExecutableDeclaration((MethodSymbol) owner); + } + + + + /** + * {@inheritDoc} + */ + public void accept(DeclarationVisitor v) { + v.visitTypeParameterDeclaration(this); + } + + + /** + * Returns the type parameter's name along with any "extends" clause. + * See {@link #toString()} for details. + */ + static String toString(AptEnv env, Type.TypeVar tv) { + StringBuilder s = new StringBuilder(); + s.append(tv); + boolean first = true; + for (Type bound : getExtendsBounds(env, tv)) { + s.append(first ? " extends " : " & "); + s.append(env.typeMaker.typeToString(bound)); + first = false; + } + return s.toString(); + } + + /** + * Returns the bounds of a type variable, eliding java.lang.Object + * if it appears alone. + */ + private static Iterable getExtendsBounds(AptEnv env, + Type.TypeVar tv) { + return (tv.getUpperBound().tsym == env.symtab.objectType.tsym) + ? com.sun.tools.javac.util.List.nil() + : env.jctypes.getBounds(tv); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/AnnotationTypeImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/AnnotationTypeImpl.java new file mode 100644 index 00000000000..e39a30dabeb --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/AnnotationTypeImpl.java @@ -0,0 +1,61 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.type; + + +import com.sun.mirror.declaration.*; +import com.sun.mirror.type.*; +import com.sun.mirror.util.TypeVisitor; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.Type; + + +/** + * Implementation of AnnotationType + */ + +public class AnnotationTypeImpl extends InterfaceTypeImpl + implements AnnotationType { + + AnnotationTypeImpl(AptEnv env, Type.ClassType type) { + super(env, type); + } + + + /** + * {@inheritDoc} + */ + public AnnotationTypeDeclaration getDeclaration() { + return (AnnotationTypeDeclaration) super.getDeclaration(); + } + + /** + * {@inheritDoc} + */ + public void accept(TypeVisitor v) { + v.visitAnnotationType(this); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/ArrayTypeImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/ArrayTypeImpl.java new file mode 100644 index 00000000000..8c1458be77f --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/ArrayTypeImpl.java @@ -0,0 +1,63 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.type; + + +import com.sun.mirror.type.*; +import com.sun.mirror.util.TypeVisitor; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.Type; + + +/** + * Implementation of ArrayType + */ + +public class ArrayTypeImpl extends TypeMirrorImpl implements ArrayType { + + protected Type.ArrayType type; + + + ArrayTypeImpl(AptEnv env, Type.ArrayType type) { + super(env, type); + this.type = type; + } + + + /** + * {@inheritDoc} + */ + public TypeMirror getComponentType() { + return env.typeMaker.getType(type.elemtype); + } + + /** + * {@inheritDoc} + */ + public void accept(TypeVisitor v) { + v.visitArrayType(this); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/ClassTypeImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/ClassTypeImpl.java new file mode 100644 index 00000000000..a4b9fd230b3 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/ClassTypeImpl.java @@ -0,0 +1,72 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.type; + + +import com.sun.mirror.declaration.*; +import com.sun.mirror.type.*; +import com.sun.mirror.util.TypeVisitor; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.Type; + + +/** + * Implementation of ClassType + */ + +public class ClassTypeImpl extends DeclaredTypeImpl implements ClassType { + + ClassTypeImpl(AptEnv env, Type.ClassType type) { + super(env, type); + } + + + /** + * {@inheritDoc} + */ + public ClassDeclaration getDeclaration() { + return (ClassDeclaration) super.getDeclaration(); + } + + /** + * {@inheritDoc} + */ + public ClassType getSuperclass() { + // java.lang.Object has no superclass + if (type.tsym == env.symtab.objectType.tsym) { + return null; + } + Type sup = env.jctypes.supertype(type); + return (ClassType) env.typeMaker.getType(sup); + } + + /** + * {@inheritDoc} + */ + public void accept(TypeVisitor v) { + v.visitClassType(this); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/DeclaredTypeImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/DeclaredTypeImpl.java new file mode 100644 index 00000000000..81683248c4a --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/DeclaredTypeImpl.java @@ -0,0 +1,112 @@ +/* + * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.type; + + +import java.util.Collection; + +import com.sun.mirror.declaration.TypeDeclaration; +import com.sun.mirror.type.*; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.*; +import com.sun.tools.javac.code.Symbol.ClassSymbol; + + +/** + * Implementation of DeclaredType + */ + +abstract class DeclaredTypeImpl extends TypeMirrorImpl + implements DeclaredType { + + protected Type.ClassType type; + + + protected DeclaredTypeImpl(AptEnv env, Type.ClassType type) { + super(env, type); + this.type = type; + } + + + /** + * Returns a string representation of this declared type. + * This includes the type's name and any actual type arguments. + * Type names are qualified. + */ + public String toString() { + return toString(env, type); + } + + /** + * {@inheritDoc} + */ + public TypeDeclaration getDeclaration() { + return env.declMaker.getTypeDeclaration((ClassSymbol) type.tsym); + } + + /** + * {@inheritDoc} + */ + public DeclaredType getContainingType() { + if (type.getEnclosingType().tag == TypeTags.CLASS) { + // This is the type of an inner class. + return (DeclaredType) env.typeMaker.getType(type.getEnclosingType()); + } + ClassSymbol enclosing = type.tsym.owner.enclClass(); + if (enclosing != null) { + // Nested but not inner. Return the raw type of the enclosing + // class or interface. + // See java.lang.reflect.ParameterizedType.getOwnerType(). + return (DeclaredType) env.typeMaker.getType( + env.jctypes.erasure(enclosing.type)); + } + return null; + } + + /** + * {@inheritDoc} + */ + public Collection getActualTypeArguments() { + return env.typeMaker.getTypes(type.getTypeArguments()); + } + + /** + * {@inheritDoc} + */ + public Collection getSuperinterfaces() { + return env.typeMaker.getTypes(env.jctypes.interfaces(type), + InterfaceType.class); + } + + + /** + * Returns a string representation of this declared type. + * See {@link #toString()} for details. + */ + static String toString(AptEnv env, Type.ClassType c) { + return c.toString(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/EnumTypeImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/EnumTypeImpl.java new file mode 100644 index 00000000000..883a3ec1ec8 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/EnumTypeImpl.java @@ -0,0 +1,60 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.type; + + +import com.sun.mirror.declaration.*; +import com.sun.mirror.type.*; +import com.sun.mirror.util.TypeVisitor; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.Type; + + +/** + * Implementation of EnumType + */ + +public class EnumTypeImpl extends ClassTypeImpl implements EnumType { + + EnumTypeImpl(AptEnv env, Type.ClassType type) { + super(env, type); + } + + + /** + * {@inheritDoc} + */ + public EnumDeclaration getDeclaration() { + return (EnumDeclaration) super.getDeclaration(); + } + + /** + * {@inheritDoc} + */ + public void accept(TypeVisitor v) { + v.visitEnumType(this); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/InterfaceTypeImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/InterfaceTypeImpl.java new file mode 100644 index 00000000000..3e056deeef8 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/InterfaceTypeImpl.java @@ -0,0 +1,61 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.type; + + +import com.sun.mirror.declaration.*; +import com.sun.mirror.type.*; +import com.sun.mirror.util.TypeVisitor; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.Type; + + +/** + * Implementation of InterfaceType + */ + +public class InterfaceTypeImpl extends DeclaredTypeImpl + implements InterfaceType { + + InterfaceTypeImpl(AptEnv env, Type.ClassType type) { + super(env, type); + } + + + /** + * {@inheritDoc} + */ + public InterfaceDeclaration getDeclaration() { + return (InterfaceDeclaration) super.getDeclaration(); + } + + /** + * {@inheritDoc} + */ + public void accept(TypeVisitor v) { + v.visitInterfaceType(this); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/PrimitiveTypeImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/PrimitiveTypeImpl.java new file mode 100644 index 00000000000..e176d5b487e --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/PrimitiveTypeImpl.java @@ -0,0 +1,84 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.type; + + + +import com.sun.mirror.type.PrimitiveType; +import com.sun.mirror.util.TypeVisitor; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.Type; + +import static com.sun.mirror.type.PrimitiveType.Kind.*; + + +/** + * Implementation of PrimitiveType. + */ + +class PrimitiveTypeImpl extends TypeMirrorImpl implements PrimitiveType { + + private final Kind kind; // the kind of primitive + + + PrimitiveTypeImpl(AptEnv env, Kind kind) { + super(env, getType(env, kind)); + this.kind = kind; + } + + + /** + * {@inheritDoc} + */ + public Kind getKind() { + return kind; + } + + /** + * {@inheritDoc} + */ + public void accept(TypeVisitor v) { + v.visitPrimitiveType(this); + } + + + /** + * Returns the javac type corresponding to a kind of primitive type. + */ + private static Type getType(AptEnv env, Kind kind) { + switch (kind) { + case BOOLEAN: return env.symtab.booleanType; + case BYTE: return env.symtab.byteType; + case SHORT: return env.symtab.shortType; + case INT: return env.symtab.intType; + case LONG: return env.symtab.longType; + case CHAR: return env.symtab.charType; + case FLOAT: return env.symtab.floatType; + case DOUBLE: return env.symtab.doubleType; + default: throw new AssertionError(); + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMaker.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMaker.java new file mode 100644 index 00000000000..70d322b5371 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMaker.java @@ -0,0 +1,160 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.type; + + +import java.util.Collection; +import java.util.ArrayList; + +import com.sun.mirror.type.*; +import com.sun.mirror.type.PrimitiveType.Kind; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.*; +import com.sun.tools.javac.util.Context; + +import static com.sun.tools.javac.code.TypeTags.*; + + +/** + * Utilities for constructing type objects. + */ + +public class TypeMaker { + + private final AptEnv env; + private final VoidType voidType; + private PrimitiveType[] primTypes = new PrimitiveType[VOID]; + // VOID is past all prim types + + + private static final Context.Key typeMakerKey = + new Context.Key(); + + public static TypeMaker instance(Context context) { + TypeMaker instance = context.get(typeMakerKey); + if (instance == null) { + instance = new TypeMaker(context); + } + return instance; + } + + private TypeMaker(Context context) { + context.put(typeMakerKey, this); + env = AptEnv.instance(context); + + voidType = new VoidTypeImpl(env); + primTypes[BOOLEAN] = new PrimitiveTypeImpl(env, Kind.BOOLEAN); + primTypes[BYTE] = new PrimitiveTypeImpl(env, Kind.BYTE); + primTypes[SHORT] = new PrimitiveTypeImpl(env, Kind.SHORT); + primTypes[INT] = new PrimitiveTypeImpl(env, Kind.INT); + primTypes[LONG] = new PrimitiveTypeImpl(env, Kind.LONG); + primTypes[CHAR] = new PrimitiveTypeImpl(env, Kind.CHAR); + primTypes[FLOAT] = new PrimitiveTypeImpl(env, Kind.FLOAT); + primTypes[DOUBLE] = new PrimitiveTypeImpl(env, Kind.DOUBLE); + } + + + /** + * Returns the TypeMirror corresponding to a javac Type object. + */ + public TypeMirror getType(Type t) { + if (t.isPrimitive()) { + return primTypes[t.tag]; + } + switch (t.tag) { + case ERROR: // fall through + case CLASS: return getDeclaredType((Type.ClassType) t); + case WILDCARD: return new WildcardTypeImpl(env, (Type.WildcardType) t); + case TYPEVAR: return new TypeVariableImpl(env, (Type.TypeVar) t); + case ARRAY: return new ArrayTypeImpl(env, (Type.ArrayType) t); + case VOID: return voidType; + default: throw new AssertionError(); + } + } + + /** + * Returns the declared type corresponding to a given ClassType. + */ + public DeclaredType getDeclaredType(Type.ClassType t) { + return + hasFlag(t.tsym, Flags.ANNOTATION) ? new AnnotationTypeImpl(env, t) : + hasFlag(t.tsym, Flags.INTERFACE) ? new InterfaceTypeImpl(env, t) : + hasFlag(t.tsym, Flags.ENUM) ? new EnumTypeImpl(env, t) : + new ClassTypeImpl(env, t); + } + + /** + * Returns a collection of types corresponding to a list of javac Type + * objects. + */ + public Collection getTypes(Iterable types) { + return getTypes(types, TypeMirror.class); + } + + /** + * Returns a collection of types corresponding to a list of javac Type + * objects. The element type of the result is specified explicitly. + */ + public Collection getTypes(Iterable types, + Class resType) { + ArrayList res = new ArrayList(); + for (Type t : types) { + TypeMirror mir = getType(t); + if (resType.isInstance(mir)) { + res.add(resType.cast(mir)); + } + } + return res; + } + + /** + * Returns the string representation of a type. + * Bounds of type variables are not included; bounds of wildcard types are. + * Type names are qualified. + */ + public String typeToString(Type t) { + switch (t.tag) { + case ARRAY: + return typeToString(env.jctypes.elemtype(t)) + "[]"; + case CLASS: + Type.ClassType c = (Type.ClassType) t; + return DeclaredTypeImpl.toString(env, c); + case WILDCARD: + Type.WildcardType a = (Type.WildcardType) t; + return WildcardTypeImpl.toString(env, a); + default: + return t.tsym.toString(); + } + } + + + /** + * Does a symbol have a given flag? + */ + private static boolean hasFlag(Symbol s, long flag) { + return AptEnv.hasFlag(s, flag); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java new file mode 100644 index 00000000000..964cd8abdea --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeMirrorImpl.java @@ -0,0 +1,76 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.type; + + +import com.sun.mirror.declaration.*; +import com.sun.mirror.type.*; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.*; + + +/** + * Implementation of TypeMirror + */ + +public abstract class TypeMirrorImpl implements TypeMirror { + + protected final AptEnv env; + public final Type type; + + + protected TypeMirrorImpl(AptEnv env, Type type) { + this.env = env; + this.type = type; + } + + + /** + * {@inheritDoc} + */ + public String toString() { + return type.toString(); + } + + /** + * {@inheritDoc} + */ + public boolean equals(Object obj) { + if (obj instanceof TypeMirrorImpl) { + TypeMirrorImpl that = (TypeMirrorImpl) obj; + return env.jctypes.isSameType(this.type, that.type); + } else { + return false; + } + } + + /** + * {@inheritDoc} + */ + public int hashCode() { + return env.jctypes.hashCode(type); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeVariableImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeVariableImpl.java new file mode 100644 index 00000000000..f96e01e0cd8 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/TypeVariableImpl.java @@ -0,0 +1,77 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.type; + + +import java.util.Collection; +import java.util.ArrayList; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.type.*; +import com.sun.mirror.util.TypeVisitor; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.Symbol.TypeSymbol; +import com.sun.tools.javac.code.Type; + + +/** + * Implementation of TypeVariable + */ + +public class TypeVariableImpl extends TypeMirrorImpl implements TypeVariable { + + protected Type.TypeVar type; + + + TypeVariableImpl(AptEnv env, Type.TypeVar type) { + super(env, type); + this.type = type; + } + + + /** + * Returns the simple name of this type variable. Bounds are + * not included. + */ + public String toString() { + return type.tsym.name.toString(); + } + + /** + * {@inheritDoc} + */ + public TypeParameterDeclaration getDeclaration() { + TypeSymbol sym = (TypeSymbol) type.tsym; + return env.declMaker.getTypeParameterDeclaration(sym); + } + + /** + * {@inheritDoc} + */ + public void accept(TypeVisitor v) { + v.visitTypeVariable(this); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/VoidTypeImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/VoidTypeImpl.java new file mode 100644 index 00000000000..7f9a7bc2989 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/VoidTypeImpl.java @@ -0,0 +1,50 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.type; + + +import com.sun.mirror.type.VoidType; +import com.sun.mirror.util.TypeVisitor; +import com.sun.tools.apt.mirror.AptEnv; + + +/** + * Implementation of VoidType. + */ + +class VoidTypeImpl extends TypeMirrorImpl implements VoidType { + + VoidTypeImpl(AptEnv env) { + super(env, env.symtab.voidType); + } + + /** + * {@inheritDoc} + */ + public void accept(TypeVisitor v) { + v.visitVoidType(this); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/type/WildcardTypeImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/WildcardTypeImpl.java new file mode 100644 index 00000000000..9bda06f994d --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/type/WildcardTypeImpl.java @@ -0,0 +1,111 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.type; + + +import java.util.ArrayList; +import java.util.Collection; +import java.util.Collections; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.type.*; +import com.sun.mirror.util.TypeVisitor; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.*; +import com.sun.tools.javac.code.Symbol.*; + + +/** + * Implementation of WildcardType + */ + +public class WildcardTypeImpl extends TypeMirrorImpl implements WildcardType { + + protected Type.WildcardType type; + + WildcardTypeImpl(AptEnv env, Type.WildcardType type) { + super(env, type); + this.type = type; + } + + + /** + * Returns the string form of a wildcard type, consisting of "?" + * and any "extends" or "super" clause. + * Delimiting brackets are not included. Class names are qualified. + */ + public String toString() { + return toString(env, type); + } + + /** + * {@inheritDoc} + */ + public Collection getUpperBounds() { + return type.isSuperBound() + ? Collections.emptyList() + : typeToCollection(type.type); + } + + /** + * {@inheritDoc} + */ + public Collection getLowerBounds() { + return type.isExtendsBound() + ? Collections.emptyList() + : typeToCollection(type.type); + } + + /** + * Gets the ReferenceType for a javac Type object, and returns + * it in a singleton collection. If type is null, returns an empty + * collection. + */ + private Collection typeToCollection(Type type) { + ArrayList res = new ArrayList(1); + if (type != null) { + res.add((ReferenceType) env.typeMaker.getType(type)); + } + return res; + } + + /** + * {@inheritDoc} + */ + public void accept(TypeVisitor v) { + v.visitWildcardType(this); + } + + + /** + * Returns the string form of a wildcard type, consisting of "?" + * and any "extends" or "super" clause. + * See {@link #toString()} for details. + */ + static String toString(AptEnv env, Type.WildcardType wildThing) { + return wildThing.toString(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/util/DeclarationsImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/util/DeclarationsImpl.java new file mode 100644 index 00000000000..f6008e0618d --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/util/DeclarationsImpl.java @@ -0,0 +1,133 @@ +/* + * Copyright 2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.util; + + +import com.sun.mirror.declaration.*; +import com.sun.mirror.util.Declarations; +import com.sun.tools.apt.mirror.declaration.DeclarationImpl; +import com.sun.tools.apt.mirror.declaration.MethodDeclarationImpl; +import com.sun.tools.apt.mirror.util.DeclarationsImpl; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.javac.code.*; +import com.sun.tools.javac.code.Symbol.*; +import com.sun.tools.javac.util.Context; + +import static com.sun.tools.javac.code.Kinds.*; + + +/** + * Implementation of Declarations utility methods for annotation processors + */ + +public class DeclarationsImpl implements Declarations { + + private final AptEnv env; + + + private static final Context.Key declarationsKey = + new Context.Key(); + + public static Declarations instance(Context context) { + Declarations instance = context.get(declarationsKey); + if (instance == null) { + instance = new DeclarationsImpl(context); + } + return instance; + } + + private DeclarationsImpl(Context context) { + context.put(declarationsKey, this); + env = AptEnv.instance(context); + } + + + /** + * {@inheritDoc} + * See JLS 2 sections 8.3 and 8.4.6. + */ + public boolean hides(MemberDeclaration sub, MemberDeclaration sup) { + Symbol hider = ((DeclarationImpl) sub).sym; + Symbol hidee = ((DeclarationImpl) sup).sym; + + // Fields only hide fields; methods only methods; types only types. + // Names must match. Nothing hides itself (just try it). + if (hider == hidee || + hider.kind != hidee.kind || + hider.name != hidee.name) { + return false; + } + + // Only static methods can hide other methods. + // Methods only hide methods with matching signatures. + if (hider.kind == MTH) { + if ((hider.flags() & Flags.STATIC) == 0 || + !env.jctypes.isSubSignature(hider.type, hidee.type)) { + return false; + } + } + + // Hider must be in a subclass of hidee's class. + // Note that if M1 hides M2, and M2 hides M3, and M3 is accessible + // in M1's class, then M1 and M2 both hide M3. + ClassSymbol hiderClass = hider.owner.enclClass(); + ClassSymbol hideeClass = hidee.owner.enclClass(); + if (hiderClass == null || hideeClass == null || + !hiderClass.isSubClass(hideeClass, env.jctypes)) { + return false; + } + + // Hidee must be accessible in hider's class. + // The method isInheritedIn is poorly named: it checks only access. + return hidee.isInheritedIn(hiderClass, env.jctypes); + } + + /** + * {@inheritDoc} + * See JLS 2 section 8.4.6.1. + */ + public boolean overrides(MethodDeclaration sub, MethodDeclaration sup) { + MethodSymbol overrider = ((MethodDeclarationImpl) sub).sym; + MethodSymbol overridee = ((MethodDeclarationImpl) sup).sym; + ClassSymbol origin = (ClassSymbol) overrider.owner; + + return overrider.name == overridee.name && + + // not reflexive as per JLS + overrider != overridee && + + // we don't care if overridee is static, though that wouldn't + // compile + !overrider.isStatic() && + + // overrider, whose declaring type is the origin, must be + // in a subtype of overridee's type + env.jctypes.asSuper(origin.type, overridee.owner) != null && + + // check access and signatures; don't check return types + overrider.overrides(overridee, origin, env.jctypes, false); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/util/SourcePositionImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/util/SourcePositionImpl.java new file mode 100644 index 00000000000..d76d0eb3968 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/util/SourcePositionImpl.java @@ -0,0 +1,94 @@ +/* + * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.util; + + +import java.io.File; +import javax.tools.JavaFileObject; + +import com.sun.mirror.util.SourcePosition; +import com.sun.tools.javac.util.Position; + + +/** + * Implementation of SourcePosition + */ + +public class SourcePositionImpl implements SourcePosition { + + private JavaFileObject sourcefile; + private int pos; // file position, in javac's internal format + private Position.LineMap linemap; + + + public SourcePositionImpl(JavaFileObject sourcefile, int pos, Position.LineMap linemap) { + this.sourcefile = sourcefile; + this.pos = pos; + this.linemap = linemap; + assert sourcefile != null; + assert linemap != null; + } + + public int getJavacPosition() { + return pos; + } + + public JavaFileObject getSource() { + return sourcefile; + } + + /** + * Returns a string representation of this position in the + * form "sourcefile:line", or "sourcefile" if no line number is available. + */ + public String toString() { + int ln = line(); + return (ln == Position.NOPOS) + ? sourcefile.toString() + : sourcefile + ":" + ln; + } + + /** + * {@inheritDoc} + */ + public File file() { + return new File(sourcefile.toString()); + } + + /** + * {@inheritDoc} + */ + public int line() { + return linemap.getLineNumber(pos); + } + + /** + * {@inheritDoc} + */ + public int column() { + return linemap.getColumnNumber(pos); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/mirror/util/TypesImpl.java b/langtools/src/share/classes/com/sun/tools/apt/mirror/util/TypesImpl.java new file mode 100644 index 00000000000..8ada36ded5f --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/mirror/util/TypesImpl.java @@ -0,0 +1,229 @@ +/* + * Copyright 2004-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.mirror.util; + + +import java.util.Collection; + +import com.sun.mirror.declaration.*; +import com.sun.mirror.type.*; +import com.sun.mirror.util.Types; +import com.sun.tools.apt.mirror.AptEnv; +import com.sun.tools.apt.mirror.declaration.*; +import com.sun.tools.apt.mirror.type.TypeMirrorImpl; +import com.sun.tools.javac.code.BoundKind; +import com.sun.tools.javac.code.Type; +import com.sun.tools.javac.code.Symbol.ClassSymbol; +import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.util.ListBuffer; + + +/** + * Implementation of Types utility methods for annotation processors + */ + +public class TypesImpl implements Types { + + private final AptEnv env; + + + private static final Context.Key typesKey = + new Context.Key(); + + public static Types instance(Context context) { + Types instance = context.get(typesKey); + if (instance == null) { + instance = new TypesImpl(context); + } + return instance; + } + + private TypesImpl(Context context) { + context.put(typesKey, this); + env = AptEnv.instance(context); + } + + + /** + * {@inheritDoc} + */ + public boolean isSubtype(TypeMirror t1, TypeMirror t2) { + return env.jctypes.isSubtype(((TypeMirrorImpl) t1).type, + ((TypeMirrorImpl) t2).type); + } + + /** + * {@inheritDoc} + */ + public boolean isAssignable(TypeMirror t1, TypeMirror t2) { + return env.jctypes.isAssignable(((TypeMirrorImpl) t1).type, + ((TypeMirrorImpl) t2).type); + } + + /** + * {@inheritDoc} + */ + public TypeMirror getErasure(TypeMirror t) { + return env.typeMaker.getType( + env.jctypes.erasure(((TypeMirrorImpl) t).type)); + } + + /** + * {@inheritDoc} + */ + public PrimitiveType getPrimitiveType(PrimitiveType.Kind kind) { + Type prim = null; + switch (kind) { + case BOOLEAN: prim = env.symtab.booleanType; break; + case BYTE: prim = env.symtab.byteType; break; + case SHORT: prim = env.symtab.shortType; break; + case INT: prim = env.symtab.intType; break; + case LONG: prim = env.symtab.longType; break; + case CHAR: prim = env.symtab.charType; break; + case FLOAT: prim = env.symtab.floatType; break; + case DOUBLE: prim = env.symtab.doubleType; break; + default: assert false; + } + return (PrimitiveType) env.typeMaker.getType(prim); + } + + /** + * {@inheritDoc} + */ + public VoidType getVoidType() { + return (VoidType) env.typeMaker.getType(env.symtab.voidType); + } + + /** + * {@inheritDoc} + */ + public ArrayType getArrayType(TypeMirror componentType) { + if (componentType instanceof VoidType) { + throw new IllegalArgumentException("void"); + } + return (ArrayType) env.typeMaker.getType( + new Type.ArrayType(((TypeMirrorImpl) componentType).type, + env.symtab.arrayClass)); + } + + /** + * {@inheritDoc} + */ + public TypeVariable getTypeVariable(TypeParameterDeclaration tparam) { + return (TypeVariable) env.typeMaker.getType( + ((DeclarationImpl) tparam).sym.type); + } + + /** + * {@inheritDoc} + */ + public WildcardType getWildcardType(Collection upperBounds, + Collection lowerBounds) { + BoundKind kind; + Type bound; + int uppers = upperBounds.size(); + int downers = lowerBounds.size(); + + if (uppers + downers > 1) { + throw new IllegalArgumentException("Multiple bounds not allowed"); + + } else if (uppers + downers == 0) { + kind = BoundKind.UNBOUND; + bound = env.symtab.objectType; + + } else if (uppers == 1) { + assert downers == 0; + kind = BoundKind.EXTENDS; + bound = ((TypeMirrorImpl) upperBounds.iterator().next()).type; + + } else { + assert uppers == 0 && downers == 1; + kind = BoundKind.SUPER; + bound = ((TypeMirrorImpl) lowerBounds.iterator().next()).type; + } + + if (bound instanceof Type.WildcardType) + throw new IllegalArgumentException(bound.toString()); + + return (WildcardType) env.typeMaker.getType( + new Type.WildcardType(bound, kind, env.symtab.boundClass)); + } + + /** + * {@inheritDoc} + */ + public DeclaredType getDeclaredType(TypeDeclaration decl, + TypeMirror... typeArgs) { + ClassSymbol sym = ((TypeDeclarationImpl) decl).sym; + + if (typeArgs.length == 0) + return (DeclaredType) env.typeMaker.getType( + env.jctypes.erasure(sym.type)); + if (sym.type.getEnclosingType().isParameterized()) + throw new IllegalArgumentException(decl.toString()); + + return getDeclaredType(sym.type.getEnclosingType(), sym, typeArgs); + } + + /** + * {@inheritDoc} + */ + public DeclaredType getDeclaredType(DeclaredType containing, + TypeDeclaration decl, + TypeMirror... typeArgs) { + if (containing == null) + return getDeclaredType(decl, typeArgs); + + ClassSymbol sym = ((TypeDeclarationImpl) decl).sym; + Type outer = ((TypeMirrorImpl) containing).type; + + if (outer.tsym != sym.owner.enclClass()) + throw new IllegalArgumentException(containing.toString()); + if (!outer.isParameterized()) + return getDeclaredType(decl, typeArgs); + + return getDeclaredType(outer, sym, typeArgs); + } + + private DeclaredType getDeclaredType(Type outer, + ClassSymbol sym, + TypeMirror... typeArgs) { + if (typeArgs.length != sym.type.getTypeArguments().length()) + throw new IllegalArgumentException( + "Incorrect number of type arguments"); + + ListBuffer targs = new ListBuffer(); + for (TypeMirror t : typeArgs) { + if (!(t instanceof ReferenceType || t instanceof WildcardType)) + throw new IllegalArgumentException(t.toString()); + targs.append(((TypeMirrorImpl) t).type); + } + //### Need a way to check that type args match formals. + + return (DeclaredType) env.typeMaker.getType( + new Type.ClassType(outer, targs.toList(), sym)); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/apt/resources/apt.properties b/langtools/src/share/classes/com/sun/tools/apt/resources/apt.properties new file mode 100644 index 00000000000..80446a08931 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/resources/apt.properties @@ -0,0 +1,176 @@ +# +# Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +apt.msg.usage.header=\ +Usage: {0} \n\ +where apt options include: + +apt.msg.usage.footer=\ +See javac -help for information on javac options. + +apt.msg.usage.nonstandard.footer=\ +These options are non-standard and subject to change without notice, \nas is the format of their output. + +apt.msg.bug=\ +An exception has occurred in apt ({0}). \ +Please file a bug at the Java Developer Connection (http://java.sun.com/webapps/bugreport) \ +after checking the Bug Parade for duplicates. \ +Include your program and the following diagnostic in your report. Thank you. + +## apt options + +apt.opt.A=\ + Options to pass to annotation processors +apt.opt.arg.class=\ + +apt.opt.arg.directory=\ + Specify where to place processor and javac generated class files +apt.opt.classpath=\ + Specify where to find user class files and annotation processor factories +apt.opt.d=\ + Specify where to place processor and javac generated class files +apt.opt.factory=\ + Name of AnnotationProcessorFactory to use; bypasses default discovery process +apt.opt.factorypath=\ + Specify where to find annotation processor factories +apt.opt.s=\ + Specify where to place processor generated source files +apt.opt.help=\ + Print a synopsis of standard options; use javac -help for more options +apt.opt.print=\ + Print out textual representation of specified types +apt.opt.nocompile=\ + Do not compile source files to class files +apt.opt.proc.flag=\ + [key[=value]] +apt.opt.version=\ + Version information +apt.opt.XListAnnotationTypes=\ + List found annotation types +apt.opt.XListDeclarations=\ + List specified and included declarations +apt.opt.XPrintAptRounds=\ + Print information about initial and recursive apt rounds +apt.opt.XPrintFactoryInfo=\ + Print information about which annotations a factory is asked to process +apt.opt.XClassesAsDecls=\ + Treat both class and source files as declarations to process + +## +## errors +## + +## All errors which do not refer to a particular line in the source code are +## preceded by this string. + +apt.err.error=\ + error:\u0020 + +apt.err.unsupported.source.version=\ + Source release {0} is not supported; use release 5 or earlier + +apt.err.unsupported.target.version=\ + Target release {0} is not supported; use release 5 or earlier + +apt.err.BadDeclaration=\ + Bad declaration created for annotation type {0} + +apt.err.CantFindClass=\ + Could not find class file for {0} + +apt.err.DeclarationCreation=\ + Could not create declaration for annotation type {0} + +# Print an error from the Messager +apt.err.Messager=\ + {0} + +## +## miscellaneous strings +## + +apt.misc.Problem=\ + Problem encountered during annotation processing; \nsee stacktrace below for more information. + +apt.misc.SunMiscService=\ + Error finding annotation processor factories; \ncheck META-INF/services information. + +# Print a notice from the Messager +apt.note.Messager=\ + {0} + +## +## warnings +## + +## All warning messages are preceded by the following string. +apt.warn.warning=\ + warning:\u0020 + +apt.warn.AnnotationsWithoutProcessors=\ + Annotation types without processors: {0} + +apt.warn.BadFactory=\ + Bad annotation processor factory: {0} + +apt.warn.BadParentDirectory=\ + Failed to create some parent directory of {0} + +apt.warn.FactoryCantInstantiate=\ + Could not instantiate an instance of factory ''{0}''. + +apt.warn.FactoryWrongType=\ + Specified factory, ''{0}'', is not an AnnotationProcessorFactory. + +apt.warn.FactoryNotFound=\ + Specified AnnotationProcessorFactory, ''{0}'', not found on search path. + +apt.warn.FileReopening=\ + Attempt to create ''{0}'' multiple times + +apt.warn.IllegalFileName=\ + Cannot create file for illegal name ''{0}''. + +apt.warn.MalformedSupportedString=\ + Malformed string for annotation support, ''{0}'', returned by factory. + +apt.warn.NoNewFilesAfterRound=\ + Cannot create file ''{0}'' after a round has ended. + +# Print a warning from the Messager +apt.warn.Messager=\ + {0} + +apt.warn.NoAnnotationProcessors=\ + No annotation processors found but annotations present. + +apt.warn.NullProcessor=\ + Factory {0} returned null for an annotation processor. + +apt.warn.CorrespondingClassFile=\ + A class file corresponding to source file ''{0}'' has already been created. + +apt.warn.CorrespondingSourceFile=\ + A source file corresponding to class file ''{0}'' has already been created. diff --git a/langtools/src/share/classes/com/sun/tools/apt/resources/apt_ja.properties b/langtools/src/share/classes/com/sun/tools/apt/resources/apt_ja.properties new file mode 100644 index 00000000000..bd1e5f30794 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/resources/apt_ja.properties @@ -0,0 +1,176 @@ +# +# Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +apt.msg.usage.header=\ +\u4f7f\u7528\u6cd5: {0} <\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb>\n\ +\u6b21\u306e apt \u30aa\u30d7\u30b7\u30e7\u30f3\u304c\u3042\u308a\u307e\u3059: + +apt.msg.usage.footer=\ +javac \u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u3064\u3044\u3066\u306f\u3001javac -help \u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 + +apt.msg.usage.nonstandard.footer=\ +\u3053\u308c\u3089\u306f\u975e\u6a19\u6e96\u30aa\u30d7\u30b7\u30e7\u30f3\u3067\u3042\u308a\u4e88\u544a\u306a\u3057\u306b\u5909\u66f4\u3055\u308c\u308b\u3053\u3068\u304c\u3042\u308a\u307e\u3059\u3002\n\u8868\u793a\u5f62\u5f0f\u306f\u540c\u3058\u3067\u3059\u3002 + +apt.msg.bug=\ +\u30a2\u30d7\u30ea\u30b1\u30fc\u30b7\u30e7\u30f3\u3067\u4f8b\u5916\u304c\u767a\u751f\u3057\u307e\u3057\u305f ({0})\u3002\ +Bug Parade \u306b\u540c\u3058\u30d0\u30b0\u304c\u767b\u9332\u3055\u308c\u3066\u3044\u306a\u3044\u3053\u3068\u3092\u3054\u78ba\u8a8d\u306e\u4e0a\u3001Java Developer Connection \ +(http://java.sun.com/webapps/bugreport) \u306b\u3066\u30d0\u30b0\u306e\u767b\u9332\u3092\u304a\u9858\u3044\u3044\u305f\u3057\u307e\u3059\u3002 \ +\u30ec\u30dd\u30fc\u30c8\u306b\u306f\u3001\u305d\u306e\u30d7\u30ed\u30b0\u30e9\u30e0\u3068\u4e0b\u8a18\u306e\u8a3a\u65ad\u5185\u5bb9\u3092\u542b\u3081\u3066\u304f\u3060\u3055\u3044\u3002\u3054\u5354\u529b\u3042\u308a\u304c\u3068\u3046\u3054\u3056\u3044\u307e\u3059\u3002 + +## apt options + +apt.opt.A=\ + \u6ce8\u91c8\u30d7\u30ed\u30bb\u30c3\u30b5\u306b\u6e21\u3055\u308c\u308b\u30aa\u30d7\u30b7\u30e7\u30f3 +apt.opt.arg.class=\ + +apt.opt.arg.directory=\ + \u30d7\u30ed\u30bb\u30c3\u30b5\u304a\u3088\u3073 javac \u304c\u751f\u6210\u3057\u305f\u30af\u30e9\u30b9\u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u304f\u4f4d\u7f6e\u3092\u6307\u5b9a\u3059\u308b +apt.opt.classpath=\ + \u30e6\u30fc\u30b6\u30af\u30e9\u30b9\u30d5\u30a1\u30a4\u30eb\u304a\u3088\u3073\u6ce8\u91c8\u30d7\u30ed\u30bb\u30c3\u30b5\u30d5\u30a1\u30af\u30c8\u30ea\u3092\u691c\u7d22\u3059\u308b\u4f4d\u7f6e\u3092\u6307\u5b9a\u3059\u308b +apt.opt.d=\ + \u30d7\u30ed\u30bb\u30c3\u30b5\u304a\u3088\u3073 javac \u304c\u751f\u6210\u3057\u305f\u30af\u30e9\u30b9\u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u304f\u4f4d\u7f6e\u3092\u6307\u5b9a\u3059\u308b +apt.opt.factory=\ + \u4f7f\u7528\u3059\u308b AnnotationProcessorFactory \u306e\u540d\u524d\u3002\u30c7\u30d5\u30a9\u30eb\u30c8\u306e\u691c\u51fa\u51e6\u7406\u3092\u30d0\u30a4\u30d1\u30b9 +apt.opt.factorypath=\ + \u6ce8\u91c8\u30d7\u30ed\u30bb\u30c3\u30b5\u30d5\u30a1\u30af\u30c8\u30ea\u306e\u691c\u7d22\u5834\u6240\u3092\u6307\u5b9a\u3059\u308b +apt.opt.s=\ + \u30d7\u30ed\u30bb\u30c3\u30b5\u304c\u751f\u6210\u3057\u305f\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u3092\u7f6e\u304f\u4f4d\u7f6e\u3092\u6307\u5b9a\u3059\u308b +apt.opt.help=\ + \u6a19\u6e96\u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u6982\u8981\u3092\u51fa\u529b\u3059\u308b\u3002\u8a73\u7d30\u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u3064\u3044\u3066\u306f javac -help \u3092\u53c2\u7167 +apt.opt.print=\ + \u6307\u5b9a\u3057\u305f\u578b\u306e\u30c6\u30ad\u30b9\u30c8\u8868\u793a\u3092\u51fa\u529b\u3059\u308b +apt.opt.nocompile=\ + \u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u3092\u30af\u30e9\u30b9\u30d5\u30a1\u30a4\u30eb\u306b\u30b3\u30f3\u30d1\u30a4\u30eb\u3057\u306a\u3044 +apt.opt.proc.flag=\ + [key[=value]] +apt.opt.version=\ + \u30d0\u30fc\u30b8\u30e7\u30f3\u60c5\u5831 +apt.opt.XListAnnotationTypes=\ + \u898b\u3064\u304b\u3063\u305f\u6ce8\u91c8\u578b\u3092\u30ea\u30b9\u30c8\u3059\u308b +apt.opt.XListDeclarations=\ + \u6307\u5b9a\u3055\u308c\u305f\u5ba3\u8a00\u304a\u3088\u3073\u30a4\u30f3\u30af\u30eb\u30fc\u30c9\u3055\u308c\u305f\u5ba3\u8a00\u3092\u30ea\u30b9\u30c8\u3059\u308b +apt.opt.XPrintAptRounds=\ + \u521d\u671f\u304a\u3088\u3073\u518d\u5e30 apt \u5f80\u5fa9\u306b\u3064\u3044\u3066\u306e\u60c5\u5831\u3092\u5370\u5237\u3059\u308b +apt.opt.XPrintFactoryInfo=\ + \u30d5\u30a1\u30af\u30c8\u30ea\u304c\u51e6\u7406\u3092\u4f9d\u983c\u3055\u308c\u308b\u6ce8\u91c8\u306b\u3064\u3044\u3066\u306e\u60c5\u5831\u3092\u5370\u5237\u3059\u308b +apt.opt.XClassesAsDecls=\ + \u30af\u30e9\u30b9\u3068\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u3092\u4e21\u65b9\u3068\u3082\u51e6\u7406\u3059\u308b\u5ba3\u8a00\u3068\u3057\u3066\u51e6\u7406 + +## +## errors +## + +## All errors which do not refer to a particular line in the source code are +## preceded by this string. + +apt.err.error=\ + \u30a8\u30e9\u30fc: + +apt.err.unsupported.source.version=\ + \u30bd\u30fc\u30b9\u30ea\u30ea\u30fc\u30b9 {0} \u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u30ea\u30ea\u30fc\u30b9 5 \u4ee5\u524d\u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044 + +apt.err.unsupported.target.version=\ + \u30bf\u30fc\u30b2\u30c3\u30c8\u30ea\u30ea\u30fc\u30b9 {0} \u306f\u30b5\u30dd\u30fc\u30c8\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002\u30ea\u30ea\u30fc\u30b9 5 \u4ee5\u524d\u3092\u4f7f\u7528\u3057\u3066\u304f\u3060\u3055\u3044 + +apt.err.BadDeclaration=\ + \u6ce8\u91c8\u578b {0} \u7528\u306b\u4f5c\u6210\u3055\u308c\u305f\u7121\u52b9\u306a\u5ba3\u8a00\u3067\u3059\u3002 + +apt.err.CantFindClass=\ + {0} \u306e\u30af\u30e9\u30b9\u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002 + +apt.err.DeclarationCreation=\ + \u6ce8\u91c8\u578b {0} \u7528\u306b\u5ba3\u8a00\u3092\u4f5c\u6210\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 + +# Print an error from the Messager +apt.err.Messager=\ + {0} + +## +## miscellaneous strings +## + +apt.misc.Problem=\ + \u6ce8\u91c8\u306e\u51e6\u7406\u4e2d\u306b\u554f\u984c\u304c\u691c\u51fa\u3055\u308c\u307e\u3057\u305f\u3002\n\u8a73\u7d30\u306b\u3064\u3044\u3066\u306f\u3001\u4e0b\u8a18\u306e\u30b9\u30bf\u30c3\u30af\u30c8\u30ec\u30fc\u30b9\u3092\u53c2\u7167\u3057\u3066\u304f\u3060\u3055\u3044\u3002 + +apt.misc.SunMiscService=\ + \u6ce8\u91c8\u30d7\u30ed\u30bb\u30c3\u30b5\u30d5\u30a1\u30af\u30c8\u30ea\u306e\u691c\u7d22\u30a8\u30e9\u30fc\u3067\u3059\u3002\nMETA-INF/services \u5185\u306e\u60c5\u5831\u3092\u78ba\u8a8d\u3057\u3066\u304f\u3060\u3055\u3044\u3002 + +# Print a notice from the Messager +apt.note.Messager=\ + {0} + +## +## warnings +## + +## All warning messages are preceded by the following string. +apt.warn.warning=\ + \u8b66\u544a: + +apt.warn.AnnotationsWithoutProcessors=\ + \u30d7\u30ed\u30bb\u30c3\u30b5\u306a\u3057\u306e\u6ce8\u91c8\u578b\u3067\u3059: {0} + +apt.warn.BadFactory=\ + \u6ce8\u91c8\u30d7\u30ed\u30bb\u30c3\u30b5\u30d5\u30a1\u30af\u30c8\u30ea\u304c\u7121\u52b9\u3067\u3059: {0} + +apt.warn.BadParentDirectory=\ + {0} \u306e\u3044\u304f\u3064\u304b\u306e\u89aa\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u306e\u4f5c\u6210\u306b\u5931\u6557\u3057\u307e\u3057\u305f + +apt.warn.FactoryCantInstantiate=\ + \u30d5\u30a1\u30af\u30c8\u30ea ''{0}'' \u306e\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u3092\u30a4\u30f3\u30b9\u30bf\u30f3\u30b9\u5316\u3067\u304d\u307e\u305b\u3093\u3067\u3057\u305f\u3002 + +apt.warn.FactoryWrongType=\ + \u6307\u5b9a\u3057\u305f\u30d5\u30a1\u30af\u30c8\u30ea ''{0}'' \u306f AnnotationProcessorFactory \u3067\u306f\u3042\u308a\u307e\u305b\u3093\u3002 + +apt.warn.FactoryNotFound=\ + \u6307\u5b9a\u3057\u305f AnnotationProcessorFactory ''{0}'' \u306f\u691c\u7d22\u30d1\u30b9\u3067\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u3002 + +apt.warn.FileReopening=\ + ''{0}'' \u3092\u8907\u6570\u56de\u4f5c\u6210\u3057\u3088\u3046\u3068\u3057\u3066\u3044\u307e\u3059\u3002 + +apt.warn.IllegalFileName=\ + \u7121\u52b9\u306a\u540d\u524d ''{0}'' \u306e\u30d5\u30a1\u30a4\u30eb\u306f\u4f5c\u6210\u3067\u304d\u307e\u305b\u3093\u3002 + +apt.warn.MalformedSupportedString=\ + \u30d5\u30a1\u30af\u30c8\u30ea\u304c\u8fd4\u3057\u305f\u6ce8\u91c8\u30b5\u30dd\u30fc\u30c8 ''{0}'' \u306e\u6587\u5b57\u5217\u304c\u4e0d\u6b63\u3067\u3059\u3002 + +apt.warn.NoNewFilesAfterRound=\ + \u5f80\u5fa9\u306e\u7d42\u4e86\u5f8c\u306b\u30d5\u30a1\u30a4\u30eb ''{0}'' \u3092\u4f5c\u6210\u3059\u308b\u3053\u3068\u306f\u3067\u304d\u307e\u305b\u3093\u3002 + +# Print a warning from the Messager +apt.warn.Messager=\ + {0} + +apt.warn.NoAnnotationProcessors=\ + \u6ce8\u91c8\u30d7\u30ed\u30bb\u30c3\u30b5\u306f\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3067\u3057\u305f\u304c\u3001\u6ce8\u91c8\u306f\u5b58\u5728\u3057\u307e\u3059\u3002 + +apt.warn.NullProcessor=\ + \u30d5\u30a1\u30af\u30c8\u30ea {0} \u304c\u6ce8\u91c8\u30d7\u30ed\u30bb\u30c3\u30b5\u306b null \u3092\u8fd4\u3057\u307e\u3057\u305f\u3002 + +apt.warn.CorrespondingClassFile=\ + \u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb ''{0}'' \u306b\u5bfe\u5fdc\u3059\u308b\u30af\u30e9\u30b9\u30d5\u30a1\u30a4\u30eb\u306f\u3059\u3067\u306b\u4f5c\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002 + +apt.warn.CorrespondingSourceFile=\ + \u30af\u30e9\u30b9\u30d5\u30a1\u30a4\u30eb ''{0}'' \u306b\u5bfe\u5fdc\u3059\u308b\u30bd\u30fc\u30b9\u30d5\u30a1\u30a4\u30eb\u306f\u3059\u3067\u306b\u4f5c\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002 diff --git a/langtools/src/share/classes/com/sun/tools/apt/resources/apt_zh_CN.properties b/langtools/src/share/classes/com/sun/tools/apt/resources/apt_zh_CN.properties new file mode 100644 index 00000000000..1443397b94d --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/resources/apt_zh_CN.properties @@ -0,0 +1,176 @@ +# +# Copyright 2005-2006 Sun Microsystems, Inc. All Rights Reserved. +# DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. +# +# This code is free software; you can redistribute it and/or modify it +# under the terms of the GNU General Public License version 2 only, as +# published by the Free Software Foundation. Sun designates this +# particular file as subject to the "Classpath" exception as provided +# by Sun in the LICENSE file that accompanied this code. +# +# This code is distributed in the hope that it will be useful, but WITHOUT +# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or +# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License +# version 2 for more details (a copy is included in the LICENSE file that +# accompanied this code). +# +# You should have received a copy of the GNU General Public License version +# 2 along with this work; if not, write to the Free Software Foundation, +# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. +# +# Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, +# CA 95054 USA or visit www.sun.com if you need additional information or +# have any questions. +# + +apt.msg.usage.header=\ +\u7528\u6cd5\uff1a{0} <\u6e90\u6587\u4ef6>\n\ +\u5176\u4e2d\uff0capt \u9009\u9879\u5305\u62ec\uff1a + +apt.msg.usage.footer=\ +\u6709\u5173 javac \u9009\u9879\u7684\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1 javac -help\u3002 + +apt.msg.usage.nonstandard.footer=\ +\u8fd9\u4e9b\u9009\u9879\u53ca\u5176\u8f93\u51fa\u683c\u5f0f\u90fd\u4e0d\u662f\u6807\u51c6\u7684\uff0c\n\u5982\u6709\u66f4\u6539\uff0c\u6055\u4e0d\u53e6\u884c\u901a\u77e5\u3002 + +apt.msg.bug=\ +apt ({0}) \u4e2d\u51fa\u73b0\u5f02\u5e38\u3002 \ +\u5982\u679c\u5728 Bug Parade \u4e2d\u6ca1\u6709\u627e\u5230\u8be5\u9519\u8bef\uff0c\u8bf7\u5728 Java Developer Connection (http://java.sun.com/webapps/bugreport) \ +\u5bf9\u8be5\u9519\u8bef\u8fdb\u884c\u5f52\u6863\u3002 \ +\u8bf7\u5728\u62a5\u544a\u4e2d\u9644\u4e0a\u60a8\u7684\u7a0b\u5e8f\u548c\u4ee5\u4e0b\u8bca\u65ad\u4fe1\u606f\u3002\u8c22\u8c22\u60a8\u7684\u5408\u4f5c\u3002 + +## apt options + +apt.opt.A=\ +\u4f20\u9012\u7ed9\u6ce8\u91ca\u5904\u7406\u5668\u7684\u9009\u9879 +apt.opt.arg.class=\ +<\u7c7b> +apt.opt.arg.directory=\ +\u6307\u5b9a\u5b58\u653e\u5904\u7406\u5668\u548c javac \u751f\u6210\u7684\u7c7b\u6587\u4ef6\u7684\u4f4d\u7f6e +apt.opt.classpath=\ +\u6307\u5b9a\u67e5\u627e\u7528\u6237\u7c7b\u6587\u4ef6\u548c\u6ce8\u91ca\u5904\u7406\u5668\u5de5\u5382\u7684\u4f4d\u7f6e +apt.opt.d=\ +\u6307\u5b9a\u5b58\u653e\u5904\u7406\u5668\u548c javac \u751f\u6210\u7684\u7c7b\u6587\u4ef6\u7684\u4f4d\u7f6e +apt.opt.factory=\ +\u8981\u4f7f\u7528\u7684 AnnotationProcessorFactory \u7684\u540d\u79f0\uff1b\u7ed5\u8fc7\u9ed8\u8ba4\u7684\u641c\u7d22\u8fdb\u7a0b +apt.opt.factorypath=\ +\u6307\u5b9a\u67e5\u627e\u6ce8\u91ca\u5904\u7406\u5668\u5de5\u5382\u7684\u4f4d\u7f6e +apt.opt.s=\ +\u6307\u5b9a\u5b58\u653e\u5904\u7406\u5668\u751f\u6210\u7684\u6e90\u6587\u4ef6\u7684\u4f4d\u7f6e +apt.opt.help=\ +\u8f93\u51fa\u6807\u51c6\u9009\u9879\u7684\u63d0\u8981\uff1b\u4f7f\u7528 javac -help \u53ef\u4ee5\u5f97\u5230\u66f4\u591a\u9009\u9879 +apt.opt.print=\ +\u8f93\u51fa\u6307\u5b9a\u7c7b\u578b\u7684\u6587\u672c\u8868\u793a +apt.opt.nocompile=\ +\u8bf7\u52ff\u5c06\u6e90\u6587\u4ef6\u7f16\u8bd1\u4e3a\u7c7b\u6587\u4ef6 +apt.opt.proc.flag=\ +[\u5173\u952e\u5b57[=\u503c]] +apt.opt.version=\ +\u7248\u672c\u4fe1\u606f +apt.opt.XListAnnotationTypes=\ +\u5217\u51fa\u627e\u5230\u7684\u6ce8\u91ca\u7c7b\u578b +apt.opt.XListDeclarations=\ +\u5217\u51fa\u6307\u5b9a\u548c\u5305\u542b\u7684\u58f0\u660e +apt.opt.XPrintAptRounds=\ +\u8f93\u51fa\u6709\u5173\u521d\u59cb\u548c\u9012\u5f52 apt \u5faa\u73af\u7684\u4fe1\u606f +apt.opt.XPrintFactoryInfo=\ +\u8f93\u51fa\u6709\u5173\u8bf7\u6c42\u5de5\u5382\u5904\u7406\u54ea\u4e9b\u6ce8\u91ca\u7684\u4fe1\u606f +apt.opt.XClassesAsDecls=\ +\u5c06\u7c7b\u6587\u4ef6\u548c\u6e90\u6587\u4ef6\u90fd\u89c6\u4e3a\u8981\u5904\u7406\u7684\u58f0\u660e + +## +## errors +## + +## All errors which do not refer to a particular line in the source code are +## preceded by this string. + +apt.err.error=\ +\u9519\u8bef\uff1a + +apt.err.unsupported.source.version=\ + \u4e0d\u652f\u6301\u6e90\u7248\u672c {0}\uff1b\u8bf7\u4f7f\u7528\u7248\u672c 5 \u6216\u65e9\u671f\u7248\u672c + +apt.err.unsupported.target.version=\ + \u4e0d\u652f\u6301\u76ee\u6807\u7248\u672c {0}\uff1b\u8bf7\u4f7f\u7528\u7248\u672c 5 \u6216\u65e9\u671f\u7248\u672c + +apt.err.BadDeclaration=\ +\u4e3a\u6ce8\u91ca\u7c7b\u578b {0} \u521b\u5efa\u7684\u58f0\u660e\u51fa\u73b0\u9519\u8bef + +apt.err.CantFindClass=\ +\u627e\u4e0d\u5230 {0} \u7684\u7c7b\u6587\u4ef6 + +apt.err.DeclarationCreation=\ +\u65e0\u6cd5\u4e3a\u6ce8\u91ca\u7c7b\u578b {0} \u521b\u5efa\u58f0\u660e + +# Print an error from the Messager +apt.err.Messager=\ + {0} + +## +## miscellaneous strings +## + +apt.misc.Problem=\ +\u6ce8\u91ca\u5904\u7406\u8fc7\u7a0b\u4e2d\u9047\u5230\u95ee\u9898\uff1b\n\u6709\u5173\u66f4\u591a\u4fe1\u606f\uff0c\u8bf7\u53c2\u89c1\u4e0b\u9762\u7684\u5806\u6808\u8ffd\u8e2a\u3002 + +apt.misc.SunMiscService=\ +\u67e5\u627e\u6ce8\u91ca\u5904\u7406\u5668\u5de5\u5382\u65f6\u51fa\u9519\uff1b\n\u8bf7\u67e5\u770b META-INF/\u670d\u52a1\u4fe1\u606f\u3002 + +# Print a notice from the Messager +apt.note.Messager=\ + {0} + +## +## warnings +## + +## All warning messages are preceded by the following string. +apt.warn.warning=\ +\u8b66\u544a\uff1a + +apt.warn.AnnotationsWithoutProcessors=\ +\u4e0d\u5e26\u5904\u7406\u5668\u7684\u6ce8\u91ca\u7c7b\u578b\uff1a {0} + +apt.warn.BadFactory=\ +\u6ce8\u91ca\u5904\u7406\u5668\u5de5\u5382\u51fa\u73b0\u9519\u8bef\uff1a {0} + +apt.warn.BadParentDirectory=\ +\u65e0\u6cd5\u521b\u5efa {0} \u7684\u67d0\u4e9b\u7236\u76ee\u5f55 + +apt.warn.FactoryCantInstantiate=\ +\u65e0\u6cd5\u5b9e\u4f8b\u5316\u5de5\u5382 "{0}" \u7684\u5b9e\u4f8b\u3002 + +apt.warn.FactoryWrongType=\ +\u6307\u5b9a\u7684\u5de5\u5382 "{0}" \u4e0d\u662f AnnotationProcessorFactory\u3002 + +apt.warn.FactoryNotFound=\ +\u5728\u641c\u7d22\u8def\u5f84\u4e2d\u627e\u4e0d\u5230\u6307\u5b9a\u7684 AnnotationProcessorFactory "{0}"\u3002 + +apt.warn.FileReopening=\ +\u5c1d\u8bd5\u591a\u6b21\u521b\u5efa "{0}" + +apt.warn.IllegalFileName=\ +\u65e0\u6cd5\u521b\u5efa\u5e26\u6709\u975e\u6cd5\u540d\u79f0 "{0}" \u7684\u6587\u4ef6\u3002 + +apt.warn.MalformedSupportedString=\ +\u5de5\u5382\u8fd4\u56de\u4e0d\u89c4\u5219\u7684\u6ce8\u91ca\u652f\u6301\u5b57\u7b26\u4e32 "{0}"\u3002 + +apt.warn.NoNewFilesAfterRound=\ +\u5faa\u73af\u7ed3\u675f\u540e\u65e0\u6cd5\u521b\u5efa\u6587\u4ef6 "{0}"\u3002 + +# Print a warning from the Messager +apt.warn.Messager=\ + {0} + +apt.warn.NoAnnotationProcessors=\ +\u672a\u627e\u5230\u6ce8\u91ca\u5904\u7406\u5668\uff0c\u4f46\u5b58\u5728\u6ce8\u91ca\u3002 + +apt.warn.NullProcessor=\ +\u5bf9\u4e8e\u67d0\u4e2a\u6ce8\u91ca\u5904\u7406\u5668\uff0c\u5de5\u5382 {0} \u8fd4\u56de\u7684\u503c\u4e3a null\u3002 + +apt.warn.CorrespondingClassFile=\ +\u5df2\u521b\u5efa\u4e0e\u6e90\u6587\u4ef6 "{0}" \u76f8\u5bf9\u5e94\u7684\u7c7b\u6587\u4ef6\u3002 + +apt.warn.CorrespondingSourceFile=\ +\u5df2\u521b\u5efa\u4e0e\u7c7b\u6587\u4ef6 "{0}" \u76f8\u5bf9\u5e94\u7684\u6e90\u6587\u4ef6\u3002 diff --git a/langtools/src/share/classes/com/sun/tools/apt/util/Bark.java b/langtools/src/share/classes/com/sun/tools/apt/util/Bark.java new file mode 100644 index 00000000000..14dfa83633f --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/apt/util/Bark.java @@ -0,0 +1,174 @@ +/* + * Copyright 2004-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.apt.util; + +import com.sun.tools.javac.util.Context; +import com.sun.tools.javac.util.JCDiagnostic; +import com.sun.tools.javac.util.JCDiagnostic.SimpleDiagnosticPosition; +import com.sun.tools.javac.util.Log; +import com.sun.tools.javac.util.Messages; +import com.sun.tools.javac.util.Position; + +/** A subtype of Log for use in APT. + * + *

This is NOT part of any API supported by Sun Microsystems. If + * you write code that depends on this, you do so at your own risk. + * This code and its internal interfaces are subject to change or + * deletion without notice. + */ +public class Bark extends Log { + /** The context key for the bark. */ + protected static final Context.Key barkKey = + new Context.Key(); + + /** + * Preregisters factories to create and use a Bark object for use as + * both a Log and a Bark. + */ + public static void preRegister(final Context context) { + context.put(barkKey, new Context.Factory() { + public Bark make() { + return new Bark(context); + } + }); + context.put(Log.logKey, new Context.Factory() { + public Log make() { + return Bark.instance(context); + } + }); + } + + /** Get the Bark instance for this context. */ + public static Bark instance(Context context) { + Bark instance = context.get(barkKey); + if (instance == null) + instance = new Bark(context); + return instance; + } + + /** Specifies whether or not to ignore any diagnostics that are reported. + */ + private boolean ignoreDiagnostics; + + /** + * Factory for APT-specific diagnostics. + */ + private JCDiagnostic.Factory aptDiags; + + + /** + * Creates a Bark. + */ + protected Bark(Context context) { + super(context); // will register this object in context with Log.logKey + context.put(barkKey, this); + + // register additional resource bundle for APT messages. + Messages aptMessages = new Messages(Messages.getDefaultBundle()); + aptMessages.add("com.sun.tools.apt.resources.apt"); + aptDiags = new JCDiagnostic.Factory(aptMessages, "apt"); + + multipleErrors = true; + } + + /** + * Sets a flag indicating whether or not to ignore all diagnostics. + * When ignored, they are not reported to the output writers, not are they + * counted in the various counters. + * @param b If true, subsequent diagnostics will be ignored. + * @return the previous state of the flag + */ + public boolean setDiagnosticsIgnored(boolean b) { + boolean prev = ignoreDiagnostics; + ignoreDiagnostics = b; + return prev; + } + + /** + * Report a diagnostic if they are not currently being ignored. + */ + @Override + public void report(JCDiagnostic diagnostic) { + if (ignoreDiagnostics) + return; + + super.report(diagnostic); + } + + /** Report an error. + * @param key The key for the localized error message. + * @param args Fields of the error message. + */ + public void aptError(String key, Object... args) { + aptError(Position.NOPOS, key, args); + } + + /** Report an error, unless another error was already reported at same + * source position. + * @param pos The source position at which to report the error. + * @param key The key for the localized error message. + * @param args Fields of the error message. + */ + public void aptError(int pos, String key, Object ... args) { + report(aptDiags.error(source, new SimpleDiagnosticPosition(pos), key, args)); + } + + /** Report a warning, unless suppressed by the -nowarn option or the + * maximum number of warnings has been reached. + * @param key The key for the localized warning message. + * @param args Fields of the warning message. + */ + public void aptWarning(String key, Object... args) { + aptWarning(Position.NOPOS, key, args); + } + + /** Report a warning, unless suppressed by the -nowarn option or the + * maximum number of warnings has been reached. + * @param pos The source position at which to report the warning. + * @param key The key for the localized warning message. + * @param args Fields of the warning message. + */ + public void aptWarning(int pos, String key, Object ... args) { + report(aptDiags.warning(source, new SimpleDiagnosticPosition(pos), key, args)); + } + + /** Report a note, unless suppressed by the -nowarn option. + * @param key The key for the localized note message. + * @param args Fields of the note message. + */ + public void aptNote(String key, Object... args) { + aptNote(Position.NOPOS, key, args); + } + + /** Report a note, unless suppressed by the -nowarn option. + * @param pos The source position at which to report the note. + * @param key The key for the localized note message. + * @param args Fields of the note message. + */ + public void aptNote(int pos, String key, Object ... args) { + report(aptDiags.note(source, new SimpleDiagnosticPosition(pos), key, args)); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/Taglet.java b/langtools/src/share/classes/com/sun/tools/doclets/Taglet.java new file mode 100644 index 00000000000..4ab0d91dc89 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/Taglet.java @@ -0,0 +1,157 @@ +/* + * Copyright 2001-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets; + +import com.sun.javadoc.*; + +/** + * The interface for a custom tag used by Doclets. A custom + * tag must implement this interface. To be loaded and used by + * doclets at run-time, the taglet must have a static method called + * register that accepts a {@link java.util.Map} as an + * argument with the following signature: + *

+ *   public void register(Map map)
+ * 
+ * This method should add an instance of the custom taglet to the map + * with the name of the taglet as the key. If overriding a taglet, + * to avoid a name conflict, the overridden taglet must be deleted from + * the map before an instance of the new taglet is added to the map. + *

+ * It is recommended that the taglet throw an exception when it fails + * to register itself. The exception that it throws is up to the user. + *

+ * Here are two sample taglets:
+ *

+ *

+ * For more information on how to create your own Taglets, please see the + * Taglet Overview. + * + * @since 1.4 + * @author Jamie Ho + */ + +public interface Taglet { + + /** + * Return true if this Taglet + * is used in field documentation. Set to + * false for inline tags. + * @return true if this Taglet + * is used in field documentation and false + * otherwise. + */ + public abstract boolean inField(); + + /** + * Return true if this Taglet + * is used in constructor documentation. Set to + * false for inline tags. + * @return true if this Taglet + * is used in constructor documentation and false + * otherwise. + */ + public abstract boolean inConstructor(); + + /** + * Return true if this Taglet + * is used in method documentation. Set to + * false for inline tags. + * @return true if this Taglet + * is used in method documentation and false + * otherwise. + */ + public abstract boolean inMethod(); + + /** + * Return true if this Taglet + * is used in overview documentation. Set to + * false for inline tags. + * @return true if this Taglet + * is used in method documentation and false + * otherwise. + */ + public abstract boolean inOverview(); + + /** + * Return true if this Taglet + * is used in package documentation. Set to + * false for inline tags. + * @return true if this Taglet + * is used in package documentation and false + * otherwise. + */ + public abstract boolean inPackage(); + + /** + * Return true if this Taglet + * is used in type documentation (classes or + * interfaces). Set to false for inline tags. + * @return true if this Taglet + * is used in type documentation and false + * otherwise. + */ + public abstract boolean inType(); + + /** + * Return true if this Taglet + * is an inline tag. Return false otherwise. + * @return true if this Taglet + * is an inline tag and false otherwise. + */ + public abstract boolean isInlineTag(); + + /** + * Return the name of this custom tag. + * @return the name of this custom tag. + */ + public abstract String getName(); + + /** + * Given the Tag representation of this custom + * tag, return its string representation, which is output + * to the generated page. + * @param tag the Tag representation of this custom tag. + * @return the string representation of this Tag. + */ + public abstract String toString(Tag tag); + + /** + * Given an array of Tags representing this custom + * tag, return its string representation, which is output + * to the generated page. This method should + * return null if this taglet represents an inline tag. + * @param tags the array of Tags representing of this custom tag. + * @return the string representation of this Tag. + */ + public abstract String toString(Tag[] tags); + +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java new file mode 100644 index 00000000000..1ce66f77117 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractExecutableMemberWriter.java @@ -0,0 +1,250 @@ +/* + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.javadoc.*; + +/** + * Print method and constructor info. + * + * @author Robert Field + * @author Atul M Dambalkar + */ +public abstract class AbstractExecutableMemberWriter extends AbstractMemberWriter { + + public AbstractExecutableMemberWriter(SubWriterHolderWriter writer, + ClassDoc classdoc) { + super(writer, classdoc); + } + + public AbstractExecutableMemberWriter(SubWriterHolderWriter writer) { + super(writer); + } + + /** + * Write the type parameters for the executable member. + * + * @param member the member to write type parameters for. + * @return the display length required to write this information. + */ + protected int writeTypeParameters(ExecutableMemberDoc member) { + LinkInfoImpl linkInfo = new LinkInfoImpl( + LinkInfoImpl.CONTEXT_MEMBER_TYPE_PARAMS, member, false); + String typeParameters = writer.getTypeParameterLinks(linkInfo); + if (linkInfo.displayLength > 0) { + writer.print(typeParameters + " "); + writer.displayLength += linkInfo.displayLength + 1; + } + return linkInfo.displayLength; + } + + protected void writeSignature(ExecutableMemberDoc member) { + writer.displayLength = 0; + writer.pre(); + writer.writeAnnotationInfo(member); + printModifiers(member); + writeTypeParameters(member); + if (configuration().linksource && + member.position().line() != classdoc.position().line()) { + writer.printSrcLink(member, member.name()); + } else { + bold(member.name()); + } + writeParameters(member); + writeExceptions(member); + writer.preEnd(); + } + + protected void writeDeprecatedLink(ProgramElementDoc member) { + ExecutableMemberDoc emd = (ExecutableMemberDoc)member; + writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER, (MemberDoc) emd, + emd.qualifiedName() + emd.flatSignature(), false); + } + + protected void writeSummaryLink(int context, ClassDoc cd, ProgramElementDoc member) { + ExecutableMemberDoc emd = (ExecutableMemberDoc)member; + String name = emd.name(); + writer.bold(); + writer.printDocLink(context, cd, (MemberDoc) emd, + name, false); + writer.boldEnd(); + writer.displayLength = name.length(); + writeParameters(emd, false); + } + + protected void writeInheritedSummaryLink(ClassDoc cd, + ProgramElementDoc member) { + writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER, cd, (MemberDoc) member, + member.name(), false); + } + + protected void writeParam(ExecutableMemberDoc member, Parameter param, + boolean isVarArg) { + if (param.type() != null) { + writer.printLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_EXECUTABLE_MEMBER_PARAM, param.type(), + isVarArg)); + } + if(param.name().length() > 0) { + writer.space(); + writer.print(param.name()); + } + } + + protected void writeParameters(ExecutableMemberDoc member) { + writeParameters(member, true); + } + + protected void writeParameters(ExecutableMemberDoc member, + boolean includeAnnotations) { + print('('); + Parameter[] params = member.parameters(); + String indent = makeSpace(writer.displayLength); + if (configuration().linksource) { + //add spaces to offset indentation changes caused by link. + indent+= makeSpace(member.name().length()); + } + int paramstart; + for (paramstart = 0; paramstart < params.length; paramstart++) { + Parameter param = params[paramstart]; + if (!param.name().startsWith("this$")) { + if (includeAnnotations) { + boolean foundAnnotations = + writer.writeAnnotationInfo(indent.length(), member, param); + if (foundAnnotations) { + writer.println(); + writer.print(indent); + } + } + writeParam(member, param, + (paramstart == params.length - 1) && member.isVarArgs()); + break; + } + } + + for (int i = paramstart + 1; i < params.length; i++) { + writer.print(','); + writer.println(); + writer.print(indent); + if (includeAnnotations) { + boolean foundAnnotations = + writer.writeAnnotationInfo(indent.length(), member, params[i]); + if (foundAnnotations) { + writer.println(); + writer.print(indent); + } + } + writeParam(member, params[i], (i == params.length - 1) && member.isVarArgs()); + } + writer.print(')'); + } + + protected void writeExceptions(ExecutableMemberDoc member) { + Type[] exceptions = member.thrownExceptionTypes(); + if(exceptions.length > 0) { + LinkInfoImpl memberTypeParam = new LinkInfoImpl( + LinkInfoImpl.CONTEXT_MEMBER, member, false); + int retlen = getReturnTypeLength(member); + writer.getTypeParameterLinks(memberTypeParam); + retlen += memberTypeParam.displayLength == 0 ? + 0 : memberTypeParam.displayLength + 1; + String indent = makeSpace(modifierString(member).length() + + member.name().length() + retlen - 4); + writer.println(); + writer.print(indent); + writer.print("throws "); + indent += " "; + writer.printLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_MEMBER, exceptions[0])); + for(int i = 1; i < exceptions.length; i++) { + writer.println(","); + writer.print(indent); + writer.printLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_MEMBER, exceptions[i])); + } + } + } + + protected int getReturnTypeLength(ExecutableMemberDoc member) { + if (member instanceof MethodDoc) { + MethodDoc method = (MethodDoc)member; + Type rettype = method.returnType(); + if (rettype.isPrimitive()) { + return rettype.typeName().length() + + rettype.dimension().length(); + } else { + LinkInfoImpl linkInfo = new LinkInfoImpl( + LinkInfoImpl.CONTEXT_MEMBER, rettype); + writer.getLink(linkInfo); + return linkInfo.displayLength; + } + } else { // it's a constructordoc + return -1; + } + } + + protected ClassDoc implementsMethodInIntfac(MethodDoc method, + ClassDoc[] intfacs) { + for (int i = 0; i < intfacs.length; i++) { + MethodDoc[] methods = intfacs[i].methods(); + if (methods.length > 0) { + for (int j = 0; j < methods.length; j++) { + if (methods[j].name().equals(method.name()) && + methods[j].signature().equals(method.signature())) { + return intfacs[i]; + } + } + } + } + return null; + } + + /** + * For backward compatibility, include an anchor using the erasures of the + * parameters. NOTE: We won't need this method anymore after we fix + * see tags so that they use the type instead of the erasure. + * + * @param emd the ExecutableMemberDoc to anchor to. + * @return the 1.4.x style anchor for the ExecutableMemberDoc. + */ + protected String getErasureAnchor(ExecutableMemberDoc emd) { + StringBuffer buf = new StringBuffer(emd.name() + "("); + Parameter[] params = emd.parameters(); + boolean foundTypeVariable = false; + for (int i = 0; i < params.length; i++) { + if (i > 0) { + buf.append(","); + } + Type t = params[i].type(); + foundTypeVariable = foundTypeVariable || t.asTypeVariable() != null; + buf.append(t.isPrimitive() ? + t.typeName() : t.asClassDoc().qualifiedName()); + buf.append(t.dimension()); + } + buf.append(")"); + return foundTypeVariable ? buf.toString() : null; + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java new file mode 100644 index 00000000000..84a1d70d596 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractIndexWriter.java @@ -0,0 +1,242 @@ +/* + * Copyright 1998-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.util.*; + +import com.sun.javadoc.*; +import java.io.*; +import java.util.*; + +/** + * Generate Index for all the Member Names with Indexing in + * Unicode Order. This class is a base class for {@link SingleIndexWriter} and + * {@link SplitIndexWriter}. It uses the functionality from + * {@link HtmlDocletWriter} to generate the Index Contents. + * + * @see IndexBuilder + * @author Atul M Dambalkar + */ +public class AbstractIndexWriter extends HtmlDocletWriter { + + /** + * The index of all the members with unicode character. + */ + protected IndexBuilder indexbuilder; + + /** + * This constructor will be used by {@link SplitIndexWriter}. Initialises + * path to this file and relative path from this file. + * + * @param path Path to the file which is getting generated. + * @param filename Name of the file which is getting genrated. + * @param relpath Relative path from this file to the current directory. + * @param indexbuilder Unicode based Index from {@link IndexBuilder} + */ + protected AbstractIndexWriter(ConfigurationImpl configuration, + String path, String filename, + String relpath, IndexBuilder indexbuilder) + throws IOException { + super(configuration, path, filename, relpath); + this.indexbuilder = indexbuilder; + } + + /** + * This Constructor will be used by {@link SingleIndexWriter}. + * + * @param filename Name of the file which is getting genrated. + * @param indexbuilder Unicode based Index form {@link IndexBuilder} + */ + protected AbstractIndexWriter(ConfigurationImpl configuration, + String filename, IndexBuilder indexbuilder) + throws IOException { + super(configuration, filename); + this.indexbuilder = indexbuilder; + } + + /** + * Print the text "Index" in bold format in the navigation bar. + */ + protected void navLinkIndex() { + navCellRevStart(); + fontStyle("NavBarFont1Rev"); + boldText("doclet.Index"); + fontEnd(); + navCellEnd(); + } + + /** + * Generate the member information for the unicode character along with the + * list of the members. + * + * @param unicode Unicode for which member list information to be generated. + * @param memberlist List of members for the unicode character. + */ + protected void generateContents(Character unicode, List memberlist) { + anchor("_" + unicode + "_"); + h2(); + bold(unicode.toString()); + h2End(); + dl(); + for (int i = 0; i < memberlist.size(); i++) { + Doc element = (Doc)memberlist.get(i); + if (element instanceof MemberDoc) { + printDescription((MemberDoc)element); + } else if (element instanceof ClassDoc) { + printDescription((ClassDoc)element); + } else if (element instanceof PackageDoc) { + printDescription((PackageDoc)element); + } + } + dlEnd(); + hr(); + } + + + /** + * Print one line summary comment for the package. + * + * @param pkg PackageDoc passed. + */ + protected void printDescription(PackageDoc pkg) { + dt(); + printPackageLink(pkg, Util.getPackageName(pkg), true); + print(" - "); + print(configuration.getText("doclet.package") + " " + pkg.name()); + dd(); + printSummaryComment(pkg); + } + + /** + * Print one line summary comment for the class. + * + * @param cd ClassDoc passed. + */ + protected void printDescription(ClassDoc cd) { + dt(); + printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_INDEX, cd, true)); + print(" - "); + printClassInfo(cd); + dd(); + printComment(cd); + } + + /** + * Print the classkind(class, interface, exception, error of the class + * passed. + * + * @param cd ClassDoc. + */ + protected void printClassInfo(ClassDoc cd) { + print(configuration.getText("doclet.in", + Util.getTypeName(configuration, cd, false), + getPackageLink(cd.containingPackage(), + Util.getPackageName(cd.containingPackage()), false))); + } + + + /** + * Generate Description for Class, Field, Method or Constructor. + * for Java.* Packages Class Members. + * + * @param member MemberDoc for the member of the Class Kind. + * @see com.sun.javadoc.MemberDoc + */ + protected void printDescription(MemberDoc member) { + String name = (member instanceof ExecutableMemberDoc)? + member.name() + ((ExecutableMemberDoc)member).flatSignature() : + member.name(); + if (name.indexOf("<") != -1 || name.indexOf(">") != -1) { + name = Util.escapeHtmlChars(name); + } + ClassDoc containing = member.containingClass(); + dt(); + printDocLink(LinkInfoImpl.CONTEXT_INDEX, member, name, true); + println(" - "); + printMemberDesc(member); + println(); + dd(); + printComment(member); + println(); + } + + + /** + * Print comment for each element in the index. If the element is deprecated + * and it has a @deprecated tag, use that comment. Else if the containing + * class for this element is deprecated, then add the word "Deprecated." at + * the start and then print the normal comment. + * + * @param element Index element. + */ + protected void printComment(ProgramElementDoc element) { + Tag[] tags; + if (Util.isDeprecated(element)) { + boldText("doclet.Deprecated"); space(); + if ((tags = element.tags("deprecated")).length > 0) + printInlineDeprecatedComment(element, tags[0]); + } else { + ClassDoc cont = element.containingClass(); + while (cont != null) { + if (Util.isDeprecated(cont)) { + boldText("doclet.Deprecated"); space(); + break; + } + cont = cont.containingClass(); + } + printSummaryComment(element); + } + } + + /** + * Print description about the Static Varible/Method/Constructor for a + * member. + * + * @param member MemberDoc for the member within the Class Kind. + * @see com.sun.javadoc.MemberDoc + */ + protected void printMemberDesc(MemberDoc member) { + ClassDoc containing = member.containingClass(); + String classdesc = Util.getTypeName(configuration, containing, true) + " " + + getPreQualifiedClassLink(LinkInfoImpl.CONTEXT_INDEX, containing, + false); + if (member.isField()) { + if (member.isStatic()) { + printText("doclet.Static_variable_in", classdesc); + } else { + printText("doclet.Variable_in", classdesc); + } + } else if (member.isConstructor()) { + printText("doclet.Constructor_for", classdesc); + } else if (member.isMethod()) { + if (member.isStatic()) { + printText("doclet.Static_method_in", classdesc); + } else { + printText("doclet.Method_in", classdesc); + } + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java new file mode 100644 index 00000000000..0bbb6e4b392 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java @@ -0,0 +1,427 @@ +/* + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.taglets.*; + +import com.sun.javadoc.*; +import java.util.*; +import java.lang.reflect.Modifier; + +/** + * The base class for member writers. + * + * @author Robert Field + * @author Atul M Dambalkar + * @author Jamie Ho (Re-write) + */ +public abstract class AbstractMemberWriter { + + protected boolean printedSummaryHeader = false; + protected final SubWriterHolderWriter writer; + protected final ClassDoc classdoc; + public final boolean nodepr; + + public AbstractMemberWriter(SubWriterHolderWriter writer, + ClassDoc classdoc) { + this.writer = writer; + this.nodepr = configuration().nodeprecated; + this.classdoc = classdoc; + } + + public AbstractMemberWriter(SubWriterHolderWriter writer) { + this(writer, null); + } + + /*** abstracts ***/ + + public abstract void printSummaryLabel(ClassDoc cd); + + public abstract void printInheritedSummaryLabel(ClassDoc cd); + + public abstract void printSummaryAnchor(ClassDoc cd); + + public abstract void printInheritedSummaryAnchor(ClassDoc cd); + + protected abstract void printSummaryType(ProgramElementDoc member); + + protected void writeSummaryLink(ClassDoc cd, ProgramElementDoc member) { + writeSummaryLink(LinkInfoImpl.CONTEXT_MEMBER, cd, member); + } + + protected abstract void writeSummaryLink(int context, + ClassDoc cd, + ProgramElementDoc member); + + protected abstract void writeInheritedSummaryLink(ClassDoc cd, + ProgramElementDoc member); + + protected abstract void writeDeprecatedLink(ProgramElementDoc member); + + protected abstract void printNavSummaryLink(ClassDoc cd, boolean link); + + protected abstract void printNavDetailLink(boolean link); + + /*** ***/ + + protected void print(String str) { + writer.print(str); + writer.displayLength += str.length(); + } + + protected void print(char ch) { + writer.print(ch); + writer.displayLength++; + } + + protected void bold(String str) { + writer.bold(str); + writer.displayLength += str.length(); + } + + /** + * Return a string describing the access modifier flags. + * Don't include native or synchronized. + * + * The modifier names are returned in canonical order, as + * specified by The Java Language Specification. + */ + protected String modifierString(MemberDoc member) { + int ms = member.modifierSpecifier(); + int no = Modifier.NATIVE | Modifier.SYNCHRONIZED; + return Modifier.toString(ms & ~no); + } + + protected String typeString(MemberDoc member) { + String type = ""; + if (member instanceof MethodDoc) { + type = ((MethodDoc)member).returnType().toString(); + } else if (member instanceof FieldDoc) { + type = ((FieldDoc)member).type().toString(); + } + return type; + } + + protected void printModifiers(MemberDoc member) { + String mod = modifierString(member); + // According to JLS, we should not be showing public modifier for + // interface methods. + if ((member.isField() || member.isMethod()) && + writer instanceof ClassWriterImpl && + ((ClassWriterImpl) writer).getClassDoc().isInterface()) { + mod = Util.replaceText(mod, "public", "").trim(); + } + if(mod.length() > 0) { + print(mod); + print(' '); + } + } + + protected String makeSpace(int len) { + if (len <= 0) { + return ""; + } + StringBuffer sb = new StringBuffer(len); + for(int i = 0; i < len; i++) { + sb.append(' '); + } + return sb.toString(); + } + + /** + * Print 'static' if static and type link. + */ + protected void printStaticAndType(boolean isStatic, Type type) { + writer.printTypeSummaryHeader(); + if (isStatic) { + print("static"); + } + writer.space(); + if (type != null) { + writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, + type)); + } + writer.printTypeSummaryFooter(); + } + + /** + * Print the modifier and type for the member in the member summary. + * + * @param member the member to print the type for. + * @param type the type to print. + */ + protected void printModifierAndType(ProgramElementDoc member, Type type) { + writer.printTypeSummaryHeader(); + printModifier(member); + if (type == null) { + writer.space(); + if (member.isClass()) { + print("class"); + } else { + print("interface"); + } + } else { + if (member instanceof ExecutableMemberDoc && + ((ExecutableMemberDoc) member).typeParameters().length > 0) { + //Code to avoid ugly wrapping in member summary table. + writer.table(0,0,0); + writer.trAlignVAlign("right", ""); + writer.tdNowrap(); + writer.font("-1"); + writer.code(); + int displayLength = ((AbstractExecutableMemberWriter) this). + writeTypeParameters((ExecutableMemberDoc) member); + if (displayLength > 10) { + writer.br(); + } + writer.printLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_SUMMARY_RETURN_TYPE, type)); + writer.codeEnd(); + writer.fontEnd(); + writer.tdEnd(); + writer.trEnd(); + writer.tableEnd(); + } else { + writer.space(); + writer.printLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_SUMMARY_RETURN_TYPE, type)); + } + + } + writer.printTypeSummaryFooter(); + } + + private void printModifier(ProgramElementDoc member) { + if (member.isProtected()) { + print("protected "); + } else if (member.isPrivate()) { + print("private "); + } else if (!member.isPublic()) { // Package private + writer.printText("doclet.Package_private"); + print(" "); + } + if (member.isMethod() && ((MethodDoc)member).isAbstract()) { + print("abstract "); + } + if (member.isStatic()) { + print("static"); + } + } + + protected void printComment(ProgramElementDoc member) { + if (member.inlineTags().length > 0) { + writer.dd(); + writer.printInlineComment(member); + } + } + + protected String name(ProgramElementDoc member) { + return member.name(); + } + + protected void printHead(MemberDoc member) { + writer.h3(); + writer.print(member.name()); + writer.h3End(); + } + + protected void printFullComment(ProgramElementDoc member) { + if(configuration().nocomment){ + return; + } + writer.dl(); + print(((TagletOutputImpl) + (new DeprecatedTaglet()).getTagletOutput(member, + writer.getTagletWriterInstance(false))).toString()); + printCommentAndTags(member); + writer.dlEnd(); + } + + protected void printCommentAndTags(ProgramElementDoc member) { + printComment(member); + writer.printTags(member); + } + + /** + * Forward to containing writer + */ + public void printSummaryHeader(ClassDoc cd) { + printedSummaryHeader = true; + writer.printSummaryHeader(this, cd); + } + + /** + * Forward to containing writer + */ + public void printInheritedSummaryHeader(ClassDoc cd) { + writer.printInheritedSummaryHeader(this, cd); + } + + /** + * Forward to containing writer + */ + public void printInheritedSummaryFooter(ClassDoc cd) { + writer.printInheritedSummaryFooter(this, cd); + } + + /** + * Forward to containing writer + */ + public void printSummaryFooter(ClassDoc cd) { + writer.printSummaryFooter(this, cd); + } + + /** + * Return true if the given ProgramElement is inherited + * by the class that is being documented. + * + * @param ped The ProgramElement being checked. + * return true if the ProgramElement is being inherited and + * false otherwise. + */ + protected boolean isInherited(ProgramElementDoc ped){ + if(ped.isPrivate() || (ped.isPackagePrivate() && + ! ped.containingPackage().equals(classdoc.containingPackage()))){ + return false; + } + return true; + } + + + /** + * Generate the code for listing the deprecated APIs. Create the table + * format for listing the API. Call methods from the sub-class to complete + * the generation. + */ + protected void printDeprecatedAPI(List deprmembers, String headingKey) { + if (deprmembers.size() > 0) { + writer.tableIndexSummary(); + writer.tableHeaderStart("#CCCCFF"); + writer.boldText(headingKey); + writer.tableHeaderEnd(); + for (int i = 0; i < deprmembers.size(); i++) { + ProgramElementDoc member =(ProgramElementDoc)deprmembers.get(i); + writer.trBgcolorStyle("white", "TableRowColor"); + writer.summaryRow(0); + writeDeprecatedLink(member); + writer.br(); + writer.printNbsps(); + if (member.tags("deprecated").length > 0) + writer.printInlineDeprecatedComment(member, member.tags("deprecated")[0]); + writer.space(); + writer.summaryRowEnd(); + writer.trEnd(); + } + writer.tableEnd(); + writer.space(); + writer.p(); + } + } + + /** + * Print use info. + */ + protected void printUseInfo(Object mems, String heading) { + if (mems == null) { + return; + } + List members = (List)mems; + if (members.size() > 0) { + writer.tableIndexSummary(); + writer.tableUseInfoHeaderStart("#CCCCFF"); + writer.print(heading); + writer.tableHeaderEnd(); + for (Iterator it = members.iterator(); it.hasNext(); ) { + ProgramElementDoc pgmdoc = (ProgramElementDoc)it.next(); + ClassDoc cd = pgmdoc.containingClass(); + + writer.printSummaryLinkType(this, pgmdoc); + if (cd != null && !(pgmdoc instanceof ConstructorDoc) + && !(pgmdoc instanceof ClassDoc)) { + // Add class context + writer.bold(cd.name() + "."); + } + writeSummaryLink( + pgmdoc instanceof ClassDoc ? + LinkInfoImpl.CONTEXT_CLASS_USE : LinkInfoImpl.CONTEXT_MEMBER, + cd, pgmdoc); + writer.printSummaryLinkComment(this, pgmdoc); + } + writer.tableEnd(); + writer.space(); + writer.p(); + } + } + + protected void navDetailLink(List members) { + printNavDetailLink(members.size() > 0? true: false); + } + + + protected void navSummaryLink(List members, + VisibleMemberMap visibleMemberMap) { + if (members.size() > 0) { + printNavSummaryLink(null, true); + return; + } else { + ClassDoc icd = classdoc.superclass(); + while (icd != null) { + List inhmembers = visibleMemberMap.getMembersFor(icd); + if (inhmembers.size() > 0) { + printNavSummaryLink(icd, true); + return; + } + icd = icd.superclass(); + } + } + printNavSummaryLink(null, false); + } + + protected void serialWarning(SourcePosition pos, String key, String a1, String a2) { + if (configuration().serialwarn) { + ConfigurationImpl.getInstance().getDocletSpecificMsg().warning(pos, key, a1, a2); + } + } + + public ProgramElementDoc[] eligibleMembers(ProgramElementDoc[] members) { + return nodepr? Util.excludeDeprecatedMembers(members): members; + } + + public ConfigurationImpl configuration() { + return writer.configuration; + } + + /** + * {@inheritDoc} + */ + public void writeMemberSummary(ClassDoc classDoc, ProgramElementDoc member, + Tag[] firstSentenceTags, boolean isFirst, boolean isLast) { + writer.printSummaryLinkType(this, member); + writeSummaryLink(classDoc, member); + writer.printSummaryLinkComment(this, member, firstSentenceTags); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java new file mode 100644 index 00000000000..b845d84b480 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java @@ -0,0 +1,156 @@ +/* + * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.javadoc.*; +import java.io.*; +import java.util.*; + +/** + * Abstract class to generate the overview files in + * Frame and Non-Frame format. This will be sub-classed by to + * generate overview-frame.html as well as overview-summary.html. + * + * @author Atul M Dambalkar + */ +public abstract class AbstractPackageIndexWriter extends HtmlDocletWriter { + + /** + * Array of Packages to be documented. + */ + protected PackageDoc[] packages; + + /** + * Constructor. Also initialises the packages variable. + * + * @param filename Name of the package index file to be generated. + */ + public AbstractPackageIndexWriter(ConfigurationImpl configuration, + String filename) throws IOException { + super(configuration, filename); + this.relativepathNoSlash = "."; + packages = configuration.packages; + } + + protected abstract void printNavigationBarHeader(); + + protected abstract void printNavigationBarFooter(); + + protected abstract void printOverviewHeader(); + + protected abstract void printIndexHeader(String text); + + protected abstract void printIndexRow(PackageDoc pkg); + + protected abstract void printIndexFooter(); + + /** + * Generate the contants in the package index file. Call appropriate + * methods from the sub-class in order to generate Frame or Non + * Frame format. + * @param title the title of the window. + * @param includeScript boolean set true if windowtitle script is to be included + */ + protected void generatePackageIndexFile(String title, boolean includeScript) throws IOException { + String windowOverview = configuration.getText(title); + printHtmlHeader(windowOverview, + configuration.metakeywords.getOverviewMetaKeywords(title, + configuration.doctitle), + includeScript); + printNavigationBarHeader(); + printOverviewHeader(); + + generateIndex(); + + printOverview(); + + printNavigationBarFooter(); + printBodyHtmlEnd(); + } + + /** + * Default to no overview, overwrite to add overview. + */ + protected void printOverview() throws IOException { + } + + /** + * Generate the frame or non-frame package index. + */ + protected void generateIndex() { + printIndexContents(packages, "doclet.Package_Summary"); + } + + /** + * Generate code for package index contents. Call appropriate methods from + * the sub-classes. + * + * @param packages Array of packages to be documented. + * @param text String which will be used as the heading. + */ + protected void printIndexContents(PackageDoc[] packages, String text) { + if (packages.length > 0) { + Arrays.sort(packages); + printIndexHeader(text); + printAllClassesPackagesLink(); + for(int i = 0; i < packages.length; i++) { + if (packages[i] != null) { + printIndexRow(packages[i]); + } + } + printIndexFooter(); + } + } + + /** + * Print the doctitle, if it is specified on the command line. + */ + protected void printConfigurationTitle() { + if (configuration.doctitle.length() > 0) { + center(); + h1(configuration.doctitle); + centerEnd(); + } + } + + /** + * Highlight "Overview" in the bold format, in the navigation bar as this + * is the overview page. + */ + protected void navLinkContents() { + navCellRevStart(); + fontStyle("NavBarFont1Rev"); + boldText("doclet.Overview"); + fontEnd(); + navCellEnd(); + } + + /** + * Do nothing. This will be overridden in PackageIndexFrameWriter. + */ + protected void printAllClassesPackagesLink() { + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java new file mode 100644 index 00000000000..ee1ad6a2fae --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java @@ -0,0 +1,200 @@ +/* + * Copyright 1998-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.util.*; + +import com.sun.javadoc.*; +import java.io.*; +import java.util.*; + +/** + * Abstract class to print the class hierarchy page for all the Classes. This + * is sub-classed by {@link PackageTreeWriter} and {@link TreeWriter} to + * generate the Package Tree and global Tree(for all the classes and packages) + * pages. + * + * @author Atul M Dambalkar + */ +public abstract class AbstractTreeWriter extends HtmlDocletWriter { + + /** + * The class and interface tree built by using {@link ClassTree} + */ + protected final ClassTree classtree; + + /** + * Constructor initilises classtree variable. This constructor will be used + * while generating global tree file "overview-tree.html". + * + * @param filename File to be generated. + * @param classtree Tree built by {@link ClassTree}. + * @throws IOException + * @throws DocletAbortException + */ + protected AbstractTreeWriter(ConfigurationImpl configuration, + String filename, ClassTree classtree) + throws IOException { + super(configuration, filename); + this.classtree = classtree; + } + + /** + * Create appropriate directory for the package and also initilise the + * relative path from this generated file to the current or + * the destination directory. This constructor will be used while + * generating "package tree" file. + * + * @param path Directories in this path will be created if they are not + * already there. + * @param filename Name of the package tree file to be generated. + * @param classtree The tree built using {@link ClassTree}. + * for the package pkg. + * @param pkg PackageDoc for which tree file will be generated. + * @throws IOException + * @throws DocletAbortException + */ + protected AbstractTreeWriter(ConfigurationImpl configuration, + String path, String filename, + ClassTree classtree, PackageDoc pkg) + throws IOException { + super(configuration, + path, filename, DirectoryManager.getRelativePath(pkg.name())); + this.classtree = classtree; + } + + /** + * Generate each level of the class tree. For each sub-class or + * sub-interface indents the next level information. + * Recurses itself to generate subclasses info. + * To iterate is human, to recurse is divine - L. Peter Deutsch. + * + * @param parent the superclass or superinterface of the list. + * @param list list of the sub-classes at this level. + * @param isEnum true if we are generating a tree for enums. + */ + protected void generateLevelInfo(ClassDoc parent, List list, + boolean isEnum) { + if (list.size() > 0) { + ul(); + for (int i = 0; i < list.size(); i++) { + ClassDoc local = (ClassDoc)list.get(i); + printPartialInfo(local); + printExtendsImplements(parent, local); + generateLevelInfo(local, classtree.subs(local, isEnum), + isEnum); // Recurse + } + ulEnd(); + } + } + + /** + * Generate the heading for the tree depending upon tree type if it's a + * Class Tree or Interface tree and also print the tree. + * + * @param list List of classes which are at the most base level, all the + * other classes in this run will derive from these classes. + * @param heading Heading for the tree. + */ + protected void generateTree(List list, String heading) { + if (list.size() > 0) { + ClassDoc firstClassDoc = (ClassDoc)list.get(0); + printTreeHeading(heading); + generateLevelInfo(!firstClassDoc.isInterface()? firstClassDoc : null, + list, + list == classtree.baseEnums()); + } + } + + /** + * Print the information regarding the classes which this class extends or + * implements. + * + * @param cd The classdoc under consideration. + */ + protected void printExtendsImplements(ClassDoc parent, ClassDoc cd) { + ClassDoc[] interfaces = cd.interfaces(); + if (interfaces.length > (cd.isInterface()? 1 : 0)) { + Arrays.sort(interfaces); + int counter = 0; + for (int i = 0; i < interfaces.length; i++) { + if (parent != interfaces[i]) { + if (! (interfaces[i].isPublic() || + Util.isLinkable(interfaces[i], configuration()))) { + continue; + } + if (counter == 0) { + if (cd.isInterface()) { + print(" (" + configuration.getText("doclet.also") + " extends "); + } else { + print(" (implements "); + } + } else { + print(", "); + } + printPreQualifiedClassLink(LinkInfoImpl.CONTEXT_TREE, + interfaces[i]); + counter++; + } + } + if (counter > 0) { + println(")"); + } + } + } + + /** + * Print information about the class kind, if it's a "class" or "interface". + * + * @param cd classdoc. + */ + protected void printPartialInfo(ClassDoc cd) { + li("circle"); + printPreQualifiedBoldClassLink(LinkInfoImpl.CONTEXT_TREE, cd); + } + + /** + * Print the heading for the tree. + * + * @param heading Heading for the tree. + */ + protected void printTreeHeading(String heading) { + h2(); + println(configuration.getText(heading)); + h2End(); + } + + /** + * Highlight "Tree" word in the navigation bar, since this is the tree page. + */ + protected void navLinkTree() { + navCellRevStart(); + fontStyle("NavBarFont1Rev"); + boldText("doclet.Tree"); + fontEnd(); + navCellEnd(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java new file mode 100644 index 00000000000..6884d5b554d --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java @@ -0,0 +1,181 @@ +/* + * Copyright 1998-2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.javadoc.*; +import java.io.*; +import java.util.*; + +/** + * Generate the file with list of all the classes in this run. This page will be + * used in the left-hand bottom frame, when "All Classes" link is clicked in + * the left-hand top frame. The name of the generated file is + * "allclasses-frame.html". + * + * @author Atul M Dambalkar + * @author Doug Kramer + */ +public class AllClassesFrameWriter extends HtmlDocletWriter { + + /** + * The name of the output file with frames + */ + public static final String OUTPUT_FILE_NAME_FRAMES = "allclasses-frame.html"; + + /** + * The name of the output file without frames + */ + public static final String OUTPUT_FILE_NAME_NOFRAMES = "allclasses-noframe.html"; + + /** + * Index of all the classes. + */ + protected IndexBuilder indexbuilder; + + /** + * Construct AllClassesFrameWriter object. Also initilises the indexbuilder + * variable in this class. + * @throws IOException + * @throws DocletAbortException + */ + public AllClassesFrameWriter(ConfigurationImpl configuration, + String filename, IndexBuilder indexbuilder) + throws IOException { + super(configuration, filename); + this.indexbuilder = indexbuilder; + } + + /** + * Create AllClassesFrameWriter object. Then use it to generate the + * "allclasses-frame.html" file. Generate the file in the current or the + * destination directory. + * + * @param indexbuilder IndexBuilder object for all classes index. + * @throws DocletAbortException + */ + public static void generate(ConfigurationImpl configuration, + IndexBuilder indexbuilder) { + AllClassesFrameWriter allclassgen; + String filename = OUTPUT_FILE_NAME_FRAMES; + try { + allclassgen = new AllClassesFrameWriter(configuration, + filename, indexbuilder); + allclassgen.generateAllClassesFile(true); + allclassgen.close(); + filename = OUTPUT_FILE_NAME_NOFRAMES; + allclassgen = new AllClassesFrameWriter(configuration, + filename, indexbuilder); + allclassgen.generateAllClassesFile(false); + allclassgen.close(); + } catch (IOException exc) { + configuration.standardmessage. + error("doclet.exception_encountered", + exc.toString(), filename); + throw new DocletAbortException(); + } + } + + /** + * Print all the classes in table format in the file. + * @param wantFrames True if we want frames. + */ + protected void generateAllClassesFile(boolean wantFrames) throws IOException { + String label = configuration.getText("doclet.All_Classes"); + + printHtmlHeader(label, null, false); + + printAllClassesTableHeader(); + printAllClasses(wantFrames); + printAllClassesTableFooter(); + + printBodyHtmlEnd(); + } + + /** + * Use the sorted index of all the classes and print all the classes. + * + * @param wantFrames True if we want frames. + */ + protected void printAllClasses(boolean wantFrames) { + for (int i = 0; i < indexbuilder.elements().length; i++) { + Character unicode = (Character)((indexbuilder.elements())[i]); + generateContents(indexbuilder.getMemberList(unicode), wantFrames); + } + } + + /** + * Given a list of classes, generate links for each class or interface. + * If the class kind is interface, print it in the italics font. Also all + * links should target the right-hand frame. If clicked on any class name + * in this page, appropriate class page should get opened in the right-hand + * frame. + * + * @param classlist Sorted list of classes. + * @param wantFrames True if we want frames. + */ + protected void generateContents(List classlist, boolean wantFrames) { + for (int i = 0; i < classlist.size(); i++) { + ClassDoc cd = (ClassDoc)(classlist.get(i)); + if (!Util.isCoreClass(cd)) { + continue; + } + String label = italicsClassName(cd, false); + if(wantFrames){ + printLink(new LinkInfoImpl(LinkInfoImpl.ALL_CLASSES_FRAME, cd, + label, "classFrame") + ); + } else { + printLink(new LinkInfoImpl(cd, label)); + } + br(); + } + } + + /** + * Print the heading "All Classes" and also print Html table tag. + */ + protected void printAllClassesTableHeader() { + fontSizeStyle("+1", "FrameHeadingFont"); + boldText("doclet.All_Classes"); + fontEnd(); + br(); + table(); + tr(); + tdNowrap(); + fontStyle("FrameItemFont"); + } + + /** + * Print Html closing table tag. + */ + protected void printAllClassesTableFooter() { + fontEnd(); + tdEnd(); + trEnd(); + tableEnd(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java new file mode 100644 index 00000000000..66a2dfd8f5d --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java @@ -0,0 +1,108 @@ +/* + * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.javadoc.*; + +import java.io.*; + +/** + * Writes annotation type optional member documentation in HTML format. + * + * @author Jamie Ho + */ +public class AnnotationTypeOptionalMemberWriterImpl extends + AnnotationTypeRequiredMemberWriterImpl + implements AnnotationTypeOptionalMemberWriter, MemberSummaryWriter { + + /** + * Construct a new AnnotationTypeOptionalMemberWriterImpl. + * + * @param writer the writer that will write the output. + * @param annotationType the AnnotationType that holds this member. + */ + public AnnotationTypeOptionalMemberWriterImpl(SubWriterHolderWriter writer, + AnnotationTypeDoc annotationType) { + super(writer, annotationType); + } + + /** + * {@inheritDoc} + */ + public void writeMemberSummaryHeader(ClassDoc classDoc) { + writer.println(""); + writer.println(); + writer.printSummaryHeader(this, classDoc); + } + + /** + * {@inheritDoc} + */ + public void writeDefaultValueInfo(MemberDoc member) { + writer.dl(); + writer.dt(); + writer.bold(ConfigurationImpl.getInstance(). + getText("doclet.Default")); + writer.dd(); + writer.print(((AnnotationTypeElementDoc) member).defaultValue()); + writer.ddEnd(); + writer.dlEnd(); + } + + /** + * {@inheritDoc} + */ + public void close() throws IOException { + writer.close(); + } + + /** + * {@inheritDoc} + */ + public void printSummaryLabel(ClassDoc cd) { + writer.boldText("doclet.Annotation_Type_Optional_Member_Summary"); + } + + /** + * {@inheritDoc} + */ + public void printSummaryAnchor(ClassDoc cd) { + writer.anchor("annotation_type_optional_element_summary"); + } + + /** + * {@inheritDoc} + */ + protected void printNavSummaryLink(ClassDoc cd, boolean link) { + if (link) { + writer.printHyperLink("", "annotation_type_optional_element_summary", + configuration().getText("doclet.navAnnotationTypeOptionalMember")); + } else { + writer.printText("doclet.navAnnotationTypeOptionalMember"); + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java new file mode 100644 index 00000000000..380aa775774 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java @@ -0,0 +1,282 @@ +/* + * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.taglets.*; +import com.sun.javadoc.*; + +import java.io.*; + +/** + * Writes annotation type required member documentation in HTML format. + * + * @author Jamie Ho + */ +public class AnnotationTypeRequiredMemberWriterImpl extends AbstractMemberWriter + implements AnnotationTypeRequiredMemberWriter, MemberSummaryWriter { + + /** + * Construct a new AnnotationTypeRequiredMemberWriterImpl. + * + * @param writer the writer that will write the output. + * @param annotationType the AnnotationType that holds this member. + */ + public AnnotationTypeRequiredMemberWriterImpl(SubWriterHolderWriter writer, + AnnotationTypeDoc annotationType) { + super(writer, annotationType); + } + + /** + * Write the annotation type member summary header for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeMemberSummaryHeader(ClassDoc classDoc) { + writer.println(""); + writer.println(); + writer.printSummaryHeader(this, classDoc); + } + + /** + * Write the annotation type member summary footer for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeMemberSummaryFooter(ClassDoc classDoc) { + writer.printSummaryFooter(this, classDoc); + } + + /** + * {@inheritDoc} + */ + public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) { + //Not appliable. + } + + /** + * {@inheritDoc} + */ + public void writeInheritedMemberSummary(ClassDoc classDoc, + ProgramElementDoc member, boolean isFirst, boolean isLast) { + //Not appliable. + } + + /** + * {@inheritDoc} + */ + public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) { + //Not appliable. + } + + /** + * {@inheritDoc} + */ + public void writeHeader(ClassDoc classDoc, String header) { + writer.println(); + writer.println(""); + writer.println(); + writer.anchor("annotation_type_element_detail"); + writer.printTableHeadingBackground(header); + writer.println(); + } + + /** + * {@inheritDoc} + */ + public void writeMemberHeader(MemberDoc member, boolean isFirst) { + if (! isFirst) { + writer.printMemberHeader(); + writer.println(""); + } + writer.anchor(member.name() + ((ExecutableMemberDoc) member).signature()); + writer.h3(); + writer.print(member.name()); + writer.h3End(); + } + + /** + * {@inheritDoc} + */ + public void writeSignature(MemberDoc member) { + writer.pre(); + writer.writeAnnotationInfo(member); + printModifiers(member); + writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, + getType(member))); + print(' '); + if (configuration().linksource) { + writer.printSrcLink(member, member.name()); + } else { + bold(member.name()); + } + writer.preEnd(); + writer.dl(); + } + + /** + * {@inheritDoc} + */ + public void writeComments(MemberDoc member) { + if (member.inlineTags().length > 0) { + writer.dd(); + writer.printInlineComment(member); + } + } + + /** + * Write the tag output for the given member. + * + * @param member the member being documented. + */ + public void writeTags(MemberDoc member) { + writer.printTags(member); + } + + /** + * Write the annotation type member footer. + */ + public void writeMemberFooter() { + writer.dlEnd(); + } + + /** + * Write the footer for the annotation type member documentation. + * + * @param classDoc the class that the annotation type member belong to. + */ + public void writeFooter(ClassDoc classDoc) { + //No footer to write for annotation type member documentation + } + + /** + * Close the writer. + */ + public void close() throws IOException { + writer.close(); + } + + /** + * {@inheritDoc} + */ + public void printSummaryLabel(ClassDoc cd) { + writer.boldText("doclet.Annotation_Type_Required_Member_Summary"); + } + + /** + * {@inheritDoc} + */ + public void printSummaryAnchor(ClassDoc cd) { + writer.anchor("annotation_type_required_element_summary"); + } + + /** + * {@inheritDoc} + */ + public void printInheritedSummaryAnchor(ClassDoc cd) { + } // no such + + /** + * {@inheritDoc} + */ + public void printInheritedSummaryLabel(ClassDoc cd) { + // no such + } + + /** + * {@inheritDoc} + */ + protected void writeSummaryLink(int context, ClassDoc cd, ProgramElementDoc member) { + writer.bold(); + writer.printDocLink(context, (MemberDoc) member, member.name(), false); + writer.boldEnd(); + } + + /** + * {@inheritDoc} + */ + protected void writeInheritedSummaryLink(ClassDoc cd, + ProgramElementDoc member) { + //Not applicable. + } + + /** + * {@inheritDoc} + */ + protected void printSummaryType(ProgramElementDoc member) { + MemberDoc m = (MemberDoc)member; + printModifierAndType(m, getType(m)); + } + + /** + * {@inheritDoc} + */ + protected void writeDeprecatedLink(ProgramElementDoc member) { + writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER, + (MemberDoc) member, ((MemberDoc)member).qualifiedName(), false); + } + + /** + * {@inheritDoc} + */ + protected void printNavSummaryLink(ClassDoc cd, boolean link) { + if (link) { + writer.printHyperLink("", "annotation_type_required_element_summary", + configuration().getText("doclet.navAnnotationTypeRequiredMember")); + } else { + writer.printText("doclet.navAnnotationTypeRequiredMember"); + } + } + + /** + * {@inheritDoc} + */ + protected void printNavDetailLink(boolean link) { + if (link) { + writer.printHyperLink("", "annotation_type_element_detail", + configuration().getText("doclet.navAnnotationTypeMember")); + } else { + writer.printText("doclet.navAnnotationTypeMember"); + } + } + + /** + * {@inheritDoc} + */ + public void writeDeprecated(MemberDoc member) { + print(((TagletOutputImpl) + (new DeprecatedTaglet()).getTagletOutput(member, + writer.getTagletWriterInstance(false))).toString()); + } + + private Type getType(MemberDoc member) { + if (member instanceof FieldDoc) { + return ((FieldDoc) member).type(); + } else { + return ((MethodDoc) member).returnType(); + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java new file mode 100644 index 00000000000..a19b35770f9 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java @@ -0,0 +1,358 @@ +/* + * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.builders.*; +import com.sun.javadoc.*; + +/** + * Generate the Class Information Page. + * @see com.sun.javadoc.ClassDoc + * @see java.util.Collections + * @see java.util.List + * @see java.util.ArrayList + * @see java.util.HashMap + * + * @author Atul M Dambalkar + * @author Robert Field + */ +public class AnnotationTypeWriterImpl extends SubWriterHolderWriter + implements AnnotationTypeWriter { + + protected AnnotationTypeDoc annotationType; + + protected Type prev; + + protected Type next; + + /** + * @param annotationType the annotation type being documented. + * @param prevType the previous class that was documented. + * @param nextType the next class being documented. + */ + public AnnotationTypeWriterImpl (AnnotationTypeDoc annotationType, + Type prevType, Type nextType) + throws Exception { + super(ConfigurationImpl.getInstance(), + DirectoryManager.getDirectoryPath(annotationType.containingPackage()), + annotationType.name() + ".html", + DirectoryManager.getRelativePath(annotationType.containingPackage().name())); + this.annotationType = annotationType; + configuration.currentcd = annotationType.asClassDoc(); + this.prev = prevType; + this.next = nextType; + } + + /** + * Print this package link + */ + protected void navLinkPackage() { + navCellStart(); + printHyperLink("package-summary.html", "", + configuration.getText("doclet.Package"), true, "NavBarFont1"); + navCellEnd(); + } + + /** + * Print class page indicator + */ + protected void navLinkClass() { + navCellRevStart(); + fontStyle("NavBarFont1Rev"); + boldText("doclet.Class"); + fontEnd(); + navCellEnd(); + } + + /** + * Print class use link + */ + protected void navLinkClassUse() { + navCellStart(); + printHyperLink("class-use/" + filename, "", + configuration.getText("doclet.navClassUse"), true, "NavBarFont1"); + navCellEnd(); + } + + /** + * Print previous package link + */ + protected void navLinkPrevious() { + if (prev == null) { + printText("doclet.Prev_Class"); + } else { + printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, + prev.asClassDoc(), "", + configuration.getText("doclet.Prev_Class"), true)); + } + } + + /** + * Print next package link + */ + protected void navLinkNext() { + if (next == null) { + printText("doclet.Next_Class"); + } else { + printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, + next.asClassDoc(), "", + configuration.getText("doclet.Next_Class"), true)); + } + } + + /** + * {@inheritDoc} + */ + public void writeHeader(String header) { + + String pkgname = (annotationType.containingPackage() != null)? + annotationType.containingPackage().name(): ""; + String clname = annotationType.name(); + + printHtmlHeader(clname, + configuration.metakeywords.getMetaKeywords(annotationType), true); + printTop(); + navLinks(true); + hr(); + println(""); + h2(); + if (pkgname.length() > 0) { + font("-1"); print(pkgname); fontEnd(); br(); + } + print(header + getTypeParameterLinks(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_CLASS_HEADER, + annotationType, false))); + h2End(); + } + + /** + * {@inheritDoc} + */ + public void writeFooter() { + println(""); + hr(); + navLinks(false); + printBottom(); + printBodyHtmlEnd(); + } + + /** + * {@inheritDoc} + */ + public void writeAnnotationTypeSignature(String modifiers) { + dl(); + dt(); + preNoNewLine(); + writeAnnotationInfo(annotationType); + print(modifiers); + String name = annotationType.name() + + getTypeParameterLinks(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, annotationType, false)); + if (configuration().linksource) { + printSrcLink(annotationType, name); + } else { + bold(name); + } + dlEnd(); + preEnd(); + p(); + } + + /** + * {@inheritDoc} + */ + public void writeAnnotationTypeDescription() { + if(!configuration.nocomment) { + // generate documentation for the class. + if (annotationType.inlineTags().length > 0) { + printInlineComment(annotationType); + p(); + } + } + } + + /** + * {@inheritDoc} + */ + public void writeAnnotationTypeTagInfo() { + boolean needHr = annotationType.elements().length > 0; + if(!configuration.nocomment) { + // Print Information about all the tags here + printTags(annotationType); + if (needHr) { + hr(); + } + p(); + } else if (needHr) { + hr(); + } + } + + /** + * {@inheritDoc} + */ + public void writeAnnotationTypeDeprecationInfo() { + hr(); + Tag[] deprs = annotationType.tags("deprecated"); + if (Util.isDeprecated(annotationType)) { + boldText("doclet.Deprecated"); + if (deprs.length > 0) { + Tag[] commentTags = deprs[0].inlineTags(); + if (commentTags.length > 0) { + + space(); + printInlineDeprecatedComment(annotationType, deprs[0]); + } + } + p(); + } + } + + protected void navLinkTree() { + navCellStart(); + printHyperLink("package-tree.html", "", + configuration.getText("doclet.Tree"), true, "NavBarFont1"); + navCellEnd(); + } + + protected void printSummaryDetailLinks() { + try { + tr(); + tdVAlignClass("top", "NavBarCell3"); + font("-2"); + print(" "); + navSummaryLinks(); + fontEnd(); + tdEnd(); + + tdVAlignClass("top", "NavBarCell3"); + font("-2"); + navDetailLinks(); + fontEnd(); + tdEnd(); + trEnd(); + } catch (Exception e) { + e.printStackTrace(); + throw new DocletAbortException(); + } + } + + protected void navSummaryLinks() throws Exception { + printText("doclet.Summary"); + space(); + MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder) + configuration.getBuilderFactory().getMemberSummaryBuilder(this); + writeNavSummaryLink(memberSummaryBuilder, + "doclet.navAnnotationTypeRequiredMember", + VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED); + navGap(); + writeNavSummaryLink(memberSummaryBuilder, + "doclet.navAnnotationTypeOptionalMember", + VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL); + } + + private void writeNavSummaryLink(MemberSummaryBuilder builder, + String label, int type) { + AbstractMemberWriter writer = ((AbstractMemberWriter) builder. + getMemberSummaryWriter(type)); + if (writer == null) { + printText(label); + } else { + writer.printNavSummaryLink(null, + ! builder.getVisibleMemberMap(type).noVisibleMembers()); + } + } + + /** + * Method navDetailLinks + * + * @throws Exception + * + */ + protected void navDetailLinks() throws Exception { + printText("doclet.Detail"); + space(); + MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder) + configuration.getBuilderFactory().getMemberSummaryBuilder(this); + AbstractMemberWriter writerOptional = + ((AbstractMemberWriter) memberSummaryBuilder. + getMemberSummaryWriter(VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL)); + AbstractMemberWriter writerRequired = + ((AbstractMemberWriter) memberSummaryBuilder. + getMemberSummaryWriter(VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED)); + if (writerOptional != null){ + writerOptional.printNavDetailLink(annotationType.elements().length > 0); + } else if (writerRequired != null){ + writerRequired.printNavDetailLink(annotationType.elements().length > 0); + } else { + printText("doclet.navAnnotationTypeMember"); + } + } + + protected void navGap() { + space(); + print('|'); + space(); + } + + /** + * If this is an inner class or interface, write the enclosing class or + * interface. + */ + public void writeNestedClassInfo() { + ClassDoc outerClass = annotationType.containingClass(); + if (outerClass != null) { + dl(); + dt(); + if (annotationType.isInterface()) { + boldText("doclet.Enclosing_Interface"); + } else { + boldText("doclet.Enclosing_Class"); + } + dd(); + printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, outerClass, + false)); + ddEnd(); + dlEnd(); + } + } + + /** + * {@inheritDoc} + */ + public AnnotationTypeDoc getAnnotationTypeDoc() { + return annotationType; + } + + /** + * {@inheritDoc} + */ + public void completeMemberSummaryBuild() { + p(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java new file mode 100644 index 00000000000..713dce1e88f --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java @@ -0,0 +1,456 @@ +/* + * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.javadoc.*; +import java.io.*; +import java.util.*; + +/** + * Generate class usage information. + * + * @author Robert G. Field + */ +public class ClassUseWriter extends SubWriterHolderWriter { + + final ClassDoc classdoc; + Set pkgToPackageAnnotations = null; + final Map pkgToClassTypeParameter; + final Map pkgToClassAnnotations; + final Map pkgToMethodTypeParameter; + final Map pkgToMethodArgTypeParameter; + final Map pkgToMethodReturnTypeParameter; + final Map pkgToMethodAnnotations; + final Map pkgToMethodParameterAnnotations; + final Map pkgToFieldTypeParameter; + final Map pkgToFieldAnnotations; + final Map pkgToSubclass; + final Map pkgToSubinterface; + final Map pkgToImplementingClass; + final Map pkgToField; + final Map pkgToMethodReturn; + final Map pkgToMethodArgs; + final Map pkgToMethodThrows; + final Map pkgToConstructorAnnotations; + final Map pkgToConstructorParameterAnnotations; + final Map pkgToConstructorArgs; + final Map pkgToConstructorArgTypeParameter; + final Map pkgToConstructorThrows; + final SortedSet pkgSet; + final MethodWriterImpl methodSubWriter; + final ConstructorWriterImpl constrSubWriter; + final FieldWriterImpl fieldSubWriter; + final NestedClassWriterImpl classSubWriter; + + + /** + * Constructor. + * + * @param filename the file to be generated. + * @throws IOException + * @throws DocletAbortException + */ + public ClassUseWriter(ConfigurationImpl configuration, + ClassUseMapper mapper, String path, + String filename, String relpath, + ClassDoc classdoc) throws IOException { + super(configuration, path, filename, relpath); + this.classdoc = classdoc; + if (mapper.classToPackageAnnotations.containsKey(classdoc.qualifiedName())) + pkgToPackageAnnotations = new HashSet((List) mapper.classToPackageAnnotations.get(classdoc.qualifiedName())); + configuration.currentcd = classdoc; + this.pkgSet = new TreeSet(); + this.pkgToClassTypeParameter = pkgDivide(mapper.classToClassTypeParam); + this.pkgToClassAnnotations = pkgDivide(mapper.classToClassAnnotations); + this.pkgToMethodTypeParameter = pkgDivide(mapper.classToExecMemberDocTypeParam); + this.pkgToMethodArgTypeParameter = pkgDivide(mapper.classToExecMemberDocArgTypeParam); + this.pkgToFieldTypeParameter = pkgDivide(mapper.classToFieldDocTypeParam); + this.pkgToFieldAnnotations = pkgDivide(mapper.annotationToFieldDoc); + this.pkgToMethodReturnTypeParameter = pkgDivide(mapper.classToExecMemberDocReturnTypeParam); + this.pkgToMethodAnnotations = pkgDivide(mapper.classToExecMemberDocAnnotations); + this.pkgToMethodParameterAnnotations = pkgDivide(mapper.classToExecMemberDocParamAnnotation); + this.pkgToSubclass = pkgDivide(mapper.classToSubclass); + this.pkgToSubinterface = pkgDivide(mapper.classToSubinterface); + this.pkgToImplementingClass = pkgDivide(mapper.classToImplementingClass); + this.pkgToField = pkgDivide(mapper.classToField); + this.pkgToMethodReturn = pkgDivide(mapper.classToMethodReturn); + this.pkgToMethodArgs = pkgDivide(mapper.classToMethodArgs); + this.pkgToMethodThrows = pkgDivide(mapper.classToMethodThrows); + this.pkgToConstructorAnnotations = pkgDivide(mapper.classToConstructorAnnotations); + this.pkgToConstructorParameterAnnotations = pkgDivide(mapper.classToConstructorParamAnnotation); + this.pkgToConstructorArgs = pkgDivide(mapper.classToConstructorArgs); + this.pkgToConstructorArgTypeParameter = pkgDivide(mapper.classToConstructorDocArgTypeParam); + this.pkgToConstructorThrows = pkgDivide(mapper.classToConstructorThrows); + //tmp test + if (pkgSet.size() > 0 && + mapper.classToPackage.containsKey(classdoc.qualifiedName()) && + !pkgSet.equals(mapper.classToPackage.get(classdoc.qualifiedName()))) { + configuration.root.printWarning("Internal error: package sets don't match: " + pkgSet + " with: " + + mapper.classToPackage.get(classdoc.qualifiedName())); + } + methodSubWriter = new MethodWriterImpl(this); + constrSubWriter = new ConstructorWriterImpl(this); + fieldSubWriter = new FieldWriterImpl(this); + classSubWriter = new NestedClassWriterImpl(this); + } + + /** + * Write out class use pages. + * @throws DocletAbortException + */ + public static void generate(ConfigurationImpl configuration, + ClassTree classtree) { + ClassUseMapper mapper = new ClassUseMapper(configuration.root, classtree); + ClassDoc[] classes = configuration.root.classes(); + for (int i = 0; i < classes.length; i++) { + ClassUseWriter.generate(configuration, mapper, classes[i]); + } + PackageDoc[] pkgs = configuration.packages; + for (int i = 0; i < pkgs.length; i++) { + PackageUseWriter.generate(configuration, mapper, pkgs[i]); + } + } + + private Map pkgDivide(Map classMap) { + Map map = new HashMap(); + List list= (List)classMap.get(classdoc.qualifiedName()); + if (list != null) { + Collections.sort(list); + Iterator it = list.iterator(); + while (it.hasNext()) { + ProgramElementDoc doc = (ProgramElementDoc)it.next(); + PackageDoc pkg = doc.containingPackage(); + pkgSet.add(pkg); + List inPkg = (List)map.get(pkg.name()); + if (inPkg == null) { + inPkg = new ArrayList(); + map.put(pkg.name(), inPkg); + } + inPkg.add(doc); + } + } + return map; + } + + /** + * Generate a class page. + */ + public static void generate(ConfigurationImpl configuration, + ClassUseMapper mapper, ClassDoc classdoc) { + ClassUseWriter clsgen; + String path = DirectoryManager.getDirectoryPath(classdoc. + containingPackage()); + if (path.length() > 0) { + path += File.separator; + } + path += "class-use"; + String filename = classdoc.name() + ".html"; + String pkgname = classdoc.containingPackage().name(); + pkgname += (pkgname.length() > 0)? ".class-use": "class-use"; + String relpath = DirectoryManager.getRelativePath(pkgname); + try { + clsgen = new ClassUseWriter(configuration, + mapper, path, filename, + relpath, classdoc); + clsgen.generateClassUseFile(); + clsgen.close(); + } catch (IOException exc) { + configuration.standardmessage. + error("doclet.exception_encountered", + exc.toString(), filename); + throw new DocletAbortException(); + } + } + + /** + * Print the class use list. + */ + protected void generateClassUseFile() throws IOException { + + printClassUseHeader(); + + if (pkgSet.size() > 0) { + generateClassUse(); + } else { + printText("doclet.ClassUse_No.usage.of.0", + classdoc.qualifiedName()); + p(); + } + + printClassUseFooter(); + } + + protected void generateClassUse() throws IOException { + if (configuration.packages.length > 1) { + generatePackageList(); + generatePackageAnnotationList(); + } + generateClassList(); + } + + protected void generatePackageList() throws IOException { + tableIndexSummary(); + tableHeaderStart("#CCCCFF"); + printText("doclet.ClassUse_Packages.that.use.0", + getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, + false))); + tableHeaderEnd(); + + for (Iterator it = pkgSet.iterator(); it.hasNext();) { + PackageDoc pkg = (PackageDoc)it.next(); + generatePackageUse(pkg); + } + tableEnd(); + space(); + p(); + } + + protected void generatePackageAnnotationList() throws IOException { + if ((! classdoc.isAnnotationType()) || + pkgToPackageAnnotations == null || + pkgToPackageAnnotations.size() == 0) + return; + tableIndexSummary(); + tableHeaderStart("#CCCCFF"); + printText("doclet.ClassUse_PackageAnnotation", + getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, + false))); + tableHeaderEnd(); + for (Iterator it = pkgToPackageAnnotations.iterator(); it.hasNext();) { + PackageDoc pkg = (PackageDoc)it.next(); + trBgcolorStyle("white", "TableRowColor"); + summaryRow(0); + //Just want an anchor here. + printPackageLink(pkg, pkg.name(), true); + summaryRowEnd(); + summaryRow(0); + printSummaryComment(pkg); + space(); + summaryRowEnd(); + trEnd(); + } + tableEnd(); + space(); + p(); + } + + protected void generateClassList() throws IOException { + for (Iterator it = pkgSet.iterator(); it.hasNext();) { + PackageDoc pkg = (PackageDoc)it.next(); + anchor(pkg.name()); + tableIndexSummary(); + tableHeaderStart("#CCCCFF"); + printText("doclet.ClassUse_Uses.of.0.in.1", + getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, + classdoc, false)), + getPackageLink(pkg, Util.getPackageName(pkg), false)); + tableHeaderEnd(); + tableEnd(); + space(); + p(); + generateClassUse(pkg); + } + } + + /** + * Print the package use list. + */ + protected void generatePackageUse(PackageDoc pkg) throws IOException { + trBgcolorStyle("white", "TableRowColor"); + summaryRow(0); + //Just want an anchor here. + printHyperLink("", pkg.name(), Util.getPackageName(pkg), true); + summaryRowEnd(); + summaryRow(0); + printSummaryComment(pkg); + space(); + summaryRowEnd(); + trEnd(); + } + + /** + * Print the class use list. + */ + protected void generateClassUse(PackageDoc pkg) throws IOException { + String classLink = getLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, false)); + String pkgLink = getPackageLink(pkg, Util.getPackageName(pkg), false); + classSubWriter.printUseInfo(pkgToClassAnnotations.get(pkg.name()), + configuration.getText("doclet.ClassUse_Annotation", classLink, + pkgLink)); + + classSubWriter.printUseInfo(pkgToClassTypeParameter.get(pkg.name()), + configuration.getText("doclet.ClassUse_TypeParameter", classLink, + pkgLink)); + classSubWriter.printUseInfo(pkgToSubclass.get(pkg.name()), + configuration.getText("doclet.ClassUse_Subclass", classLink, + pkgLink)); + classSubWriter.printUseInfo(pkgToSubinterface.get(pkg.name()), + configuration.getText("doclet.ClassUse_Subinterface", + classLink, + pkgLink)); + classSubWriter.printUseInfo(pkgToImplementingClass.get(pkg.name()), + configuration.getText("doclet.ClassUse_ImplementingClass", + classLink, + pkgLink)); + fieldSubWriter.printUseInfo(pkgToField.get(pkg.name()), + configuration.getText("doclet.ClassUse_Field", + classLink, + pkgLink)); + fieldSubWriter.printUseInfo(pkgToFieldAnnotations.get(pkg.name()), + configuration.getText("doclet.ClassUse_FieldAnnotations", + classLink, + pkgLink)); + fieldSubWriter.printUseInfo(pkgToFieldTypeParameter.get(pkg.name()), + configuration.getText("doclet.ClassUse_FieldTypeParameter", + classLink, + pkgLink)); + methodSubWriter.printUseInfo(pkgToMethodAnnotations.get(pkg.name()), + configuration.getText("doclet.ClassUse_MethodAnnotations", classLink, + pkgLink)); + methodSubWriter.printUseInfo(pkgToMethodParameterAnnotations.get(pkg.name()), + configuration.getText("doclet.ClassUse_MethodParameterAnnotations", classLink, + pkgLink)); + methodSubWriter.printUseInfo(pkgToMethodTypeParameter.get(pkg.name()), + configuration.getText("doclet.ClassUse_MethodTypeParameter", classLink, + pkgLink)); + methodSubWriter.printUseInfo(pkgToMethodReturn.get(pkg.name()), + configuration.getText("doclet.ClassUse_MethodReturn", + classLink, + pkgLink)); + methodSubWriter.printUseInfo(pkgToMethodReturnTypeParameter.get(pkg.name()), + configuration.getText("doclet.ClassUse_MethodReturnTypeParameter", classLink, + pkgLink)); + methodSubWriter.printUseInfo(pkgToMethodArgs.get(pkg.name()), + configuration.getText("doclet.ClassUse_MethodArgs", + classLink, + pkgLink)); + methodSubWriter.printUseInfo(pkgToMethodArgTypeParameter.get(pkg.name()), + configuration.getText("doclet.ClassUse_MethodArgsTypeParameters", + classLink, + pkgLink)); + methodSubWriter.printUseInfo(pkgToMethodThrows.get(pkg.name()), + configuration.getText("doclet.ClassUse_MethodThrows", + classLink, + pkgLink)); + constrSubWriter.printUseInfo(pkgToConstructorAnnotations.get(pkg.name()), + configuration.getText("doclet.ClassUse_ConstructorAnnotations", + classLink, + pkgLink)); + constrSubWriter.printUseInfo(pkgToConstructorParameterAnnotations.get(pkg.name()), + configuration.getText("doclet.ClassUse_ConstructorParameterAnnotations", + classLink, + pkgLink)); + constrSubWriter.printUseInfo(pkgToConstructorArgs.get(pkg.name()), + configuration.getText("doclet.ClassUse_ConstructorArgs", + classLink, + pkgLink)); + constrSubWriter.printUseInfo(pkgToConstructorArgTypeParameter.get(pkg.name()), + configuration.getText("doclet.ClassUse_ConstructorArgsTypeParameters", + classLink, + pkgLink)); + constrSubWriter.printUseInfo(pkgToConstructorThrows.get(pkg.name()), + configuration.getText("doclet.ClassUse_ConstructorThrows", + classLink, + pkgLink)); + } + + /** + * Print the header for the class use Listing. + */ + protected void printClassUseHeader() { + String cltype = configuration.getText(classdoc.isInterface()? + "doclet.Interface": + "doclet.Class"); + String clname = classdoc.qualifiedName(); + printHtmlHeader(configuration.getText("doclet.Window_ClassUse_Header", + cltype, clname), null, true); + printTop(); + navLinks(true); + hr(); + center(); + h2(); + boldText("doclet.ClassUse_Title", cltype, clname); + h2End(); + centerEnd(); + } + + /** + * Print the footer for the class use Listing. + */ + protected void printClassUseFooter() { + hr(); + navLinks(false); + printBottom(); + printBodyHtmlEnd(); + } + + + /** + * Print this package link + */ + protected void navLinkPackage() { + navCellStart(); + printHyperLink("../package-summary.html", "", + configuration.getText("doclet.Package"), true, "NavBarFont1"); + navCellEnd(); + } + + /** + * Print class page indicator + */ + protected void navLinkClass() { + navCellStart(); + printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_USE_HEADER, classdoc, "", + configuration.getText("doclet.Class"), true, "NavBarFont1")); + navCellEnd(); + } + + /** + * Print class use link + */ + protected void navLinkClassUse() { + navCellRevStart(); + fontStyle("NavBarFont1Rev"); + boldText("doclet.navClassUse"); + fontEnd(); + navCellEnd(); + } + + protected void navLinkTree() { + navCellStart(); + if (classdoc.containingPackage().isIncluded()) { + printHyperLink("../package-tree.html", "", + configuration.getText("doclet.Tree"), true, "NavBarFont1"); + } else { + printHyperLink(relativePath + "overview-tree.html", "", + configuration.getText("doclet.Tree"), true, "NavBarFont1"); + } + navCellEnd(); + } + +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java new file mode 100644 index 00000000000..3d6cc2df7a5 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java @@ -0,0 +1,600 @@ +/* + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.builders.*; +import com.sun.javadoc.*; + +import java.util.*; +import com.sun.tools.doclets.internal.toolkit.taglets.*; + +/** + * Generate the Class Information Page. + * @see com.sun.javadoc.ClassDoc + * @see java.util.Collections + * @see java.util.List + * @see java.util.ArrayList + * @see java.util.HashMap + * + * @author Atul M Dambalkar + * @author Robert Field + */ +public class ClassWriterImpl extends SubWriterHolderWriter + implements ClassWriter { + + protected ClassDoc classDoc; + + protected ClassTree classtree; + + protected ClassDoc prev; + + protected ClassDoc next; + + /** + * @param classDoc the class being documented. + * @param prevClass the previous class that was documented. + * @param nextClass the next class being documented. + * @param classTree the class tree for the given class. + */ + public ClassWriterImpl (ClassDoc classDoc, + ClassDoc prevClass, ClassDoc nextClass, ClassTree classTree) + throws Exception { + super(ConfigurationImpl.getInstance(), + DirectoryManager.getDirectoryPath(classDoc.containingPackage()), + classDoc.name() + ".html", + DirectoryManager.getRelativePath(classDoc.containingPackage().name())); + this.classDoc = classDoc; + configuration.currentcd = classDoc; + this.classtree = classTree; + this.prev = prevClass; + this.next = nextClass; + } + + /** + * Print this package link + */ + protected void navLinkPackage() { + navCellStart(); + printHyperLink("package-summary.html", "", + configuration.getText("doclet.Package"), true, "NavBarFont1"); + navCellEnd(); + } + + /** + * Print class page indicator + */ + protected void navLinkClass() { + navCellRevStart(); + fontStyle("NavBarFont1Rev"); + boldText("doclet.Class"); + fontEnd(); + navCellEnd(); + } + + /** + * Print class use link + */ + protected void navLinkClassUse() { + navCellStart(); + printHyperLink("class-use/" + filename, "", + configuration.getText("doclet.navClassUse"), true, "NavBarFont1"); + navCellEnd(); + } + + /** + * Print previous package link + */ + protected void navLinkPrevious() { + if (prev == null) { + printText("doclet.Prev_Class"); + } else { + printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, prev, "", + configuration.getText("doclet.Prev_Class"), true)); + } + } + + /** + * Print next package link + */ + protected void navLinkNext() { + if (next == null) { + printText("doclet.Next_Class"); + } else { + printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, next, "", + configuration.getText("doclet.Next_Class"), true)); + } + } + + /** + * {@inheritDoc} + */ + public void writeHeader(String header) { + String pkgname = (classDoc.containingPackage() != null)? + classDoc.containingPackage().name(): ""; + String clname = classDoc.name(); + printHtmlHeader(clname, + configuration.metakeywords.getMetaKeywords(classDoc), true); + printTop(); + navLinks(true); + hr(); + println(""); + h2(); + if (pkgname.length() > 0) { + font("-1"); print(pkgname); fontEnd(); br(); + } + LinkInfoImpl linkInfo = new LinkInfoImpl( LinkInfoImpl.CONTEXT_CLASS_HEADER, + classDoc, false); + //Let's not link to ourselves in the header. + linkInfo.linkToSelf = false; + print(header + getTypeParameterLinks(linkInfo)); + h2End(); + } + + /** + * {@inheritDoc} + */ + public void writeFooter() { + println(""); + hr(); + navLinks(false); + printBottom(); + printBodyHtmlEnd(); + } + + /** + * {@inheritDoc} + */ + public void writeClassSignature(String modifiers) { + boolean isInterface = classDoc.isInterface(); + dl(); + dt(); + preNoNewLine(); + writeAnnotationInfo(classDoc); + print(modifiers); + LinkInfoImpl linkInfo = new LinkInfoImpl( + LinkInfoImpl.CONTEXT_CLASS_SIGNATURE, classDoc, false); + //Let's not link to ourselves in the signature. + linkInfo.linkToSelf = false; + String name = classDoc.name() + + getTypeParameterLinks(linkInfo); + if (configuration().linksource) { + printSrcLink(classDoc, name); + } else { + bold(name); + } + if (!isInterface) { + Type superclass = Util.getFirstVisibleSuperClass(classDoc, + configuration()); + if (superclass != null) { + dt(); + print("extends "); + printLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME, + superclass)); + } + } + Type[] implIntfacs = classDoc.interfaceTypes(); + if (implIntfacs != null && implIntfacs.length > 0) { + int counter = 0; + for (int i = 0; i < implIntfacs.length; i++) { + ClassDoc classDoc = implIntfacs[i].asClassDoc(); + if (! (classDoc.isPublic() || + Util.isLinkable(classDoc, configuration()))) { + continue; + } + if (counter == 0) { + dt(); + print(isInterface? "extends " : "implements "); + } else { + print(", "); + } + printLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_CLASS_SIGNATURE_PARENT_NAME, + implIntfacs[i])); + counter++; + } + } + dlEnd(); + preEnd(); + p(); + } + + /** + * {@inheritDoc} + */ + public void writeClassDescription() { + if(!configuration.nocomment) { + // generate documentation for the class. + if (classDoc.inlineTags().length > 0) { + printInlineComment(classDoc); + p(); + } + } + } + + /** + * {@inheritDoc} + */ + public void writeClassTagInfo() { + if(!configuration.nocomment) { + // Print Information about all the tags here + printTags(classDoc); + hr(); + p(); + } else { + hr(); + } + } + + /** + * {@inheritDoc} + */ + public void writeClassDeprecationInfo() { + hr(); + Tag[] deprs = classDoc.tags("deprecated"); + if (Util.isDeprecated(classDoc)) { + boldText("doclet.Deprecated"); + if (deprs.length > 0) { + Tag[] commentTags = deprs[0].inlineTags(); + if (commentTags.length > 0) { + space(); + printInlineDeprecatedComment(classDoc, deprs[0]); + } + } + p(); + } + } + + /** + * Generate the indent and get the line image for the class tree. + * For user accessibility, the image includes the alt attribute + * "extended by". (This method is not intended for a class + * implementing an interface, where "implemented by" would be required.) + * + * indent integer indicating the number of spaces to indent + */ + private void writeStep(int indent) { + print(spaces(4 * indent - 2)); + print(""); + } + + /** + * Print the class hierarchy tree for the given class. + * @param type the class to print the hierarchy for. + * @return return the amount that should be indented in + * the next level of the tree. + */ + private int writeTreeForClassHelper(Type type) { + Type sup = Util.getFirstVisibleSuperClass( + type instanceof ClassDoc ? (ClassDoc) type : type.asClassDoc(), + configuration()); + int indent = 0; + if (sup != null) { + indent = writeTreeForClassHelper(sup); + writeStep(indent); + } + + if (type.equals(classDoc)) { + String typeParameters = getTypeParameterLinks( + new LinkInfoImpl( + LinkInfoImpl.CONTEXT_TREE, + classDoc, false)); + if (configuration.shouldExcludeQualifier( + classDoc.containingPackage().name())) { + bold(type.asClassDoc().name() + typeParameters); + } else { + bold(type.asClassDoc().qualifiedName() + typeParameters); + } + } else { + print(getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS_TREE_PARENT, + type instanceof ClassDoc ? (ClassDoc) type : type, + configuration.getClassName(type.asClassDoc()), false))); + } + println(); + return indent + 1; + } + + /** + * Print the class hierarchy tree for this class only. + */ + public void writeClassTree() { + if (! classDoc.isClass()) { + return; + } + pre(); + writeTreeForClassHelper(classDoc); + preEnd(); + } + + /** + * Write the type parameter information. + */ + public void writeTypeParamInfo() { + if (classDoc.typeParamTags().length > 0) { + dl(); + dt(); + TagletOutput output = (new ParamTaglet()).getTagletOutput(classDoc, + getTagletWriterInstance(false)); + print(output.toString()); + dlEnd(); + } + } + + /** + * {@inheritDoc} + */ + public void writeSubClassInfo() { + if (classDoc.isClass()) { + if (classDoc.qualifiedName().equals("java.lang.Object") || + classDoc.qualifiedName().equals("org.omg.CORBA.Object")) { + return; // Don't generate the list, too huge + } + List subclasses = classtree.subs(classDoc, false); + if (subclasses.size() > 0) { + dl(); + dt(); + boldText("doclet.Subclasses"); + writeClassLinks(LinkInfoImpl.CONTEXT_SUBCLASSES, + subclasses); + } + } + } + + /** + * {@inheritDoc} + */ + public void writeSubInterfacesInfo() { + if (classDoc.isInterface()) { + List subInterfaces = classtree.allSubs(classDoc, false); + if (subInterfaces.size() > 0) { + dl(); + dt(); + boldText("doclet.Subinterfaces"); + writeClassLinks(LinkInfoImpl.CONTEXT_SUBINTERFACES, + subInterfaces); + } + } + } + + /** + * If this is the interface which are the classes, that implement this? + */ + public void writeInterfaceUsageInfo () { + if (! classDoc.isInterface()) { + return; + } + if (classDoc.qualifiedName().equals("java.lang.Cloneable") || + classDoc.qualifiedName().equals("java.io.Serializable")) { + return; // Don't generate the list, too big + } + List implcl = classtree.implementingclasses(classDoc); + if (implcl.size() > 0) { + dl(); + dt(); + boldText("doclet.Implementing_Classes"); + writeClassLinks(LinkInfoImpl.CONTEXT_IMPLEMENTED_CLASSES, + implcl); + } + } + + /** + * {@inheritDoc} + */ + public void writeImplementedInterfacesInfo() { + //NOTE: we really should be using ClassDoc.interfaceTypes() here, but + // it doesn't walk up the tree like we want it to. + List interfaceArray = Util.getAllInterfaces(classDoc, configuration); + if (classDoc.isClass() && interfaceArray.size() > 0) { + dl(); + dt(); + boldText("doclet.All_Implemented_Interfaces"); + writeClassLinks(LinkInfoImpl.CONTEXT_IMPLEMENTED_INTERFACES, + interfaceArray); + } + } + + /** + * {@inheritDoc} + */ + public void writeSuperInterfacesInfo() { + //NOTE: we really should be using ClassDoc.interfaceTypes() here, but + // it doesn't walk up the tree like we want it to. + List interfaceArray = Util.getAllInterfaces(classDoc, configuration); + if (classDoc.isInterface() && interfaceArray.size() > 0) { + dl(); + dt(); + boldText("doclet.All_Superinterfaces"); + writeClassLinks(LinkInfoImpl.CONTEXT_SUPER_INTERFACES, + interfaceArray); + } + } + + /** + * Generate links to the given classes. + */ + private void writeClassLinks(int context, List list) { + Object[] typeList = list.toArray(); + //Sort the list to be printed. + print(' '); + dd(); + for (int i = 0; i < list.size(); i++) { + if (i > 0) { + print(", "); + } + if (typeList[i] instanceof ClassDoc) { + printLink(new LinkInfoImpl(context, (ClassDoc)(typeList[i]))); + + } else { + printLink(new LinkInfoImpl(context, (Type)(typeList[i]))); + } + } + ddEnd(); + dlEnd(); + } + + protected void navLinkTree() { + navCellStart(); + printHyperLink("package-tree.html", "", + configuration.getText("doclet.Tree"), true, "NavBarFont1"); + navCellEnd(); + } + + protected void printSummaryDetailLinks() { + try { + tr(); + tdVAlignClass("top", "NavBarCell3"); + font("-2"); + print(" "); + navSummaryLinks(); + fontEnd(); + tdEnd(); + tdVAlignClass("top", "NavBarCell3"); + font("-2"); + navDetailLinks(); + fontEnd(); + tdEnd(); + trEnd(); + } catch (Exception e) { + e.printStackTrace(); + throw new DocletAbortException(); + } + } + + protected void navSummaryLinks() throws Exception { + printText("doclet.Summary"); + space(); + MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder) + configuration.getBuilderFactory().getMemberSummaryBuilder(this); + String[] navLinkLabels = new String[] { + "doclet.navNested", "doclet.navEnum", "doclet.navField", "doclet.navConstructor", + "doclet.navMethod" + }; + for (int i = 0; i < navLinkLabels.length; i++ ) { + if (i == VisibleMemberMap.ENUM_CONSTANTS && ! classDoc.isEnum()) { + continue; + } + if (i == VisibleMemberMap.CONSTRUCTORS && classDoc.isEnum()) { + continue; + } + AbstractMemberWriter writer = + ((AbstractMemberWriter) memberSummaryBuilder. + getMemberSummaryWriter(i)); + if (writer == null) { + printText(navLinkLabels[i]); + } else { + writer.navSummaryLink( + memberSummaryBuilder.members(i), + memberSummaryBuilder.getVisibleMemberMap(i)); + } + if (i < navLinkLabels.length-1) { + navGap(); + } + } + } + + /** + * Method navDetailLinks + * + * @throws Exception + * + */ + protected void navDetailLinks() throws Exception { + printText("doclet.Detail"); + space(); + MemberSummaryBuilder memberSummaryBuilder = (MemberSummaryBuilder) + configuration.getBuilderFactory().getMemberSummaryBuilder(this); + String[] navLinkLabels = new String[] { + "doclet.navNested", "doclet.navEnum", "doclet.navField", "doclet.navConstructor", + "doclet.navMethod" + }; + for (int i = 1; i < navLinkLabels.length; i++ ) { + AbstractMemberWriter writer = + ((AbstractMemberWriter) memberSummaryBuilder. + getMemberSummaryWriter(i)); + if (i == VisibleMemberMap.ENUM_CONSTANTS && ! classDoc.isEnum()) { + continue; + } + if (i == VisibleMemberMap.CONSTRUCTORS && classDoc.isEnum()) { + continue; + } + if (writer == null) { + printText(navLinkLabels[i]); + } else { + writer.navDetailLink(memberSummaryBuilder.members(i)); + } + if (i < navLinkLabels.length - 1) { + navGap(); + } + } + } + + protected void navGap() { + space(); + print('|'); + space(); + } + + /** + * If this is an inner class or interface, write the enclosing class or + * interface. + */ + public void writeNestedClassInfo() { + ClassDoc outerClass = classDoc.containingClass(); + if (outerClass != null) { + dl(); + dt(); + if (outerClass.isInterface()) { + boldText("doclet.Enclosing_Interface"); + } else { + boldText("doclet.Enclosing_Class"); + } + dd(); + printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CLASS, outerClass, + false)); + ddEnd(); + dlEnd(); + } + } + + /** + * Return the classDoc being documented. + * + * @return the classDoc being documented. + */ + public ClassDoc getClassDoc() { + return classDoc; + } + + /** + * {@inheritDoc} + */ + public void completeMemberSummaryBuild() { + p(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java new file mode 100644 index 00000000000..4ea6d38c13f --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java @@ -0,0 +1,487 @@ +/* + * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; + +import com.sun.javadoc.*; +import java.util.*; +import java.io.*; + +/** + * Configure the output based on the command line options. + *

+ * Also determine the length of the command line option. For example, + * for a option "-header" there will be a string argument associated, then the + * the length of option "-header" is two. But for option "-nohelp" no argument + * is needed so it's length is 1. + *

+ *

+ * Also do the error checking on the options used. For example it is illegal to + * use "-helpfile" option when already "-nohelp" option is used. + *

+ * + * @author Robert Field. + * @author Atul Dambalkar. + * @author Jamie Ho + */ +public class ConfigurationImpl extends Configuration { + + private static final ConfigurationImpl instance = new ConfigurationImpl(); + + /** + * The build date. Note: For now, we will use + * a version number instead of a date. + */ + public static final String BUILD_DATE = System.getProperty("java.version"); + + /** + * The name of the constant values file. + */ + public static final String CONSTANTS_FILE_NAME = "constant-values.html"; + + /** + * Argument for command line option "-header". + */ + public String header = ""; + + /** + * Argument for command line option "-packagesheader". + */ + public String packagesheader = ""; + + /** + * Argument for command line option "-footer". + */ + public String footer = ""; + + /** + * Argument for command line option "-doctitle". + */ + public String doctitle = ""; + + /** + * Argument for command line option "-windowtitle". + */ + public String windowtitle = ""; + + /** + * Argument for command line option "-top". + */ + public String top = ""; + + /** + * Argument for command line option "-bottom". + */ + public String bottom = ""; + + /** + * Argument for command line option "-helpfile". + */ + public String helpfile = ""; + + /** + * Argument for command line option "-stylesheetfile". + */ + public String stylesheetfile = ""; + + /** + * True if command line option "-nohelp" is used. Default value is false. + */ + public boolean nohelp = false; + + /** + * True if command line option "-splitindex" is used. Default value is + * false. + */ + public boolean splitindex = false; + + /** + * False if command line option "-noindex" is used. Default value is true. + */ + public boolean createindex = true; + + /** + * True if command line option "-use" is used. Default value is false. + */ + public boolean classuse = false; + + /** + * False if command line option "-notree" is used. Default value is true. + */ + public boolean createtree = true; + + /** + * True if command line option "-nodeprecated" is used. Default value is + * false. + */ + public boolean nodeprecatedlist = false; + + /** + * True if command line option "-nonavbar" is used. Default value is false. + */ + public boolean nonavbar = false; + + /** + * True if command line option "-nooverview" is used. Default value is + * false + */ + private boolean nooverview = false; + + /** + * True if command line option "-overview" is used. Default value is false. + */ + public boolean overview = false; + + /** + * This is true if option "-overview" is used or option "-overview" is not + * used and number of packages is more than one. + */ + public boolean createoverview = false; + + /** + * Unique Resource Handler for this package. + */ + public final MessageRetriever standardmessage; + + /** + * First file to appear in the right-hand frame in the generated + * documentation. + */ + public String topFile = ""; + + /** + * The classdoc for the class file getting generated. + */ + public ClassDoc currentcd = null; // Set this classdoc in the + // ClassWriter. + + /** + * Constructor. Initialises resource for the + * {@link com.sun.tools.doclets.MessageRetriever}. + */ + private ConfigurationImpl() { + standardmessage = new MessageRetriever(this, + "com.sun.tools.doclets.formats.html.resources.standard"); + } + + public static ConfigurationImpl getInstance() { + return instance; + } + + /** + * Return the build date for the doclet. + */ + public String getDocletSpecificBuildDate() { + return BUILD_DATE; + } + + /** + * Depending upon the command line options provided by the user, set + * configure the output generation environment. + * + * @param options The array of option names and values. + */ + public void setSpecificDocletOptions(String[][] options) { + for (int oi = 0; oi < options.length; ++oi) { + String[] os = options[oi]; + String opt = os[0].toLowerCase(); + if (opt.equals("-footer")) { + footer = os[1]; + } else if (opt.equals("-header")) { + header = os[1]; + } else if (opt.equals("-packagesheader")) { + packagesheader = os[1]; + } else if (opt.equals("-doctitle")) { + doctitle = os[1]; + } else if (opt.equals("-windowtitle")) { + windowtitle = os[1]; + } else if (opt.equals("-top")) { + top = os[1]; + } else if (opt.equals("-bottom")) { + bottom = os[1]; + } else if (opt.equals("-helpfile")) { + helpfile = os[1]; + } else if (opt.equals("-stylesheetfile")) { + stylesheetfile = os[1]; + } else if (opt.equals("-charset")) { + charset = os[1]; + } else if (opt.equals("-nohelp")) { + nohelp = true; + } else if (opt.equals("-splitindex")) { + splitindex = true; + } else if (opt.equals("-noindex")) { + createindex = false; + } else if (opt.equals("-use")) { + classuse = true; + } else if (opt.equals("-notree")) { + createtree = false; + } else if (opt.equals("-nodeprecatedlist")) { + nodeprecatedlist = true; + } else if (opt.equals("-nosince")) { + nosince = true; + } else if (opt.equals("-nonavbar")) { + nonavbar = true; + } else if (opt.equals("-nooverview")) { + nooverview = true; + } else if (opt.equals("-overview")) { + overview = true; + } + } + if (root.specifiedClasses().length > 0) { + Map map = new HashMap(); + PackageDoc pd; + ClassDoc[] classes = root.classes(); + for (int i = 0; i < classes.length; i++) { + pd = classes[i].containingPackage(); + if(! map.containsKey(pd.name())) { + map.put(pd.name(), pd); + } + } + } + setCreateOverview(); + setTopFile(root); + } + + /** + * Returns the "length" of a given option. If an option takes no + * arguments, its length is one. If it takes one argument, it's + * length is two, and so on. This method is called by JavaDoc to + * parse the options it does not recognize. It then calls + * {@link #validOptions(String[][], DocErrorReporter)} to + * validate them. + * Note:
+ * The options arrive as case-sensitive strings. For options that + * are not case-sensitive, use toLowerCase() on the option string + * before comparing it. + * + * + * @return number of arguments + 1 for a option. Zero return means + * option not known. Negative value means error occurred. + */ + public int optionLength(String option) { + int result = -1; + if ((result = super.optionLength(option)) > 0) { + return result; + } + // otherwise look for the options we have added + option = option.toLowerCase(); + if (option.equals("-nodeprecatedlist") || + option.equals("-noindex") || + option.equals("-notree") || + option.equals("-nohelp") || + option.equals("-splitindex") || + option.equals("-serialwarn") || + option.equals("-use") || + option.equals("-nonavbar") || + option.equals("-nooverview")) { + return 1; + } else if (option.equals("-help")) { + System.out.println(getText("doclet.usage")); + return 1; + } else if (option.equals("-footer") || + option.equals("-header") || + option.equals("-packagesheader") || + option.equals("-doctitle") || + option.equals("-windowtitle") || + option.equals("-top") || + option.equals("-bottom") || + option.equals("-helpfile") || + option.equals("-stylesheetfile") || + option.equals("-charset") || + option.equals("-overview")) { + return 2; + } else { + return 0; + } + } + + /** + * {@inheritDoc} + */ + public boolean validOptions(String options[][], + DocErrorReporter reporter) { + boolean helpfile = false; + boolean nohelp = false; + boolean overview = false; + boolean nooverview = false; + boolean splitindex = false; + boolean noindex = false; + // check shared options + if (!generalValidOptions(options, reporter)) { + return false; + } + // otherwise look at our options + for (int oi = 0; oi < options.length; ++oi) { + String[] os = options[oi]; + String opt = os[0].toLowerCase(); + if (opt.equals("-helpfile")) { + if (nohelp == true) { + reporter.printError(getText("doclet.Option_conflict", + "-helpfile", "-nohelp")); + return false; + } + if (helpfile == true) { + reporter.printError(getText("doclet.Option_reuse", + "-helpfile")); + return false; + } + File help = new File(os[1]); + if (!help.exists()) { + reporter.printError(getText("doclet.File_not_found", os[1])); + return false; + } + helpfile = true; + } else if (opt.equals("-nohelp")) { + if (helpfile == true) { + reporter.printError(getText("doclet.Option_conflict", + "-nohelp", "-helpfile")); + return false; + } + nohelp = true; + } else if (opt.equals("-overview")) { + if (nooverview == true) { + reporter.printError(getText("doclet.Option_conflict", + "-overview", "-nooverview")); + return false; + } + if (overview == true) { + reporter.printError(getText("doclet.Option_reuse", + "-overview")); + return false; + } + overview = true; + } else if (opt.equals("-nooverview")) { + if (overview == true) { + reporter.printError(getText("doclet.Option_conflict", + "-nooverview", "-overview")); + return false; + } + nooverview = true; + } else if (opt.equals("-splitindex")) { + if (noindex == true) { + reporter.printError(getText("doclet.Option_conflict", + "-splitindex", "-noindex")); + return false; + } + splitindex = true; + } else if (opt.equals("-noindex")) { + if (splitindex == true) { + reporter.printError(getText("doclet.Option_conflict", + "-noindex", "-splitindex")); + return false; + } + noindex = true; + } + } + return true; + } + + /** + * {@inheritDoc} + */ + public MessageRetriever getDocletSpecificMsg() { + return standardmessage; + } + + /** + * Decide the page which will appear first in the right-hand frame. It will + * be "overview-summary.html" if "-overview" option is used or no + * "-overview" but the number of packages is more than one. It will be + * "package-summary.html" of the respective package if there is only one + * package to document. It will be a class page(first in the sorted order), + * if only classes are provided on the command line. + * + * @param root Root of the program structure. + */ + protected void setTopFile(RootDoc root) { + if (!checkForDeprecation(root)) { + return; + } + if (createoverview) { + topFile = "overview-summary.html"; + } else { + if (packages.length == 1 && packages[0].name().equals("")) { + if (root.classes().length > 0) { + ClassDoc[] classarr = root.classes(); + Arrays.sort(classarr); + ClassDoc cd = getValidClass(classarr); + topFile = DirectoryManager.getPathToClass(cd); + } + } else { + topFile = DirectoryManager.getPathToPackage(packages[0], + "package-summary.html"); + } + } + } + + protected ClassDoc getValidClass(ClassDoc[] classarr) { + if (!nodeprecated) { + return classarr[0]; + } + for (int i = 0; i < classarr.length; i++) { + if (classarr[i].tags("deprecated").length == 0) { + return classarr[i]; + } + } + return null; + } + + protected boolean checkForDeprecation(RootDoc root) { + ClassDoc[] classarr = root.classes(); + for (int i = 0; i < classarr.length; i++) { + if (isGeneratedDoc(classarr[i])) { + return true; + } + } + return false; + } + + /** + * Generate "overview.html" page if option "-overview" is used or number of + * packages is more than one. Sets {@link #createoverview} field to true. + */ + protected void setCreateOverview() { + if ((overview || packages.length > 1) && !nooverview) { + createoverview = true; + } + } + + /** + * {@inheritDoc} + */ + public WriterFactory getWriterFactory() { + return WriterFactoryImpl.getInstance(); + } + + /** + * {@inheritDoc} + */ + public Comparator getMemberComparator() { + return null; + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java new file mode 100644 index 00000000000..24cefb2e896 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java @@ -0,0 +1,244 @@ +/* + * Copyright 2001-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.javadoc.*; +import java.io.*; +import java.util.*; + +/** + * Write the Constants Summary Page in HTML format. + * + * @author Jamie Ho + * @since 1.4 + */ +public class ConstantsSummaryWriterImpl extends HtmlDocletWriter + implements ConstantsSummaryWriter { + + /** + * The configuration used in this run of the standard doclet. + */ + ConfigurationImpl configuration; + + /** + * The current class being documented. + */ + private ClassDoc currentClassDoc; + + /** + * Construct a ConstantsSummaryWriter. + * @param configuration the configuration used in this run + * of the standard doclet. + */ + public ConstantsSummaryWriterImpl(ConfigurationImpl configuration) + throws IOException { + super(configuration, ConfigurationImpl.CONSTANTS_FILE_NAME); + this.configuration = configuration; + } + + /** + * {@inheritDoc} + */ + public void writeHeader() { + printHtmlHeader(configuration.getText("doclet.Constants_Summary"), + null, true); + printTop(); + navLinks(true); + hr(); + + center(); + h1(); printText("doclet.Constants_Summary"); h1End(); + centerEnd(); + + hr(4, "noshade"); + } + + /** + * {@inheritDoc} + */ + public void writeFooter() { + hr(); + navLinks(false); + printBottom(); + printBodyHtmlEnd(); + } + + /** + * {@inheritDoc} + */ + public void writeContentsHeader() { + bold(configuration.getText("doclet.Contents")); + ul(); + } + + /** + * {@inheritDoc} + */ + public void writeContentsFooter() { + ulEnd(); + println(); + } + + /** + * {@inheritDoc} + */ + public void writeLinkToPackageContent(PackageDoc pkg, String parsedPackageName, Set printedPackageHeaders) { + String packageName = pkg.name(); + //add link to summary + li(); + if (packageName.length() == 0) { + printHyperLink("#" + DocletConstants.UNNAMED_PACKAGE_ANCHOR, + DocletConstants.DEFAULT_PACKAGE_NAME); + } else { + printHyperLink("#" + parsedPackageName, parsedPackageName + ".*"); + printedPackageHeaders.add(parsedPackageName); + } + println(); + } + + /** + * {@inheritDoc} + */ + public void writeConstantMembersHeader(ClassDoc cd) { + //generate links backward only to public classes. + String classlink = (cd.isPublic() || cd.isProtected())? + getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CONSTANT_SUMMARY, cd, + false)) : + cd.qualifiedName(); + String name = cd.containingPackage().name(); + if (name.length() > 0) { + writeClassName(name + "." + classlink); + } else { + writeClassName(classlink); + } + } + + /** + * {@inheritDoc} + */ + public void writeConstantMembersFooter(ClassDoc cd) { + tableFooter(false); + p(); + } + + /** + * Print the class name in the table heading. + * @param classStr the heading to print. + */ + protected void writeClassName(String classStr) { + table(1, 3, 0); + trBgcolorStyle("#EEEEFF", "TableSubHeadingColor"); + thAlignColspan("left", 3); + write(classStr); + thEnd(); + trEnd(); + } + + private void tableFooter(boolean isHeader) { + fontEnd(); + if (isHeader) { + thEnd(); + } else { + tdEnd(); + } + trEnd(); + tableEnd(); + p(); + } + + /** + * {@inheritDoc} + */ + public void writePackageName(PackageDoc pkg, String parsedPackageName) { + String pkgname; + if (parsedPackageName.length() == 0) { + anchor(DocletConstants.UNNAMED_PACKAGE_ANCHOR); + pkgname = DocletConstants.DEFAULT_PACKAGE_NAME; + } else { + anchor(parsedPackageName); + pkgname = parsedPackageName; + } + table(1, "100%", 3, 0); + trBgcolorStyle("#CCCCFF", "TableHeadingColor"); + thAlign("left"); + font("+2"); + write(pkgname + ".*"); + tableFooter(true); + } + + /** + * {@inheritDoc} + */ + public void writeConstantMembers(ClassDoc cd, List fields) { + currentClassDoc = cd; + for (int i = 0; i < fields.size(); ++i) { + writeConstantMember((FieldDoc)(fields.get(i))); + } + } + + private void writeConstantMember(FieldDoc member) { + trBgcolorStyle("white", "TableRowColor"); + anchor(currentClassDoc.qualifiedName() + "." + member.name()); + writeTypeColumn(member); + writeNameColumn(member); + writeValue(member); + trEnd(); + } + + private void writeTypeColumn(FieldDoc member) { + tdAlign("right"); + font("-1"); + code(); + StringTokenizer mods = new StringTokenizer(member.modifiers()); + while(mods.hasMoreTokens()) { + print(mods.nextToken() + " "); + } + printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_CONSTANT_SUMMARY, + member.type())); + codeEnd(); + fontEnd(); + tdEnd(); + } + + private void writeNameColumn(FieldDoc member) { + tdAlign("left"); + code(); + printDocLink(LinkInfoImpl.CONTEXT_CONSTANT_SUMMARY, member, + member.name(), false); + codeEnd(); + tdEnd(); + } + + private void writeValue(FieldDoc member) { + tdAlign("right"); + code(); + print(Util.escapeHtmlChars(member.constantValueExpression())); + codeEnd(); + tdEnd(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java new file mode 100644 index 00000000000..979553e77cf --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java @@ -0,0 +1,306 @@ +/* + * Copyright 1997-2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.taglets.*; +import com.sun.javadoc.*; +import java.util.*; +import java.io.*; + +/** + * Writes constructor documentation. + * + * @author Robert Field + * @author Atul M Dambalkar + */ +public class ConstructorWriterImpl extends AbstractExecutableMemberWriter + implements ConstructorWriter, MemberSummaryWriter { + + private boolean foundNonPubConstructor = false; + private boolean printedSummaryHeader = false; + + /** + * Construct a new ConstructorWriterImpl. + * + * @param writer The writer for the class that the constructors belong to. + * @param classDoc the class being documented. + */ + public ConstructorWriterImpl(SubWriterHolderWriter writer, + ClassDoc classDoc) { + super(writer, classDoc); + VisibleMemberMap visibleMemberMap = new VisibleMemberMap(classDoc, + VisibleMemberMap.CONSTRUCTORS, configuration().nodeprecated); + List constructors = new ArrayList(visibleMemberMap.getMembersFor(classDoc)); + for (int i = 0; i < constructors.size(); i++) { + if (((ProgramElementDoc)(constructors.get(i))).isProtected() || + ((ProgramElementDoc)(constructors.get(i))).isPrivate()) { + setFoundNonPubConstructor(true); + } + } + } + + /** + * Construct a new ConstructorWriterImpl. + * + * @param writer The writer for the class that the constructors belong to. + */ + public ConstructorWriterImpl(SubWriterHolderWriter writer) { + super(writer); + } + + /** + * Write the constructors summary header for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeMemberSummaryHeader(ClassDoc classDoc) { + printedSummaryHeader = true; + writer.println(); + writer.println(""); + writer.println(); + writer.printSummaryHeader(this, classDoc); + } + + /** + * Write the constructors summary footer for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeMemberSummaryFooter(ClassDoc classDoc) { + writer.printSummaryFooter(this, classDoc); + } + + /** + * Write the header for the constructor documentation. + * + * @param classDoc the class that the constructors belong to. + */ + public void writeHeader(ClassDoc classDoc, String header) { + writer.println(); + writer.println(""); + writer.println(); + writer.anchor("constructor_detail"); + writer.printTableHeadingBackground(header); + } + + /** + * Write the constructor header for the given constructor. + * + * @param constructor the constructor being documented. + * @param isFirst the flag to indicate whether or not the constructor is the + * first to be documented. + */ + public void writeConstructorHeader(ConstructorDoc constructor, boolean isFirst) { + if (! isFirst) { + writer.printMemberHeader(); + } + writer.println(); + String erasureAnchor; + if ((erasureAnchor = getErasureAnchor(constructor)) != null) { + writer.anchor(erasureAnchor); + } + writer.anchor(constructor); + writer.h3(); + writer.print(constructor.name()); + writer.h3End(); + } + + /** + * Write the signature for the given constructor. + * + * @param constructor the constructor being documented. + */ + public void writeSignature(ConstructorDoc constructor) { + writer.displayLength = 0; + writer.pre(); + writer.writeAnnotationInfo(constructor); + printModifiers(constructor); + //printReturnType((ConstructorDoc)constructor); + if (configuration().linksource) { + writer.printSrcLink(constructor, constructor.name()); + } else { + bold(constructor.name()); + } + writeParameters(constructor); + writeExceptions(constructor); + writer.preEnd(); + writer.dl(); + } + + /** + * Write the deprecated output for the given constructor. + * + * @param constructor the constructor being documented. + */ + public void writeDeprecated(ConstructorDoc constructor) { + String output = ((TagletOutputImpl) + (new DeprecatedTaglet()).getTagletOutput(constructor, + writer.getTagletWriterInstance(false))).toString(); + if (output != null && output.trim().length() > 0) { + writer.print(output); + } + } + + /** + * Write the comments for the given constructor. + * + * @param constructor the constructor being documented. + */ + public void writeComments(ConstructorDoc constructor) { + if (constructor.inlineTags().length > 0) { + writer.dd(); + writer.printInlineComment(constructor); + } + } + + /** + * Write the tag output for the given constructor. + * + * @param constructor the constructor being documented. + */ + public void writeTags(ConstructorDoc constructor) { + writer.printTags(constructor); + } + + /** + * Write the constructor footer. + */ + public void writeConstructorFooter() { + writer.dlEnd(); + } + + /** + * Write the footer for the constructor documentation. + * + * @param classDoc the class that the constructors belong to. + */ + public void writeFooter(ClassDoc classDoc) { + //No footer to write for constructor documentation + } + + /** + * Close the writer. + */ + public void close() throws IOException { + writer.close(); + } + + /** + * Let the writer know whether a non public constructor was found. + * + * @param foundNonPubConstructor true if we found a non public constructor. + */ + public void setFoundNonPubConstructor(boolean foundNonPubConstructor) { + this.foundNonPubConstructor = foundNonPubConstructor; + } + + public void printSummaryLabel(ClassDoc cd) { + writer.boldText("doclet.Constructor_Summary"); + } + + public void printSummaryAnchor(ClassDoc cd) { + writer.anchor("constructor_summary"); + } + + public void printInheritedSummaryAnchor(ClassDoc cd) { + } // no such + + public void printInheritedSummaryLabel(ClassDoc cd) { + // no such + } + + public int getMemberKind() { + return VisibleMemberMap.CONSTRUCTORS; + } + + protected void navSummaryLink(List members) { + printNavSummaryLink(classdoc, + members.size() > 0? true: false); + } + + protected void printNavSummaryLink(ClassDoc cd, boolean link) { + if (link) { + writer.printHyperLink("", "constructor_summary", + ConfigurationImpl.getInstance().getText("doclet.navConstructor")); + } else { + writer.printText("doclet.navConstructor"); + } + } + + protected void printNavDetailLink(boolean link) { + if (link) { + writer.printHyperLink("", "constructor_detail", + ConfigurationImpl.getInstance().getText("doclet.navConstructor")); + } else { + writer.printText("doclet.navConstructor"); + } + } + + protected void printSummaryType(ProgramElementDoc member) { + if (foundNonPubConstructor) { + writer.printTypeSummaryHeader(); + if (member.isProtected()) { + print("protected "); + } else if (member.isPrivate()) { + print("private "); + } else if (member.isPublic()) { + writer.space(); + } else { + writer.printText("doclet.Package_private"); + } + writer.printTypeSummaryFooter(); + } + } + + /** + * Write the inherited member summary header for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) { + if(! printedSummaryHeader){ + //We don't want inherited summary to not be under heading. + writeMemberSummaryHeader(classDoc); + writeMemberSummaryFooter(classDoc); + printedSummaryHeader = true; + } + } + + /** + * {@inheritDoc} + */ + public void writeInheritedMemberSummary(ClassDoc classDoc, + ProgramElementDoc member, boolean isFirst, boolean isLast) {} + + /** + * Write the inherited member summary footer for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) {} +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java new file mode 100644 index 00000000000..2d7ccc88137 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java @@ -0,0 +1,187 @@ +/* + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.util.DeprecatedAPIListBuilder; +import com.sun.tools.doclets.internal.toolkit.util.*; +import java.io.*; + +/** + * Generate File to list all the deprecated classes and class members with the + * appropriate links. + * + * @see java.util.List + * @author Atul M Dambalkar + */ +public class DeprecatedListWriter extends SubWriterHolderWriter { + + private static final String[] ANCHORS = new String[] { + "interface", "class", "enum", "exception", "error", "annotation_type", + "field", "method", "constructor", "enum_constant", + "annotation_type_member" + }; + + private static final String[] HEADING_KEYS = new String[] { + "doclet.Deprecated_Interfaces", "doclet.Deprecated_Classes", + "doclet.Deprecated_Enums", "doclet.Deprecated_Exceptions", + "doclet.Deprecated_Errors", + "doclet.Deprecated_Annotation_Types", + "doclet.Deprecated_Fields", + "doclet.Deprecated_Methods", "doclet.Deprecated_Constructors", + "doclet.Deprecated_Enum_Constants", + "doclet.Deprecated_Annotation_Type_Members" + }; + + private AbstractMemberWriter[] writers; + + private ConfigurationImpl configuration; + + /** + * Constructor. + * + * @param filename the file to be generated. + */ + public DeprecatedListWriter(ConfigurationImpl configuration, + String filename) throws IOException { + super(configuration, filename); + this.configuration = configuration; + NestedClassWriterImpl classW = new NestedClassWriterImpl(this); + writers = new AbstractMemberWriter[] + {classW, classW, classW, classW, classW, classW, + new FieldWriterImpl(this), + new MethodWriterImpl(this), + new ConstructorWriterImpl(this), + new EnumConstantWriterImpl(this), + new AnnotationTypeOptionalMemberWriterImpl(this, null)}; + } + + /** + * Get list of all the deprecated classes and members in all the Packages + * specified on the Command Line. + * Then instantiate DeprecatedListWriter and generate File. + * + * @param configuration the current configuration of the doclet. + */ + public static void generate(ConfigurationImpl configuration) { + String filename = "deprecated-list.html"; + try { + DeprecatedListWriter depr = + new DeprecatedListWriter(configuration, filename); + depr.generateDeprecatedListFile( + new DeprecatedAPIListBuilder(configuration.root)); + depr.close(); + } catch (IOException exc) { + configuration.standardmessage.error( + "doclet.exception_encountered", + exc.toString(), filename); + throw new DocletAbortException(); + } + } + + /** + * Print the deprecated API list. Separately print all class kinds and + * member kinds. + * + * @param deprapi list of deprecated API built already. + */ + protected void generateDeprecatedListFile(DeprecatedAPIListBuilder deprapi) + throws IOException { + writeHeader(); + + bold(configuration.getText("doclet.Contents")); + ul(); + for (int i = 0; i < DeprecatedAPIListBuilder.NUM_TYPES; i++) { + writeIndexLink(deprapi, i); + } + ulEnd(); + println(); + + for (int i = 0; i < DeprecatedAPIListBuilder.NUM_TYPES; i++) { + if (deprapi.hasDocumentation(i)) { + writeAnchor(deprapi, i); + writers[i].printDeprecatedAPI(deprapi.getList(i), + HEADING_KEYS[i]); + } + } + printDeprecatedFooter(); + } + + private void writeIndexLink(DeprecatedAPIListBuilder builder, + int type) { + if (builder.hasDocumentation(type)) { + li(); + printHyperLink("#" + ANCHORS[type], + configuration.getText(HEADING_KEYS[type])); + println(); + } + } + + private void writeAnchor(DeprecatedAPIListBuilder builder, int type) { + if (builder.hasDocumentation(type)) { + anchor(ANCHORS[type]); + } + } + + /** + * Print the navigation bar and header for the deprecated API Listing. + */ + protected void writeHeader() { + printHtmlHeader(configuration.getText("doclet.Window_Deprecated_List"), + null, true); + printTop(); + navLinks(true); + hr(); + center(); + h2(); + boldText("doclet.Deprecated_API"); + h2End(); + centerEnd(); + + hr(4, "noshade"); + } + + /** + * Print the navigation bar and the footer for the deprecated API Listing. + */ + protected void printDeprecatedFooter() { + hr(); + navLinks(false); + printBottom(); + printBodyHtmlEnd(); + } + + /** + * Highlight the word "Deprecated" in the navigation bar as this is the same + * page. + */ + protected void navLinkDeprecated() { + navCellRevStart(); + fontStyle("NavBarFont1Rev"); + boldText("doclet.navDeprecated"); + fontEnd(); + navCellEnd(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java new file mode 100644 index 00000000000..1ce211c03b1 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java @@ -0,0 +1,259 @@ +/* + * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.taglets.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.javadoc.*; + +import java.io.*; + +/** + * Writes enum constant documentation in HTML format. + * + * @author Jamie Ho + */ +public class EnumConstantWriterImpl extends AbstractMemberWriter + implements EnumConstantWriter, MemberSummaryWriter { + + private boolean printedSummaryHeader = false; + + public EnumConstantWriterImpl(SubWriterHolderWriter writer, + ClassDoc classdoc) { + super(writer, classdoc); + } + + public EnumConstantWriterImpl(SubWriterHolderWriter writer) { + super(writer); + } + + /** + * Write the enum constant summary header for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeMemberSummaryHeader(ClassDoc classDoc) { + printedSummaryHeader = true; + writer.println(""); + writer.println(); + writer.printSummaryHeader(this, classDoc); + } + + /** + * Write the enum constant summary footer for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeMemberSummaryFooter(ClassDoc classDoc) { + writer.printSummaryFooter(this, classDoc); + } + + /** + * Write the inherited enum constant summary header for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) { + if(! printedSummaryHeader){ + //We don't want inherited summary to not be under heading. + writeMemberSummaryHeader(classDoc); + writeMemberSummaryFooter(classDoc); + printedSummaryHeader = true; + } + writer.printInheritedSummaryHeader(this, classDoc); + } + + /** + * {@inheritDoc} + */ + public void writeInheritedMemberSummary(ClassDoc classDoc, + ProgramElementDoc enumConstant, boolean isFirst, boolean isLast) { + writer.printInheritedSummaryMember(this, classDoc, enumConstant, isFirst); + } + + /** + * Write the inherited enum constant summary footer for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) { + writer.printInheritedSummaryFooter(this, classDoc); + } + + /** + * {@inheritDoc} + */ + public void writeHeader(ClassDoc classDoc, String header) { + writer.println(); + writer.println(""); + writer.println(); + writer.anchor("enum_constant_detail"); + writer.printTableHeadingBackground(header); + writer.println(); + } + + /** + * {@inheritDoc} + */ + public void writeEnumConstantHeader(FieldDoc enumConstant, boolean isFirst) { + if (! isFirst) { + writer.printMemberHeader(); + writer.println(""); + } + writer.anchor(enumConstant.name()); + writer.h3(); + writer.print(enumConstant.name()); + writer.h3End(); + } + + /** + * {@inheritDoc} + */ + public void writeSignature(FieldDoc enumConstant) { + writer.pre(); + writer.writeAnnotationInfo(enumConstant); + printModifiers(enumConstant); + writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, + enumConstant.type())); + print(' '); + if (configuration().linksource) { + writer.printSrcLink(enumConstant, enumConstant.name()); + } else { + bold(enumConstant.name()); + } + writer.preEnd(); + writer.dl(); + } + + /** + * {@inheritDoc} + */ + public void writeDeprecated(FieldDoc enumConstant) { + print(((TagletOutputImpl) + (new DeprecatedTaglet()).getTagletOutput(enumConstant, + writer.getTagletWriterInstance(false))).toString()); + } + + /** + * {@inheritDoc} + */ + public void writeComments(FieldDoc enumConstant) { + if (enumConstant.inlineTags().length > 0) { + writer.dd(); + writer.printInlineComment(enumConstant); + } + } + + /** + * {@inheritDoc} + */ + public void writeTags(FieldDoc enumConstant) { + writer.printTags(enumConstant); + } + + /** + * {@inheritDoc} + */ + public void writeEnumConstantFooter() { + writer.dlEnd(); + } + + /** + * {@inheritDoc} + */ + public void writeFooter(ClassDoc classDoc) { + //No footer to write for enum constant documentation + } + + /** + * {@inheritDoc} + */ + public void close() throws IOException { + writer.close(); + } + + public int getMemberKind() { + return VisibleMemberMap.ENUM_CONSTANTS; + } + + public void printSummaryLabel(ClassDoc cd) { + writer.boldText("doclet.Enum_Constant_Summary"); + } + + public void printSummaryAnchor(ClassDoc cd) { + writer.anchor("enum_constant_summary"); + } + + public void printInheritedSummaryAnchor(ClassDoc cd) { + } // no such + + public void printInheritedSummaryLabel(ClassDoc cd) { + // no such + } + + protected void writeSummaryLink(int context, ClassDoc cd, ProgramElementDoc member) { + writer.bold(); + writer.printDocLink(context, (MemberDoc) member, member.name(), false); + writer.boldEnd(); + } + + protected void writeInheritedSummaryLink(ClassDoc cd, + ProgramElementDoc member) { + writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER, (MemberDoc)member, + member.name(), false); + } + + protected void printSummaryType(ProgramElementDoc member) { + //Not applicable. + } + + protected void writeDeprecatedLink(ProgramElementDoc member) { + writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER, + (MemberDoc) member, ((FieldDoc)member).qualifiedName(), false); + } + + protected void printNavSummaryLink(ClassDoc cd, boolean link) { + if (link) { + writer.printHyperLink("", (cd == null)? + "enum_constant_summary": + "enum_constants_inherited_from_class_" + + configuration().getClassName(cd), + configuration().getText("doclet.navEnum")); + } else { + writer.printText("doclet.navEnum"); + } + } + + protected void printNavDetailLink(boolean link) { + if (link) { + writer.printHyperLink("", "enum_constant_detail", + configuration().getText("doclet.navEnum")); + } else { + writer.printText("doclet.navEnum"); + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java new file mode 100644 index 00000000000..a4d1f8428c6 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java @@ -0,0 +1,304 @@ +/* + * Copyright 1997-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.taglets.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.javadoc.*; + +import java.io.*; + +/** + * Writes field documentation in HTML format. + * + * @author Robert Field + * @author Atul M Dambalkar + * @author Jamie Ho (rewrite) + */ +public class FieldWriterImpl extends AbstractMemberWriter + implements FieldWriter, MemberSummaryWriter { + + private boolean printedSummaryHeader = false; + + public FieldWriterImpl(SubWriterHolderWriter writer, ClassDoc classdoc) { + super(writer, classdoc); + } + + public FieldWriterImpl(SubWriterHolderWriter writer) { + super(writer); + } + + /** + * Write the fields summary header for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeMemberSummaryHeader(ClassDoc classDoc) { + printedSummaryHeader = true; + writer.println(""); + writer.println(); + writer.printSummaryHeader(this, classDoc); + } + + /** + * Write the fields summary footer for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeMemberSummaryFooter(ClassDoc classDoc) { + writer.tableEnd(); + writer.space(); + } + + /** + * Write the inherited fields summary header for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) { + if(! printedSummaryHeader){ + //We don't want inherited summary to not be under heading. + writeMemberSummaryHeader(classDoc); + writeMemberSummaryFooter(classDoc); + printedSummaryHeader = true; + } + writer.printInheritedSummaryHeader(this, classDoc); + } + + /** + * {@inheritDoc} + */ + public void writeInheritedMemberSummary(ClassDoc classDoc, + ProgramElementDoc field, boolean isFirst, boolean isLast) { + writer.printInheritedSummaryMember(this, classDoc, field, isFirst); + } + + /** + * Write the inherited fields summary footer for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) { + writer.printInheritedSummaryFooter(this, classDoc); + } + + /** + * Write the header for the field documentation. + * + * @param classDoc the class that the fields belong to. + */ + public void writeHeader(ClassDoc classDoc, String header) { + writer.println(); + writer.println(""); + writer.println(); + writer.anchor("field_detail"); + writer.printTableHeadingBackground(header); + writer.println(); + } + + /** + * Write the field header for the given field. + * + * @param field the field being documented. + * @param isFirst the flag to indicate whether or not the field is the + * first to be documented. + */ + public void writeFieldHeader(FieldDoc field, boolean isFirst) { + if (! isFirst) { + writer.printMemberHeader(); + writer.println(""); + } + writer.anchor(field.name()); + writer.h3(); + writer.print(field.name()); + writer.h3End(); + } + + /** + * Write the signature for the given field. + * + * @param field the field being documented. + */ + public void writeSignature(FieldDoc field) { + writer.pre(); + writer.writeAnnotationInfo(field); + printModifiers(field); + writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, + field.type())); + print(' '); + if (configuration().linksource) { + writer.printSrcLink(field, field.name()); + } else { + bold(field.name()); + } + writer.preEnd(); + writer.dl(); + } + + /** + * Write the deprecated output for the given field. + * + * @param field the field being documented. + */ + public void writeDeprecated(FieldDoc field) { + print(((TagletOutputImpl) + (new DeprecatedTaglet()).getTagletOutput(field, + writer.getTagletWriterInstance(false))).toString()); + } + + /** + * Write the comments for the given field. + * + * @param field the field being documented. + */ + public void writeComments(FieldDoc field) { + ClassDoc holder = field.containingClass(); + if (field.inlineTags().length > 0) { + if (holder.equals(classdoc) || + (! (holder.isPublic() || Util.isLinkable(holder, configuration())))) { + writer.dd(); + writer.printInlineComment(field); + } else { + String classlink = writer.codeText( + writer.getDocLink(LinkInfoImpl.CONTEXT_FIELD_DOC_COPY, + holder, field, + holder.isIncluded() ? + holder.typeName() : holder.qualifiedTypeName(), + false)); + writer.dd(); + writer.bold(configuration().getText(holder.isClass()? + "doclet.Description_From_Class" : + "doclet.Description_From_Interface", classlink)); + writer.ddEnd(); + writer.dd(); + writer.printInlineComment(field); + } + } + } + + /** + * Write the tag output for the given field. + * + * @param field the field being documented. + */ + public void writeTags(FieldDoc field) { + writer.printTags(field); + } + + /** + * Write the field footer. + */ + public void writeFieldFooter() { + writer.dlEnd(); + } + + /** + * Write the footer for the field documentation. + * + * @param classDoc the class that the fields belong to. + */ + public void writeFooter(ClassDoc classDoc) { + //No footer to write for field documentation + } + + /** + * Close the writer. + */ + public void close() throws IOException { + writer.close(); + } + + public int getMemberKind() { + return VisibleMemberMap.FIELDS; + } + + public void printSummaryLabel(ClassDoc cd) { + writer.boldText("doclet.Field_Summary"); + } + + public void printSummaryAnchor(ClassDoc cd) { + writer.anchor("field_summary"); + } + + public void printInheritedSummaryAnchor(ClassDoc cd) { + writer.anchor("fields_inherited_from_class_" + configuration().getClassName(cd)); + } + + public void printInheritedSummaryLabel(ClassDoc cd) { + String classlink = writer.getPreQualifiedClassLink( + LinkInfoImpl.CONTEXT_MEMBER, cd, false); + writer.bold(); + String key = cd.isClass()? + "doclet.Fields_Inherited_From_Class" : + "doclet.Fields_Inherited_From_Interface"; + writer.printText(key, classlink); + writer.boldEnd(); + } + + protected void writeSummaryLink(int context, ClassDoc cd, ProgramElementDoc member) { + writer.bold(); + writer.printDocLink(context, cd , (MemberDoc) member, member.name(), false); + writer.boldEnd(); + } + + protected void writeInheritedSummaryLink(ClassDoc cd, + ProgramElementDoc member) { + writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER, cd, (MemberDoc)member, + member.name(), false); + } + + protected void printSummaryType(ProgramElementDoc member) { + FieldDoc field = (FieldDoc)member; + printModifierAndType(field, field.type()); + } + + protected void writeDeprecatedLink(ProgramElementDoc member) { + writer.printDocLink(LinkInfoImpl.CONTEXT_MEMBER, + (MemberDoc) member, ((FieldDoc)member).qualifiedName(), false); + } + + protected void printNavSummaryLink(ClassDoc cd, boolean link) { + if (link) { + writer.printHyperLink("", (cd == null)? + "field_summary": + "fields_inherited_from_class_" + + configuration().getClassName(cd), + configuration().getText("doclet.navField")); + } else { + writer.printText("doclet.navField"); + } + } + + protected void printNavDetailLink(boolean link) { + if (link) { + writer.printHyperLink("", "field_detail", + configuration().getText("doclet.navField")); + } else { + writer.printText("doclet.navField"); + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java new file mode 100644 index 00000000000..42485574df7 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java @@ -0,0 +1,167 @@ +/* + * Copyright 1997-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import java.io.*; + +/** + * Generate the documentation in the Html "frame" format in the browser. The + * generated documentation will have two or three frames depending upon the + * number of packages on the command line. In general there will be three frames + * in the output, a left-hand top frame will have a list of all packages with + * links to target left-hand bottom frame. The left-hand bottom frame will have + * the particular package contents or the all-classes list, where as the single + * right-hand frame will have overview or package summary or class file. Also + * take care of browsers which do not support Html frames. + * + * @author Atul M Dambalkar + */ +public class FrameOutputWriter extends HtmlDocletWriter { + + /** + * Number of packages specified on the command line. + */ + int noOfPackages; + + /** + * Constructor to construct FrameOutputWriter object. + * + * @param filename File to be generated. + */ + public FrameOutputWriter(ConfigurationImpl configuration, + String filename) throws IOException { + super(configuration, filename); + noOfPackages = configuration.packages.length; + } + + /** + * Construct FrameOutputWriter object and then use it to generate the Html + * file which will have the description of all the frames in the + * documentation. The name of the generated file is "index.html" which is + * the default first file for Html documents. + * @throws DocletAbortException + */ + public static void generate(ConfigurationImpl configuration) { + FrameOutputWriter framegen; + String filename = ""; + try { + filename = "index.html"; + framegen = new FrameOutputWriter(configuration, filename); + framegen.generateFrameFile(); + framegen.close(); + } catch (IOException exc) { + configuration.standardmessage.error( + "doclet.exception_encountered", + exc.toString(), filename); + throw new DocletAbortException(); + } + } + + /** + * Generate the contants in the "index.html" file. Print the frame details + * as well as warning if browser is not supporting the Html frames. + */ + protected void generateFrameFile() { + if (configuration.windowtitle.length() > 0) { + printFramesetHeader(configuration.windowtitle, configuration.notimestamp); + } else { + printFramesetHeader(configuration.getText("doclet.Generated_Docs_Untitled"), + configuration.notimestamp); + } + printFrameDetails(); + printFrameFooter(); + } + + /** + * Generate the code for issueing the warning for a non-frame capable web + * client. Also provide links to the non-frame version documentation. + */ + protected void printFrameWarning() { + noFrames(); + h2(); + printText("doclet.Frame_Alert"); + h2End(); + p(); + printText("doclet.Frame_Warning_Message"); + br(); + printText("doclet.Link_To"); + printHyperLink(configuration.topFile, + configuration.getText("doclet.Non_Frame_Version")); + println(""); + noFramesEnd(); + } + + /** + * Print the frame sizes and their contents. + */ + protected void printFrameDetails() { + // title attribute intentionally made empty so + // 508 tests will not flag it as missing + frameSet("cols=\"20%,80%\" title=\"\" onLoad=\"top.loadFrames()\""); + if (noOfPackages <= 1) { + printAllClassesFrameTag(); + } else if (noOfPackages > 1) { + frameSet("rows=\"30%,70%\" title=\"\" onLoad=\"top.loadFrames()\""); + printAllPackagesFrameTag(); + printAllClassesFrameTag(); + frameSetEnd(); + } + printClassFrameTag(); + printFrameWarning(); + frameSetEnd(); + } + + /** + * Print the FRAME tag for the frame that lists all packages + */ + private void printAllPackagesFrameTag() { + frame("src=\"overview-frame.html\" name=\"packageListFrame\"" + + " title=\"" + configuration.getText("doclet.All_Packages") + "\""); + } + + /** + * Print the FRAME tag for the frame that lists all classes + */ + private void printAllClassesFrameTag() { + frame("src=\"" + "allclasses-frame.html" + "\"" + + " name=\"packageFrame\"" + + " title=\"" + configuration.getText("doclet.All_classes_and_interfaces") + + "\""); + } + + /** + * Print the FRAME tag for the frame that describes the class in detail + */ + private void printClassFrameTag() { + frame("src=\"" + configuration.topFile + "\"" + + " name=\"classFrame\"" + + " title=\"" + + configuration.getText("doclet.Package_class_and_interface_descriptions") + + "\" scrolling=\"yes\""); + } + +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java new file mode 100644 index 00000000000..121fa935a46 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java @@ -0,0 +1,230 @@ +/* + * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import java.io.*; + +/** + * Generate the Help File for the generated API documentation. The help file + * contents are helpful for browsing the generated documentation. + * + * @author Atul M Dambalkar + */ +public class HelpWriter extends HtmlDocletWriter { + + /** + * Constructor to construct HelpWriter object. + * @param filename File to be generated. + */ + public HelpWriter(ConfigurationImpl configuration, + String filename) throws IOException { + super(configuration, filename); + } + + /** + * Construct the HelpWriter object and then use it to generate the help + * file. The name of the generated file is "help-doc.html". The help file + * will get generated if and only if "-helpfile" and "-nohelp" is not used + * on the command line. + * @throws DocletAbortException + */ + public static void generate(ConfigurationImpl configuration) { + HelpWriter helpgen; + String filename = ""; + try { + filename = "help-doc.html"; + helpgen = new HelpWriter(configuration, filename); + helpgen.generateHelpFile(); + helpgen.close(); + } catch (IOException exc) { + configuration.standardmessage.error( + "doclet.exception_encountered", + exc.toString(), filename); + throw new DocletAbortException(); + } + } + + /** + * Generate the help file contents. + */ + protected void generateHelpFile() { + printHtmlHeader(configuration.getText("doclet.Window_Help_title"), + null, true); + printTop(); + navLinks(true); hr(); + + printHelpFileContents(); + + navLinks(false); + printBottom(); + printBodyHtmlEnd(); + } + + /** + * Print the help file contents from the resource file. While generating the + * help file contents it also keeps track of user options. If "-notree" + * is used, then the "overview-tree.html" will not get generated and hence + * help information also will not get generated. + */ + protected void printHelpFileContents() { + center(); h1(); printText("doclet.Help_line_1"); h1End(); centerEnd(); + printText("doclet.Help_line_2"); + if (configuration.createoverview) { + h3(); printText("doclet.Overview"); h3End(); + blockquote(); p(); + printText("doclet.Help_line_3", + getHyperLink("overview-summary.html", + configuration.getText("doclet.Overview"))); + blockquoteEnd(); + } + h3(); printText("doclet.Package"); h3End(); + blockquote(); p(); printText("doclet.Help_line_4"); + ul(); + li(); printText("doclet.Interfaces_Italic"); + li(); printText("doclet.Classes"); + li(); printText("doclet.Enums"); + li(); printText("doclet.Exceptions"); + li(); printText("doclet.Errors"); + li(); printText("doclet.AnnotationTypes"); + ulEnd(); + blockquoteEnd(); + h3(); printText("doclet.Help_line_5"); h3End(); + blockquote(); p(); printText("doclet.Help_line_6"); + ul(); + li(); printText("doclet.Help_line_7"); + li(); printText("doclet.Help_line_8"); + li(); printText("doclet.Help_line_9"); + li(); printText("doclet.Help_line_10"); + li(); printText("doclet.Help_line_11"); + li(); printText("doclet.Help_line_12"); + p(); + li(); printText("doclet.Nested_Class_Summary"); + li(); printText("doclet.Field_Summary"); + li(); printText("doclet.Constructor_Summary"); + li(); printText("doclet.Method_Summary"); + p(); + li(); printText("doclet.Field_Detail"); + li(); printText("doclet.Constructor_Detail"); + li(); printText("doclet.Method_Detail"); + ulEnd(); + printText("doclet.Help_line_13"); + blockquoteEnd(); + + //Annotation Types + blockquoteEnd(); + h3(); printText("doclet.AnnotationType"); h3End(); + blockquote(); p(); printText("doclet.Help_annotation_type_line_1"); + ul(); + li(); printText("doclet.Help_annotation_type_line_2"); + li(); printText("doclet.Help_annotation_type_line_3"); + li(); printText("doclet.Annotation_Type_Required_Member_Summary"); + li(); printText("doclet.Annotation_Type_Optional_Member_Summary"); + li(); printText("doclet.Annotation_Type_Member_Detail"); + ulEnd(); + blockquoteEnd(); + + //Enums + blockquoteEnd(); + h3(); printText("doclet.Enum"); h3End(); + blockquote(); p(); printText("doclet.Help_enum_line_1"); + ul(); + li(); printText("doclet.Help_enum_line_2"); + li(); printText("doclet.Help_enum_line_3"); + li(); printText("doclet.Enum_Constant_Summary"); + li(); printText("doclet.Enum_Constant_Detail"); + ulEnd(); + blockquoteEnd(); + + if (configuration.classuse) { + h3(); printText("doclet.Help_line_14"); h3End(); + blockquote(); + printText("doclet.Help_line_15"); + blockquoteEnd(); + } + if (configuration.createtree) { + h3(); printText("doclet.Help_line_16"); h3End(); + blockquote(); + printText("doclet.Help_line_17_with_tree_link", + getHyperLink("overview-tree.html", + configuration.getText("doclet.Class_Hierarchy"))); + ul(); + li(); printText("doclet.Help_line_18"); + li(); printText("doclet.Help_line_19"); + ulEnd(); + blockquoteEnd(); + } + if (!(configuration.nodeprecatedlist || + configuration.nodeprecated)) { + h3(); printText("doclet.Deprecated_API"); h3End(); + blockquote(); + printText("doclet.Help_line_20_with_deprecated_api_link", + getHyperLink("deprecated-list.html", + configuration.getText("doclet.Deprecated_API"))); + blockquoteEnd(); + } + if (configuration.createindex) { + String indexlink; + if (configuration.splitindex) { + indexlink = getHyperLink("index-files/index-1.html", + configuration.getText("doclet.Index")); + } else { + indexlink = getHyperLink("index-all.html", + configuration.getText("doclet.Index")); + } + h3(); printText("doclet.Help_line_21"); h3End(); + blockquote(); + printText("doclet.Help_line_22", indexlink); + blockquoteEnd(); + } + h3(); printText("doclet.Help_line_23"); h3End(); + printText("doclet.Help_line_24"); + h3(); printText("doclet.Help_line_25"); h3End(); + printText("doclet.Help_line_26"); p(); + + h3(); printText("doclet.Serialized_Form"); h3End(); + printText("doclet.Help_line_27"); p(); + + h3(); printText("doclet.Constants_Summary"); h3End(); + printText("doclet.Help_line_28"); p(); + + font("-1"); em(); + printText("doclet.Help_line_29"); + emEnd(); fontEnd(); br(); + hr(); + } + + /** + * Highlight the word "Help" in the navigation bar as this is the help file. + */ + protected void navLinkHelp() { + navCellRevStart(); + fontStyle("NavBarFont1Rev"); + boldText("doclet.Help"); + fontEnd(); + navCellEnd(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java new file mode 100644 index 00000000000..eb131b63121 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDoclet.java @@ -0,0 +1,267 @@ +/* + * Copyright 1997-2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.builders.*; +import com.sun.tools.doclets.internal.toolkit.util.*; + +import com.sun.javadoc.*; +import java.util.*; +import java.io.*; + +/** + * The class with "start" method, calls individual Writers. + * + * @author Atul M Dambalkar + * @author Robert Field + * @author Jamie Ho + * + */ +public class HtmlDoclet extends AbstractDoclet { + + /** + * The global configuration information for this run. + */ + public ConfigurationImpl configuration = + (ConfigurationImpl) configuration(); + + /** + * The "start" method as required by Javadoc. + * + * @param root the root of the documentation tree. + * @see com.sun.javadoc.RootDoc + * @return true if the doclet ran without encountering any errors. + */ + public static boolean start(RootDoc root) { + HtmlDoclet doclet = new HtmlDoclet(); + return doclet.start(doclet, root); + } + + /** + * Create the configuration instance. + * Override this method to use a different + * configuration. + */ + public Configuration configuration() { + return ConfigurationImpl.getInstance(); + } + + /** + * Start the generation of files. Call generate methods in the individual + * writers, which will in turn genrate the documentation files. Call the + * TreeWriter generation first to ensure the Class Hierarchy is built + * first and then can be used in the later generation. + * + * For new format. + * + * @see com.sun.javadoc.RootDoc + */ + protected void generateOtherFiles(RootDoc root, ClassTree classtree) + throws Exception { + super.generateOtherFiles(root, classtree); + if (configuration.linksource) { + if (configuration.destDirName.length() > 0) { + SourceToHTMLConverter.convertRoot(configuration, + root, configuration.destDirName + File.separator + + DocletConstants.SOURCE_OUTPUT_DIR_NAME); + } else { + SourceToHTMLConverter.convertRoot(configuration, + root, DocletConstants.SOURCE_OUTPUT_DIR_NAME); + } + } + + if (configuration.topFile.length() == 0) { + configuration.standardmessage. + error("doclet.No_Non_Deprecated_Classes_To_Document"); + return; + } + boolean nodeprecated = configuration.nodeprecated; + String configdestdir = configuration.destDirName; + String confighelpfile = configuration.helpfile; + String configstylefile = configuration.stylesheetfile; + performCopy(configdestdir, confighelpfile); + performCopy(configdestdir, configstylefile); + Util.copyResourceFile(configuration, "inherit.gif", false); + // do early to reduce memory footprint + if (configuration.classuse) { + ClassUseWriter.generate(configuration, classtree); + } + IndexBuilder indexbuilder = new IndexBuilder(configuration, nodeprecated); + + if (configuration.createtree) { + TreeWriter.generate(configuration, classtree); + } + if (configuration.createindex) { + if (configuration.splitindex) { + SplitIndexWriter.generate(configuration, indexbuilder); + } else { + SingleIndexWriter.generate(configuration, indexbuilder); + } + } + + if (!(configuration.nodeprecatedlist || nodeprecated)) { + DeprecatedListWriter.generate(configuration); + } + + AllClassesFrameWriter.generate(configuration, + new IndexBuilder(configuration, nodeprecated, true)); + + FrameOutputWriter.generate(configuration); + + if (configuration.createoverview) { + PackageIndexWriter.generate(configuration); + } + if (configuration.helpfile.length() == 0 && + !configuration.nohelp) { + HelpWriter.generate(configuration); + } + if (configuration.stylesheetfile.length() == 0) { + StylesheetWriter.generate(configuration); + } + } + + /** + * {@inheritDoc} + */ + protected void generateClassFiles(ClassDoc[] arr, ClassTree classtree) { + Arrays.sort(arr); + for(int i = 0; i < arr.length; i++) { + if (!(configuration.isGeneratedDoc(arr[i]) && arr[i].isIncluded())) { + continue; + } + ClassDoc prev = (i == 0)? + null: + arr[i-1]; + ClassDoc curr = arr[i]; + ClassDoc next = (i+1 == arr.length)? + null: + arr[i+1]; + try { + if (curr.isAnnotationType()) { + AbstractBuilder annotationTypeBuilder = + configuration.getBuilderFactory() + .getAnnotationTypeBuilder((AnnotationTypeDoc) curr, + prev, next); + annotationTypeBuilder.build(); + } else { + AbstractBuilder classBuilder = + configuration.getBuilderFactory() + .getClassBuilder(curr, prev, next, classtree); + classBuilder.build(); + } + } catch (Exception e) { + e.printStackTrace(); + throw new DocletAbortException(); + } + } + } + + /** + * {@inheritDoc} + */ + protected void generatePackageFiles(ClassTree classtree) throws Exception { + PackageDoc[] packages = configuration.packages; + if (packages.length > 1) { + PackageIndexFrameWriter.generate(configuration); + } + PackageDoc prev = null, next; + for(int i = 0; i < packages.length; i++) { + PackageFrameWriter.generate(configuration, packages[i]); + next = (i + 1 < packages.length && packages[i+1].name().length() > 0) ? + packages[i+1] : null; + //If the next package is unnamed package, skip 2 ahead if possible + next = (i + 2 < packages.length && next == null) ? + packages[i+2]: next; + AbstractBuilder packageSummaryBuilder = configuration. + getBuilderFactory().getPackageSummaryBuilder( + packages[i], prev, next); + packageSummaryBuilder.build(); + if (configuration.createtree) { + PackageTreeWriter.generate(configuration, + packages[i], prev, next, + configuration.nodeprecated); + } + prev = packages[i]; + } + } + + /** + * Check for doclet added options here. + * + * @return number of arguments to option. Zero return means + * option not known. Negative value means error occurred. + */ + public static int optionLength(String option) { + // Construct temporary configuration for check + return (ConfigurationImpl.getInstance()).optionLength(option); + } + + /** + * Check that options have the correct arguments here. + *

+ * This method is not required and will default gracefully + * (to true) if absent. + *

+ * Printing option related error messages (using the provided + * DocErrorReporter) is the responsibility of this method. + * + * @return true if the options are valid. + */ + public static boolean validOptions(String options[][], + DocErrorReporter reporter) { + // Construct temporary configuration for check + return (ConfigurationImpl.getInstance()).validOptions(options, reporter); + } + + private void performCopy(String configdestdir, String filename) { + try { + String destdir = (configdestdir.length() > 0) ? + configdestdir + File.separatorChar: ""; + if (filename.length() > 0) { + File helpstylefile = new File(filename); + String parent = helpstylefile.getParent(); + String helpstylefilename = (parent == null)? + filename: + filename.substring(parent.length() + 1); + File desthelpfile = new File(destdir + helpstylefilename); + if (!desthelpfile.getCanonicalPath().equals( + helpstylefile.getCanonicalPath())) { + configuration.message. + notice((SourcePosition) null, + "doclet.Copying_File_0_To_File_1", + helpstylefile.toString(), desthelpfile.toString()); + Util.copyFile(desthelpfile, helpstylefile); + } + } + } catch (IOException exc) { + configuration.message. + error((SourcePosition) null, + "doclet.perform_copy_exception_encountered", + exc.toString()); + throw new DocletAbortException(); + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java new file mode 100644 index 00000000000..8a08253c6f2 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java @@ -0,0 +1,1848 @@ +/* + * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; +import com.sun.tools.doclets.formats.html.markup.*; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.taglets.*; + +import com.sun.javadoc.*; +import java.io.*; +import java.text.SimpleDateFormat; +import java.util.*; + + +/** + * Class for the Html Format Code Generation specific to JavaDoc. + * This Class contains methods related to the Html Code Generation which + * are used extensively while generating the entire documentation. + * + * @since 1.2 + * @author Atul M Dambalkar + * @author Robert Field + */ +public class HtmlDocletWriter extends HtmlDocWriter { + + /** + * Relative path from the file getting generated to the destination + * directory. For example, if the file getting generated is + * "java/lang/Object.html", then the relative path string is "../../". + * This string can be empty if the file getting generated is in + * the destination directory. + */ + public String relativePath = ""; + + /** + * Same as relativepath, but normalized to never be empty or + * end with a slash. + */ + public String relativepathNoSlash = ""; + + /** + * Platform-dependent directory path from the current or the + * destination directory to the file getting generated. + * Used when creating the file. + * For example, if the file getting generated is + * "java/lang/Object.html", then the path string is "java/lang". + */ + public String path = ""; + + /** + * Name of the file getting generated. If the file getting generated is + * "java/lang/Object.html", then the filename is "Object.html". + */ + public String filename = ""; + + /** + * The display length used for indentation while generating the class page. + */ + public int displayLength = 0; + + /** + * The global configuration information for this run. + */ + public ConfigurationImpl configuration; + + /** + * Constructor to construct the HtmlStandardWriter object. + * + * @param filename File to be generated. + */ + public HtmlDocletWriter(ConfigurationImpl configuration, + String filename) throws IOException { + super(configuration, filename); + this.configuration = configuration; + this.filename = filename; + } + + /** + * Constructor to construct the HtmlStandardWriter object. + * + * @param path Platform-dependent {@link #path} used when + * creating file. + * @param filename Name of file to be generated. + * @param relativePath Value for the variable {@link #relativePath}. + */ + public HtmlDocletWriter(ConfigurationImpl configuration, + String path, String filename, + String relativePath) throws IOException { + super(configuration, path, filename); + this.configuration = configuration; + this.path = path; + this.relativePath = relativePath; + this.relativepathNoSlash = + DirectoryManager.getPathNoTrailingSlash(this.relativePath); + this.filename = filename; + } + + /** + * Replace {@docRoot} tag used in options that accept HTML text, such + * as -header, -footer, -top and -bottom, and when converting a relative + * HREF where commentTagsToString inserts a {@docRoot} where one was + * missing. (Also see DocRootTaglet for {@docRoot} tags in doc + * comments.) + *

+ * Replace {@docRoot} tag in htmlstr with the relative path to the + * destination directory from the directory where the file is being + * written, looping to handle all such tags in htmlstr. + *

+ * For example, for "-d docs" and -header containing {@docRoot}, when + * the HTML page for source file p/C1.java is being generated, the + * {@docRoot} tag would be inserted into the header as "../", + * the relative path from docs/p/ to docs/ (the document root). + *

+ * Note: This doc comment was written with '&#064;' representing '@' + * to prevent the inline tag from being interpreted. + */ + public String replaceDocRootDir(String htmlstr) { + // Return if no inline tags exist + int index = htmlstr.indexOf("{@"); + if (index < 0) { + return htmlstr; + } + String lowerHtml = htmlstr.toLowerCase(); + // Return index of first occurrence of {@docroot} + // Note: {@docRoot} is not case sensitive when passed in w/command line option + index = lowerHtml.indexOf("{@docroot}", index); + if (index < 0) { + return htmlstr; + } + StringBuffer buf = new StringBuffer(); + int previndex = 0; + while (true) { + // Search for lowercase version of {@docRoot} + index = lowerHtml.indexOf("{@docroot}", previndex); + // If next {@docRoot} tag not found, append rest of htmlstr and exit loop + if (index < 0) { + buf.append(htmlstr.substring(previndex)); + break; + } + // If next {@docroot} tag found, append htmlstr up to start of tag + buf.append(htmlstr.substring(previndex, index)); + previndex = index + 10; // length for {@docroot} string + // Insert relative path where {@docRoot} was located + buf.append(relativepathNoSlash); + // Append slash if next character is not a slash + if (relativepathNoSlash.length() > 0 && previndex < htmlstr.length() + && htmlstr.charAt(previndex) != '/') { + buf.append(DirectoryManager.URL_FILE_SEPERATOR); + } + } + return buf.toString(); + } + + /** + * Print Html Hyper Link, with target frame. This + * link will only appear if page is not in a frame. + * + * @param link String name of the file. + * @param where Position in the file + * @param target Name of the target frame. + * @param label Tag for the link. + * @param bold Whether the label should be bold or not? + */ + public void printNoFramesTargetHyperLink(String link, String where, + String target, String label, + boolean bold) { + script(); + println(" "); + scriptEnd(); + noScript(); + println(" " + getHyperLink(link, where, label, bold, "", "", target)); + noScriptEnd(); + println(DocletConstants.NL); + } + + private void printMethodInfo(MethodDoc method) { + ClassDoc[] intfacs = method.containingClass().interfaces(); + MethodDoc overriddenMethod = method.overriddenMethod(); + if (intfacs.length > 0 || overriddenMethod != null) { + dd(); + printTagsInfoHeader(); + MethodWriterImpl.printImplementsInfo(this, method); + if (overriddenMethod != null) { + MethodWriterImpl.printOverridden(this, + method.overriddenType(), overriddenMethod); + } + printTagsInfoFooter(); + ddEnd(); + } + dd(); + } + + protected void printTags(Doc doc) { + if(configuration.nocomment){ + return; + } + if (doc instanceof MethodDoc) { + printMethodInfo((MethodDoc) doc); + } + TagletOutputImpl output = new TagletOutputImpl(""); + TagletWriter.genTagOuput(configuration.tagletManager, doc, + configuration.tagletManager.getCustomTags(doc), + getTagletWriterInstance(false), output); + if (output.toString().trim().length() > 0) { + printTagsInfoHeader(); + print(output.toString()); + printTagsInfoFooter(); + } else if (! (doc instanceof ConstructorDoc || + doc instanceof RootDoc || doc instanceof ClassDoc)) { + //To be consistent with 1.4.2 output. + //I hate to do this but we have to pass the diff test to prove + //nothing has broken. + printTagsInfoHeader(); + printTagsInfoFooter(); + } + } + + /** + * Returns a TagletWriter that knows how to write HTML. + * + * @return a TagletWriter that knows how to write HTML. + */ + public TagletWriter getTagletWriterInstance(boolean isFirstSentence) { + return new TagletWriterImpl(this, isFirstSentence); + } + + protected void printTagsInfoHeader() { + dl(); + } + + protected void printTagsInfoFooter() { + dlEnd(); + } + + /** + * Print Package link, with target frame. + * + * @param pd The link will be to the "package-summary.html" page for this + * package. + * @param target Name of the target frame. + * @param label Tag for the link. + */ + public void printTargetPackageLink(PackageDoc pd, String target, + String label) { + print(getHyperLink(pathString(pd, "package-summary.html"), "", label, + false, "", "", target)); + } + + /** + * Print the html file header. Also print Html page title and stylesheet + * default properties. + * + * @param title String window title to go in the <TITLE> tag + * @param metakeywords Array of String keywords for META tag. Each element + * of the array is assigned to a separate META tag. + * Pass in null for no array. + * @param includeScript boolean true if printing windowtitle script. + * False for files that appear in the left-hand frames. + */ + public void printHtmlHeader(String title, String[] metakeywords, + boolean includeScript) { + println(""); + println(""); + html(); + head(); + if (! configuration.notimestamp) { + print(""); + } + if (configuration.charset.length() > 0) { + println(""); + } + if ( configuration.windowtitle.length() > 0 ) { + title += " (" + configuration.windowtitle + ")"; + } + title(title); + println(title); + titleEnd(); + println(""); + if (! configuration.notimestamp) { + SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd"); + println(""); + } + if ( metakeywords != null ) { + for ( int i=0; i < metakeywords.length; i++ ) { + println(""); + } + } + println(""); + printStyleSheetProperties(); + println(""); + // Don't print windowtitle script for overview-frame, allclasses-frame + // and package-frame + if (includeScript) { + printWinTitleScript(title); + } + println(""); + headEnd(); + println(""); + body("white", includeScript); + } + + /** + * Print user specified header and the footer. + * + * @param header if true print the user provided header else print the + * user provided footer. + */ + public void printUserHeaderFooter(boolean header) { + em(); + if (header) { + print(replaceDocRootDir(configuration.header)); + } else { + if (configuration.footer.length() != 0) { + print(replaceDocRootDir(configuration.footer)); + } else { + print(replaceDocRootDir(configuration.header)); + } + } + emEnd(); + } + + /** + * Print the user specified top. + */ + public void printTop() { + print(replaceDocRootDir(configuration.top)); + hr(); + } + + /** + * Print the user specified bottom. + */ + public void printBottom() { + hr(); + print(replaceDocRootDir(configuration.bottom)); + } + + /** + * Print the navigation bar for the Html page at the top and and the bottom. + * + * @param header If true print navigation bar at the top of the page else + * print the nevigation bar at the bottom. + */ + protected void navLinks(boolean header) { + println(""); + if (!configuration.nonavbar) { + if (header) { + println(DocletConstants.NL + ""); + anchor("navbar_top"); + println(); + print(getHyperLink("", "skip-navbar_top", "", false, "", + configuration.getText("doclet.Skip_navigation_links"), "")); + } else { + println(DocletConstants.NL + ""); + anchor("navbar_bottom"); + println(); + print(getHyperLink("", "skip-navbar_bottom", "", false, "", + configuration.getText("doclet.Skip_navigation_links"), "")); + } + table(0, "100%", 1, 0); + tr(); + tdColspanBgcolorStyle(2, "#EEEEFF", "NavBarCell1"); + println(""); + if (header) { + anchor("navbar_top_firstrow"); + } else { + anchor("navbar_bottom_firstrow"); + } + table(0, 0, 3); + print(" "); + trAlignVAlign("center", "top"); + + if (configuration.createoverview) { + navLinkContents(); + } + + if (configuration.packages.length == 1) { + navLinkPackage(configuration.packages[0]); + } else if (configuration.packages.length > 1) { + navLinkPackage(); + } + + navLinkClass(); + + if(configuration.classuse) { + navLinkClassUse(); + } + if(configuration.createtree) { + navLinkTree(); + } + if(!(configuration.nodeprecated || + configuration.nodeprecatedlist)) { + navLinkDeprecated(); + } + if(configuration.createindex) { + navLinkIndex(); + } + if (!configuration.nohelp) { + navLinkHelp(); + } + print(" "); + trEnd(); + tableEnd(); + tdEnd(); + + tdAlignVAlignRowspan("right", "top", 3); + + printUserHeaderFooter(header); + tdEnd(); + trEnd(); + println(""); + + tr(); + tdBgcolorStyle("white", "NavBarCell2"); + font("-2"); + space(); + navLinkPrevious(); + space(); + println(""); + space(); + navLinkNext(); + fontEnd(); + tdEnd(); + + tdBgcolorStyle("white", "NavBarCell2"); + font("-2"); + print(" "); + navShowLists(); + print(" "); + space(); + println(""); + space(); + navHideLists(filename); + print(" "); + space(); + println(""); + space(); + navLinkClassIndex(); + fontEnd(); + tdEnd(); + + trEnd(); + + printSummaryDetailLinks(); + + tableEnd(); + if (header) { + aName("skip-navbar_top"); + aEnd(); + println(DocletConstants.NL + ""); + } else { + aName("skip-navbar_bottom"); + aEnd(); + println(DocletConstants.NL + ""); + } + println(""); + } + } + + /** + * Print the word "NEXT" to indicate that no link is available. Override + * this method to customize next link. + */ + protected void navLinkNext() { + navLinkNext(null); + } + + /** + * Print the word "PREV" to indicate that no link is available. Override + * this method to customize prev link. + */ + protected void navLinkPrevious() { + navLinkPrevious(null); + } + + /** + * Do nothing. This is the default method. + */ + protected void printSummaryDetailLinks() { + } + + /** + * Print link to the "overview-summary.html" page. + */ + protected void navLinkContents() { + navCellStart(); + printHyperLink(relativePath + "overview-summary.html", "", + configuration.getText("doclet.Overview"), true, "NavBarFont1"); + navCellEnd(); + } + + /** + * Description for a cell in the navigation bar. + */ + protected void navCellStart() { + print(" "); + tdBgcolorStyle("#EEEEFF", "NavBarCell1"); + print(" "); + } + + /** + * Description for a cell in the navigation bar, but with reverse + * high-light effect. + */ + protected void navCellRevStart() { + print(" "); + tdBgcolorStyle("#FFFFFF", "NavBarCell1Rev"); + print(" "); + space(); + } + + /** + * Closing tag for navigation bar cell. + */ + protected void navCellEnd() { + space(); + tdEnd(); + } + + /** + * Print link to the "package-summary.html" page for the package passed. + * + * @param pkg Package to which link will be generated. + */ + protected void navLinkPackage(PackageDoc pkg) { + navCellStart(); + printPackageLink(pkg, configuration.getText("doclet.Package"), true, + "NavBarFont1"); + navCellEnd(); + } + + /** + * Print the word "Package" in the navigation bar cell, to indicate that + * link is not available here. + */ + protected void navLinkPackage() { + navCellStart(); + fontStyle("NavBarFont1"); + printText("doclet.Package"); + fontEnd(); + navCellEnd(); + } + + /** + * Print the word "Use" in the navigation bar cell, to indicate that link + * is not available. + */ + protected void navLinkClassUse() { + navCellStart(); + fontStyle("NavBarFont1"); + printText("doclet.navClassUse"); + fontEnd(); + navCellEnd(); + } + + /** + * Print link for previous file. + * + * @param prev File name for the prev link. + */ + public void navLinkPrevious(String prev) { + String tag = configuration.getText("doclet.Prev"); + if (prev != null) { + printHyperLink(prev, "", tag, true) ; + } else { + print(tag); + } + } + + /** + * Print link for next file. If next is null, just print the label + * without linking it anywhere. + * + * @param next File name for the next link. + */ + public void navLinkNext(String next) { + String tag = configuration.getText("doclet.Next"); + if (next != null) { + printHyperLink(next, "", tag, true); + } else { + print(tag); + } + } + + /** + * Print "FRAMES" link, to switch to the frame version of the output. + * + * @param link File to be linked, "index.html". + */ + protected void navShowLists(String link) { + print(getHyperLink(link + "?" + path + filename, "", + configuration.getText("doclet.FRAMES"), true, "", "", "_top")); + } + + /** + * Print "FRAMES" link, to switch to the frame version of the output. + */ + protected void navShowLists() { + navShowLists(relativePath + "index.html"); + } + + /** + * Print "NO FRAMES" link, to switch to the non-frame version of the output. + * + * @param link File to be linked. + */ + protected void navHideLists(String link) { + print(getHyperLink(link, "", configuration.getText("doclet.NO_FRAMES"), + true, "", "", "_top")); + } + + /** + * Print "Tree" link in the navigation bar. If there is only one package + * specified on the command line, then the "Tree" link will be to the + * only "package-tree.html" file otherwise it will be to the + * "overview-tree.html" file. + */ + protected void navLinkTree() { + navCellStart(); + PackageDoc[] packages = configuration.root.specifiedPackages(); + if (packages.length == 1 && configuration.root.specifiedClasses().length == 0) { + printHyperLink(pathString(packages[0], "package-tree.html"), "", + configuration.getText("doclet.Tree"), true, "NavBarFont1"); + } else { + printHyperLink(relativePath + "overview-tree.html", "", + configuration.getText("doclet.Tree"), true, "NavBarFont1"); + } + navCellEnd(); + } + + /** + * Print "Tree" link to the "overview-tree.html" file. + */ + protected void navLinkMainTree(String label) { + printHyperLink(relativePath + "overview-tree.html", label); + } + + /** + * Print the word "Class" in the navigation bar cell, to indicate that + * class link is not available. + */ + protected void navLinkClass() { + navCellStart(); + fontStyle("NavBarFont1"); + printText("doclet.Class"); + fontEnd(); + navCellEnd(); + } + + /** + * Print "Deprecated" API link in the navigation bar. + */ + protected void navLinkDeprecated() { + navCellStart(); + printHyperLink(relativePath + "deprecated-list.html", "", + configuration.getText("doclet.navDeprecated"), true, "NavBarFont1"); + navCellEnd(); + } + + /** + * Print link for generated index. If the user has used "-splitindex" + * command line option, then link to file "index-files/index-1.html" is + * generated otherwise link to file "index-all.html" is generated. + */ + protected void navLinkClassIndex() { + printNoFramesTargetHyperLink(relativePath + + AllClassesFrameWriter.OUTPUT_FILE_NAME_NOFRAMES, + "", "", configuration.getText("doclet.All_Classes"), true); + } + /** + * Print link for generated class index. + */ + protected void navLinkIndex() { + navCellStart(); + printHyperLink(relativePath + + (configuration.splitindex? + DirectoryManager.getPath("index-files") + + fileseparator: "") + + (configuration.splitindex? + "index-1.html" : "index-all.html"), "", + configuration.getText("doclet.Index"), true, "NavBarFont1"); + navCellEnd(); + } + + /** + * Print help file link. If user has provided a help file, then generate a + * link to the user given file, which is already copied to current or + * destination directory. + */ + protected void navLinkHelp() { + String helpfilenm = configuration.helpfile; + if (helpfilenm.equals("")) { + helpfilenm = "help-doc.html"; + } else { + int lastsep; + if ((lastsep = helpfilenm.lastIndexOf(File.separatorChar)) != -1) { + helpfilenm = helpfilenm.substring(lastsep + 1); + } + } + navCellStart(); + printHyperLink(relativePath + helpfilenm, "", + configuration.getText("doclet.Help"), true, "NavBarFont1"); + navCellEnd(); + } + + /** + * Print the word "Detail" in the navigation bar. No link is available. + */ + protected void navDetail() { + printText("doclet.Detail"); + } + + /** + * Print the word "Summary" in the navigation bar. No link is available. + */ + protected void navSummary() { + printText("doclet.Summary"); + } + + /** + * Print the Html table tag for the index summary tables. The table tag + * printed is + * <TABLE BORDER="1" CELLPADDING="3" CELLSPACING="0" WIDTH="100%"> + */ + public void tableIndexSummary() { + table(1, "100%", 3, 0); + } + + /** + * Same as {@link #tableIndexSummary()}. + */ + public void tableIndexDetail() { + table(1, "100%", 3, 0); + } + + /** + * Print Html tag for table elements. The tag printed is + * <TD ALIGN="right" VALIGN="top" WIDTH="1%">. + */ + public void tdIndex() { + print(""); + } + + /** + * Prine table header information about color, column span and the font. + * + * @param color Background color. + * @param span Column span. + */ + public void tableHeaderStart(String color, int span) { + trBgcolorStyle(color, "TableHeadingColor"); + thAlignColspan("left", span); + font("+2"); + } + + /** + * Print table header for the inherited members summary tables. Print the + * background color information. + * + * @param color Background color. + */ + public void tableInheritedHeaderStart(String color) { + trBgcolorStyle(color, "TableSubHeadingColor"); + thAlign("left"); + } + + /** + * Print "Use" table header. Print the background color and the column span. + * + * @param color Background color. + */ + public void tableUseInfoHeaderStart(String color) { + trBgcolorStyle(color, "TableSubHeadingColor"); + thAlignColspan("left", 2); + } + + /** + * Print table header with the background color with default column span 2. + * + * @param color Background color. + */ + public void tableHeaderStart(String color) { + tableHeaderStart(color, 2); + } + + /** + * Print table header with the column span, with the default color #CCCCFF. + * + * @param span Column span. + */ + public void tableHeaderStart(int span) { + tableHeaderStart("#CCCCFF", span); + } + + /** + * Print table header with default column span 2 and default color #CCCCFF. + */ + public void tableHeaderStart() { + tableHeaderStart(2); + } + + /** + * Print table header end tags for font, column and row. + */ + public void tableHeaderEnd() { + fontEnd(); + thEnd(); + trEnd(); + } + + /** + * Print table header end tags in inherited tables for column and row. + */ + public void tableInheritedHeaderEnd() { + thEnd(); + trEnd(); + } + + /** + * Print the summary table row cell attribute width. + * + * @param width Width of the table cell. + */ + public void summaryRow(int width) { + if (width != 0) { + tdWidth(width + "%"); + } else { + td(); + } + } + + /** + * Print the summary table row cell end tag. + */ + public void summaryRowEnd() { + tdEnd(); + } + + /** + * Print the heading in Html <H2> format. + * + * @param str The Header string. + */ + public void printIndexHeading(String str) { + h2(); + print(str); + h2End(); + } + + /** + * Print Html tag <FRAMESET=arg>. + * + * @param arg Argument for the tag. + */ + public void frameSet(String arg) { + println(""); + } + + /** + * Print Html closing tag </FRAMESET>. + */ + public void frameSetEnd() { + println(""); + } + + /** + * Print Html tag <FRAME=arg>. + * + * @param arg Argument for the tag. + */ + public void frame(String arg) { + println(""); + } + + /** + * Print Html closing tag </FRAME>. + */ + public void frameEnd() { + println(""); + } + + /** + * Return path to the class page for a classdoc. For example, the class + * name is "java.lang.Object" and if the current file getting generated is + * "java/io/File.html", then the path string to the class, returned is + * "../../java/lang.Object.html". + * + * @param cd Class to which the path is requested. + */ + protected String pathToClass(ClassDoc cd) { + return pathString(cd.containingPackage(), cd.name() + ".html"); + } + + /** + * Return the path to the class page for a classdoc. Works same as + * {@link #pathToClass(ClassDoc)}. + * + * @param cd Class to which the path is requested. + * @param name Name of the file(doesn't include path). + */ + protected String pathString(ClassDoc cd, String name) { + return pathString(cd.containingPackage(), name); + } + + /** + * Return path to the given file name in the given package. So if the name + * passed is "Object.html" and the name of the package is "java.lang", and + * if the relative path is "../.." then returned string will be + * "../../java/lang/Object.html" + * + * @param pd Package in which the file name is assumed to be. + * @param name File name, to which path string is. + */ + protected String pathString(PackageDoc pd, String name) { + StringBuffer buf = new StringBuffer(relativePath); + buf.append(DirectoryManager.getPathToPackage(pd, name)); + return buf.toString(); + } + + /** + * Print the link to the given package. + * + * @param pkg the package to link to. + * @param label the label for the link. + * @param isBold true if the label should be bold. + */ + public void printPackageLink(PackageDoc pkg, String label, boolean isBold) { + print(getPackageLink(pkg, label, isBold)); + } + + /** + * Print the link to the given package. + * + * @param pkg the package to link to. + * @param label the label for the link. + * @param isBold true if the label should be bold. + * @param style the font of the package link label. + */ + public void printPackageLink(PackageDoc pkg, String label, boolean isBold, + String style) { + print(getPackageLink(pkg, label, isBold, style)); + } + + /** + * Return the link to the given package. + * + * @param pkg the package to link to. + * @param label the label for the link. + * @param isBold true if the label should be bold. + * @return the link to the given package. + */ + public String getPackageLink(PackageDoc pkg, String label, + boolean isBold) { + return getPackageLink(pkg, label, isBold, ""); + } + + /** + * Return the link to the given package. + * + * @param pkg the package to link to. + * @param label the label for the link. + * @param isBold true if the label should be bold. + * @param style the font of the package link label. + * @return the link to the given package. + */ + public String getPackageLink(PackageDoc pkg, String label, boolean isBold, + String style) { + boolean included = pkg != null && pkg.isIncluded(); + if (! included) { + PackageDoc[] packages = configuration.packages; + for (int i = 0; i < packages.length; i++) { + if (packages[i].equals(pkg)) { + included = true; + break; + } + } + } + if (included || pkg == null) { + return getHyperLink(pathString(pkg, "package-summary.html"), + "", label, isBold, style); + } else { + String crossPkgLink = getCrossPackageLink(Util.getPackageName(pkg)); + if (crossPkgLink != null) { + return getHyperLink(crossPkgLink, "", label, isBold, style); + } else { + return label; + } + } + } + + public String italicsClassName(ClassDoc cd, boolean qual) { + String name = (qual)? cd.qualifiedName(): cd.name(); + return (cd.isInterface())? italicsText(name): name; + } + + public void printSrcLink(ProgramElementDoc d, String label) { + if (d == null) { + return; + } + ClassDoc cd = d.containingClass(); + if (cd == null) { + //d must be a class doc since in has no containing class. + cd = (ClassDoc) d; + } + String href = relativePath + DocletConstants.SOURCE_OUTPUT_DIR_NAME + + DirectoryManager.getDirectoryPath(cd.containingPackage()) + + cd.name() + ".html#" + SourceToHTMLConverter.getAnchorName(d); + printHyperLink(href, "", label, true); + } + + /** + * Return the link to the given class. + * + * @param linkInfo the information about the link. + * + * @return the link for the given class. + */ + public String getLink(LinkInfoImpl linkInfo) { + LinkFactoryImpl factory = new LinkFactoryImpl(this); + String link = ((LinkOutputImpl) factory.getLinkOutput(linkInfo)).toString(); + displayLength += linkInfo.displayLength; + return link; + } + + /** + * Return the type parameters for the given class. + * + * @param linkInfo the information about the link. + * @return the type for the given class. + */ + public String getTypeParameterLinks(LinkInfoImpl linkInfo) { + LinkFactoryImpl factory = new LinkFactoryImpl(this); + return ((LinkOutputImpl) + factory.getTypeParameterLinks(linkInfo, false)).toString(); + } + + /** + * Print the link to the given class. + */ + public void printLink(LinkInfoImpl linkInfo) { + print(getLink(linkInfo)); + } + + /************************************************************* + * Return a class cross link to external class documentation. + * The name must be fully qualified to determine which package + * the class is in. The -link option does not allow users to + * link to external classes in the "default" package. + * + * @param qualifiedClassName the qualified name of the external class. + * @param refMemName the name of the member being referenced. This should + * be null or empty string if no member is being referenced. + * @param label the label for the external link. + * @param bold true if the link should be bold. + * @param style the style of the link. + * @param code true if the label should be code font. + */ + public String getCrossClassLink(String qualifiedClassName, String refMemName, + String label, boolean bold, String style, + boolean code) { + String className = "", + packageName = qualifiedClassName == null ? "" : qualifiedClassName; + int periodIndex; + while((periodIndex = packageName.lastIndexOf('.')) != -1) { + className = packageName.substring(periodIndex + 1, packageName.length()) + + (className.length() > 0 ? "." + className : ""); + String defaultLabel = code ? getCode() + className + getCodeEnd() : className; + packageName = packageName.substring(0, periodIndex); + if (getCrossPackageLink(packageName) != null) { + //The package exists in external documentation, so link to the external + //class (assuming that it exists). This is definitely a limitation of + //the -link option. There are ways to determine if an external package + //exists, but no way to determine if the external class exists. We just + //have to assume that it does. + return getHyperLink( + configuration.extern.getExternalLink(packageName, relativePath, + className + ".html?is-external=true"), + refMemName == null ? "" : refMemName, + label == null || label.length() == 0 ? defaultLabel : label, + bold, style, + configuration.getText("doclet.Href_Class_Or_Interface_Title", packageName), + ""); + } + } + return null; + } + + public boolean isClassLinkable(ClassDoc cd) { + if (cd.isIncluded()) { + return configuration.isGeneratedDoc(cd); + } + return configuration.extern.isExternal(cd); + } + + public String getCrossPackageLink(String pkgName) { + return configuration.extern.getExternalLink(pkgName, relativePath, + "package-summary.html?is-external=true"); + } + + public void printQualifiedClassLink(int context, ClassDoc cd) { + printLink(new LinkInfoImpl(context, cd, + configuration.getClassName(cd), "")); + } + + /** + * Print Class link, with only class name as the link and prefixing + * plain package name. + */ + public void printPreQualifiedClassLink(int context, ClassDoc cd) { + print(getPreQualifiedClassLink(context, cd, false)); + } + + /** + * Retrieve the class link with the package portion of the label in + * plain text. If the qualifier is excluded, it willnot be included in the + * link label. + * + * @param cd the class to link to. + * @param isBold true if the link should be bold. + * @return the link with the package portion of the label in plain text. + */ + public String getPreQualifiedClassLink(int context, + ClassDoc cd, boolean isBold) { + String classlink = ""; + PackageDoc pd = cd.containingPackage(); + if(pd != null && ! configuration.shouldExcludeQualifier(pd.name())) { + classlink = getPkgName(cd); + } + classlink += getLink(new LinkInfoImpl(context, cd, cd.name(), isBold)); + return classlink; + } + + + /** + * Print Class link, with only class name as the bold link and prefixing + * plain package name. + */ + public void printPreQualifiedBoldClassLink(int context, ClassDoc cd) { + print(getPreQualifiedClassLink(context, cd, true)); + } + + public void printText(String key) { + print(configuration.getText(key)); + } + + public void printText(String key, String a1) { + print(configuration.getText(key, a1)); + } + + public void printText(String key, String a1, String a2) { + print(configuration.getText(key, a1, a2)); + } + + public void boldText(String key) { + bold(configuration.getText(key)); + } + + public void boldText(String key, String a1) { + bold(configuration.getText(key, a1)); + } + + public void boldText(String key, String a1, String a2) { + bold(configuration.getText(key, a1, a2)); + } + + /** + * Print the link for the given member. + * + * @param context the id of the context where the link will be printed. + * @param doc the member being linked to. + * @param label the label for the link. + * @param bold true if the link should be bold. + */ + public void printDocLink(int context, MemberDoc doc, String label, + boolean bold) { + print(getDocLink(context, doc, label, bold)); + } + + /** + * Print the link for the given member. + * + * @param context the id of the context where the link will be printed. + * @param classDoc the classDoc that we should link to. This is not + * necessarily equal to doc.containingClass(). We may be + * inheriting comments. + * @param doc the member being linked to. + * @param label the label for the link. + * @param bold true if the link should be bold. + */ + public void printDocLink(int context, ClassDoc classDoc, MemberDoc doc, + String label, boolean bold) { + print(getDocLink(context, classDoc, doc, label, bold)); + } + + /** + * Return the link for the given member. + * + * @param context the id of the context where the link will be printed. + * @param doc the member being linked to. + * @param label the label for the link. + * @param bold true if the link should be bold. + * @return the link for the given member. + */ + public String getDocLink(int context, MemberDoc doc, String label, + boolean bold) { + return getDocLink(context, doc.containingClass(), doc, label, bold); + } + + /** + * Return the link for the given member. + * + * @param context the id of the context where the link will be printed. + * @param classDoc the classDoc that we should link to. This is not + * necessarily equal to doc.containingClass(). We may be + * inheriting comments. + * @param doc the member being linked to. + * @param label the label for the link. + * @param bold true if the link should be bold. + * @return the link for the given member. + */ + public String getDocLink(int context, ClassDoc classDoc, MemberDoc doc, + String label, boolean bold) { + if (! (doc.isIncluded() || + Util.isLinkable(classDoc, configuration()))) { + return label; + } else if (doc instanceof ExecutableMemberDoc) { + ExecutableMemberDoc emd = (ExecutableMemberDoc)doc; + return getLink(new LinkInfoImpl(context, classDoc, + getAnchor(emd), label, bold)); + } else if (doc instanceof MemberDoc) { + return getLink(new LinkInfoImpl(context, classDoc, + doc.name(), label, bold)); + } else { + return label; + } + } + + public void anchor(ExecutableMemberDoc emd) { + anchor(getAnchor(emd)); + } + + public String getAnchor(ExecutableMemberDoc emd) { + StringBuilder signature = new StringBuilder(emd.signature()); + StringBuilder signatureParsed = new StringBuilder(); + int counter = 0; + for (int i = 0; i < signature.length(); i++) { + char c = signature.charAt(i); + if (c == '<') { + counter++; + } else if (c == '>') { + counter--; + } else if (counter == 0) { + signatureParsed.append(c); + } + } + return emd.name() + signatureParsed.toString(); + } + + public String seeTagToString(SeeTag see) { + String tagName = see.name(); + if (! (tagName.startsWith("@link") || tagName.equals("@see"))) { + return ""; + } + StringBuffer result = new StringBuffer(); + boolean isplaintext = tagName.toLowerCase().equals("@linkplain"); + String label = see.label(); + label = (label.length() > 0)? + ((isplaintext) ? label : + getCode() + label + getCodeEnd()):""; + String seetext = replaceDocRootDir(see.text()); + + //Check if @see is an href or "string" + if (seetext.startsWith("<") || seetext.startsWith("\"")) { + result.append(seetext); + return result.toString(); + } + + //The text from the @see tag. We will output this text when a label is not specified. + String text = (isplaintext) ? seetext : getCode() + seetext + getCodeEnd(); + + ClassDoc refClass = see.referencedClass(); + String refClassName = see.referencedClassName(); + MemberDoc refMem = see.referencedMember(); + String refMemName = see.referencedMemberName(); + if (refClass == null) { + //@see is not referencing an included class + PackageDoc refPackage = see.referencedPackage(); + if (refPackage != null && refPackage.isIncluded()) { + //@see is referencing an included package + String packageName = isplaintext ? refPackage.name() : + getCode() + refPackage.name() + getCodeEnd(); + result.append(getPackageLink(refPackage, + label.length() == 0 ? packageName : label, false)); + } else { + //@see is not referencing an included class or package. Check for cross links. + String classCrossLink, packageCrossLink = getCrossPackageLink(refClassName); + if (packageCrossLink != null) { + //Package cross link found + result.append(getHyperLink(packageCrossLink, "", + (label.length() == 0)? text : label, false)); + } else if ((classCrossLink = getCrossClassLink(refClassName, + refMemName, label, false, "", ! isplaintext)) != null) { + //Class cross link found (possiblly to a member in the class) + result.append(classCrossLink); + } else { + //No cross link found so print warning + configuration.getDocletSpecificMsg().warning(see.position(), "doclet.see.class_or_package_not_found", + tagName, seetext); + result.append((label.length() == 0)? text: label); + } + } + } else if (refMemName == null) { + // Must be a class reference since refClass is not null and refMemName is null. + if (label.length() == 0) { + label = (isplaintext) ? refClass.name() : getCode() + refClass.name() + getCodeEnd(); + result.append(getLink(new LinkInfoImpl(refClass, label))); + } else { + result.append(getLink(new LinkInfoImpl(refClass, label))); + } + } else if (refMem == null) { + // Must be a member reference since refClass is not null and refMemName is not null. + // However, refMem is null, so this referenced member does not exist. + result.append((label.length() == 0)? text: label); + } else { + // Must be a member reference since refClass is not null and refMemName is not null. + // refMem is not null, so this @see tag must be referencing a valid member. + ClassDoc containing = refMem.containingClass(); + if (see.text().trim().startsWith("#") && + ! (containing.isPublic() || + Util.isLinkable(containing, configuration()))) { + // Since the link is relative and the holder is not even being + // documented, this must be an inherited link. Redirect it. + // The current class either overrides the referenced member or + // inherits it automatically. + containing = ((ClassWriterImpl) this).getClassDoc(); + } + if (configuration.currentcd != containing) { + refMemName = containing.name() + "." + refMemName; + } + if (refMem instanceof ExecutableMemberDoc) { + if (refMemName.indexOf('(') < 0) { + refMemName += ((ExecutableMemberDoc)refMem).signature(); + } + } + text = (isplaintext) ? + refMemName : getCode() + refMemName + getCodeEnd(); + + result.append(getDocLink(LinkInfoImpl.CONTEXT_SEE_TAG, containing, + refMem, (label.length() == 0)? text: label, false)); + } + return result.toString(); + } + + public void printInlineComment(Doc doc, Tag tag) { + printCommentTags(doc, tag.inlineTags(), false, false); + } + + public void printInlineDeprecatedComment(Doc doc, Tag tag) { + printCommentTags(doc, tag.inlineTags(), true, false); + } + + public void printSummaryComment(Doc doc) { + printSummaryComment(doc, doc.firstSentenceTags()); + } + + public void printSummaryComment(Doc doc, Tag[] firstSentenceTags) { + printCommentTags(doc, firstSentenceTags, false, true); + } + + public void printSummaryDeprecatedComment(Doc doc) { + printCommentTags(doc, doc.firstSentenceTags(), true, true); + } + + public void printSummaryDeprecatedComment(Doc doc, Tag tag) { + printCommentTags(doc, tag.firstSentenceTags(), true, true); + } + + public void printInlineComment(Doc doc) { + printCommentTags(doc, doc.inlineTags(), false, false); + p(); + } + + public void printInlineDeprecatedComment(Doc doc) { + printCommentTags(doc, doc.inlineTags(), true, false); + } + + private void printCommentTags(Doc doc, Tag[] tags, boolean depr, boolean first) { + if(configuration.nocomment){ + return; + } + if (depr) { + italic(); + } + String result = commentTagsToString(null, doc, tags, first); + print(result); + if (depr) { + italicEnd(); + } + if (tags.length == 0) { + space(); + } + } + + /** + * Converts inline tags and text to text strings, expanding the + * inline tags along the way. Called wherever text can contain + * an inline tag, such as in comments or in free-form text arguments + * to non-inline tags. + * + * @param holderTag specific tag where comment resides + * @param doc specific doc where comment resides + * @param tags array of text tags and inline tags (often alternating) + * present in the text of interest for this doc + * @param isFirstSentence true if text is first sentence + */ + public String commentTagsToString(Tag holderTag, Doc doc, Tag[] tags, + boolean isFirstSentence) { + StringBuffer result = new StringBuffer(); + // Array of all possible inline tags for this javadoc run + configuration.tagletManager.checkTags(doc, tags, true); + for (int i = 0; i < tags.length; i++) { + Tag tagelem = tags[i]; + String tagName = tagelem.name(); + if (tagelem instanceof SeeTag) { + result.append(seeTagToString((SeeTag)tagelem)); + } else if (! tagName.equals("Text")) { + int originalLength = result.length(); + TagletOutput output = TagletWriter.getInlineTagOuput( + configuration.tagletManager, holderTag, + (Tag) tagelem, getTagletWriterInstance(isFirstSentence)); + result.append(output == null ? "" : output.toString()); + if (originalLength == 0 && isFirstSentence && tagelem.name().equals("@inheritDoc") && result.length() > 0) { + break; + } else { + continue; + } + } else { + //This is just a regular text tag. The text may contain html links () + //or inline tag {@docRoot}, which will be handled as special cases. + String text = redirectRelativeLinks(tagelem.holder(), tagelem.text()); + + // Replace @docRoot only if not represented by an instance of DocRootTaglet, + // that is, only if it was not present in a source file doc comment. + // This happens when inserted by the doclet (a few lines + // above in this method). [It might also happen when passed in on the command + // line as a text argument to an option (like -header).] + text = replaceDocRootDir(text); + if (isFirstSentence) { + text = removeNonInlineHtmlTags(text); + } + StringTokenizer lines = new StringTokenizer(text, "\r\n", true); + StringBuffer textBuff = new StringBuffer(); + while (lines.hasMoreTokens()) { + StringBuffer line = new StringBuffer(lines.nextToken()); + Util.replaceTabs(configuration.sourcetab, line); + textBuff.append(line.toString()); + } + result.append(textBuff); + } + } + return result.toString(); + } + + /** + * Return true if relative links should not be redirected. + * + * @return Return true if a relative link should not be redirected. + */ + private boolean shouldNotRedirectRelativeLinks() { + return this instanceof AnnotationTypeWriter || + this instanceof ClassWriter || + this instanceof PackageSummaryWriter; + } + + /** + * Suppose a piece of documentation has a relative link. When you copy + * that documetation to another place such as the index or class-use page, + * that relative link will no longer work. We should redirect those links + * so that they will work again. + *

+ * Here is the algorithm used to fix the link: + *

+ * <relative link> => docRoot + <relative path to file> + <relative link> + *

+ * For example, suppose com.sun.javadoc.RootDoc has this link: + * <a href="package-summary.html">The package Page</a> + *

+ * If this link appeared in the index, we would redirect + * the link like this: + * + * <a href="./com/sun/javadoc/package-summary.html">The package Page</a> + * + * @param doc the Doc object whose documentation is being written. + * @param text the text being written. + * + * @return the text, with all the relative links redirected to work. + */ + private String redirectRelativeLinks(Doc doc, String text) { + if (doc == null || shouldNotRedirectRelativeLinks()) { + return text; + } + + String redirectPathFromRoot; + if (doc instanceof ClassDoc) { + redirectPathFromRoot = DirectoryManager.getDirectoryPath(((ClassDoc) doc).containingPackage()); + } else if (doc instanceof MemberDoc) { + redirectPathFromRoot = DirectoryManager.getDirectoryPath(((MemberDoc) doc).containingPackage()); + } else if (doc instanceof PackageDoc) { + redirectPathFromRoot = DirectoryManager.getDirectoryPath((PackageDoc) doc); + } else { + return text; + } + + if (! redirectPathFromRoot.endsWith(DirectoryManager.URL_FILE_SEPERATOR)) { + redirectPathFromRoot += DirectoryManager.URL_FILE_SEPERATOR; + } + + //Redirect all relative links. + int end, begin = text.toLowerCase().indexOf("= 0){ + StringBuffer textBuff = new StringBuffer(text); + + while(begin >=0){ + if (textBuff.length() > begin + 2 && ! Character.isWhitespace(textBuff.charAt(begin+2))) { + begin = textBuff.toString().toLowerCase().indexOf("", begin +1); + if(begin == 0){ + //Link has no equal symbol. + configuration.root.printWarning( + doc.position(), + configuration.getText("doclet.malformed_html_link_tag", text)); + break; + } + if (end == -1) { + //Break without warning. This tag is not necessarily malformed. The text + //might be missing '>' character because the href has an inline tag. + break; + } + if(textBuff.substring(begin, end).indexOf("\"") != -1){ + begin = textBuff.indexOf("\"", begin) + 1; + end = textBuff.indexOf("\"", begin +1); + if(begin == 0 || end == -1){ + //Link is missing a quote. + break; + } + } + String relativeLink = textBuff.substring(begin, end); + if(!(relativeLink.toLowerCase().startsWith("mailto:") || + relativeLink.toLowerCase().startsWith("http:") || + relativeLink.toLowerCase().startsWith("https:") || + relativeLink.toLowerCase().startsWith("file:"))){ + relativeLink = "{@"+(new DocRootTaglet()).getName() + "}" + + redirectPathFromRoot + + relativeLink; + textBuff.replace(begin, end, relativeLink); + } + begin = textBuff.toString().toLowerCase().indexOf("", "", "

    ", "
", + "
", "
", "", "
", + "", "", "", "", + "", "", "

", "

", + "
  • ", "
  • ", "
    ", "
    ", + "", "", "
    ", "
    ", + "

    ", "

    ", "

    ", "

    ", + "

    ", "

    ", "

    ", "

    ", + "
    ", "
    ", "
    ", "
    ", + "
    ", "
    ", "", "", + "", "", "
    ", + "
    ", "
    ", + "
    ", "
    ", + "
      ", "
    ", "
      ", "
    ", + "
    ", "
    ", "", "
    ", + "", "", "", "", + "", "", "

    ", "

    ", + "
  • ", "
  • ", "
    ", "
    ", + "", "", "
    ", "
    ", + "

    ", "

    ", "

    ", "

    ", + "

    ", "

    ", "

    ", "

    ", + "
    ", "
    ", "
    ", "
    ", + "
    ", "
    ", "", "", + "", "", "
    ", + "
    ", "
    ", + "
    ", "
    " + }; + for (int i = 0; i < noninlinetags.length; i++) { + text = replace(text, noninlinetags[i], ""); + } + return text; + } + + public String replace(String text, String tobe, String by) { + while (true) { + int startindex = text.indexOf(tobe); + if (startindex < 0) { + return text; + } + int endindex = startindex + tobe.length(); + StringBuffer replaced = new StringBuffer(); + if (startindex > 0) { + replaced.append(text.substring(0, startindex)); + } + replaced.append(by); + if (text.length() > endindex) { + replaced.append(text.substring(endindex)); + } + text = replaced.toString(); + } + } + + public void printStyleSheetProperties() { + String filename = configuration.stylesheetfile; + if (filename.length() > 0) { + File stylefile = new File(filename); + String parent = stylefile.getParent(); + filename = (parent == null)? + filename: + filename.substring(parent.length() + 1); + } else { + filename = "stylesheet.css"; + } + filename = relativePath + filename; + link("REL =\"stylesheet\" TYPE=\"text/css\" HREF=\"" + + filename + "\" " + "TITLE=\"Style\""); + } + + /** + * According to the Java Language Specifications, all the outer classes + * and static nested classes are core classes. + */ + public boolean isCoreClass(ClassDoc cd) { + return cd.containingClass() == null || cd.isStatic(); + } + + /** + * Write the annotatation types for the given packageDoc. + * + * @param packageDoc the package to write annotations for. + */ + public void writeAnnotationInfo(PackageDoc packageDoc) { + writeAnnotationInfo(packageDoc, packageDoc.annotations()); + } + + /** + * Write the annotatation types for the given doc. + * + * @param doc the doc to write annotations for. + */ + public void writeAnnotationInfo(ProgramElementDoc doc) { + writeAnnotationInfo(doc, doc.annotations()); + } + + /** + * Write the annotatation types for the given doc and parameter. + * + * @param indent the number of spaced to indent the parameters. + * @param doc the doc to write annotations for. + * @param param the parameter to write annotations for. + */ + public boolean writeAnnotationInfo(int indent, Doc doc, Parameter param) { + return writeAnnotationInfo(indent, doc, param.annotations(), false); + } + + /** + * Write the annotatation types for the given doc. + * + * @param doc the doc to write annotations for. + * @param descList the array of {@link AnnotationDesc}. + */ + private void writeAnnotationInfo(Doc doc, AnnotationDesc[] descList) { + writeAnnotationInfo(0, doc, descList, true); + } + + /** + * Write the annotatation types for the given doc. + * + * @param indent the number of extra spaces to indent the annotations. + * @param doc the doc to write annotations for. + * @param descList the array of {@link AnnotationDesc}. + */ + private boolean writeAnnotationInfo(int indent, Doc doc, AnnotationDesc[] descList, boolean lineBreak) { + List annotations = getAnnotations(indent, descList, lineBreak); + if (annotations.size() == 0) { + return false; + } + fontNoNewLine("-1"); + for (Iterator iter = annotations.iterator(); iter.hasNext();) { + print((String) iter.next()); + } + fontEnd(); + return true; + } + + /** + * Return the string representations of the annotation types for + * the given doc. + * + * @param indent the number of extra spaces to indent the annotations. + * @param descList the array of {@link AnnotationDesc}. + * @param linkBreak if true, add new line between each member value. + * @return an array of strings representing the annotations being + * documented. + */ + private List getAnnotations(int indent, AnnotationDesc[] descList, boolean linkBreak) { + List results = new ArrayList(); + StringBuffer annotation; + for (int i = 0; i < descList.length; i++) { + AnnotationTypeDoc annotationDoc = descList[i].annotationType(); + if (! Util.isDocumentedAnnotation(annotationDoc)){ + continue; + } + annotation = new StringBuffer(); + LinkInfoImpl linkInfo = new LinkInfoImpl( + LinkInfoImpl.CONTEXT_ANNOTATION, annotationDoc); + linkInfo.label = "@" + annotationDoc.name(); + annotation.append(getLink(linkInfo)); + AnnotationDesc.ElementValuePair[] pairs = descList[i].elementValues(); + if (pairs.length > 0) { + annotation.append('('); + for (int j = 0; j < pairs.length; j++) { + if (j > 0) { + annotation.append(","); + if (linkBreak) { + annotation.append(DocletConstants.NL); + int spaces = annotationDoc.name().length() + 2; + for (int k = 0; k < (spaces + indent); k++) { + annotation.append(' '); + } + } + } + annotation.append(getDocLink(LinkInfoImpl.CONTEXT_ANNOTATION, + pairs[j].element(), pairs[j].element().name(), false)); + annotation.append('='); + AnnotationValue annotationValue = pairs[j].value(); + List annotationTypeValues = new ArrayList(); + if (annotationValue.value() instanceof AnnotationValue[]) { + AnnotationValue[] annotationArray = + (AnnotationValue[]) annotationValue.value(); + for (int k = 0; k < annotationArray.length; k++) { + annotationTypeValues.add(annotationArray[k]); + } + } else { + annotationTypeValues.add(annotationValue); + } + annotation.append(annotationTypeValues.size() == 1 ? "" : "{"); + for (Iterator iter = annotationTypeValues.iterator(); iter.hasNext(); ) { + annotation.append(annotationValueToString((AnnotationValue) iter.next())); + annotation.append(iter.hasNext() ? "," : ""); + } + annotation.append(annotationTypeValues.size() == 1 ? "" : "}"); + } + annotation.append(")"); + } + annotation.append(linkBreak ? DocletConstants.NL : ""); + results.add(annotation.toString()); + } + return results; + } + + private String annotationValueToString(AnnotationValue annotationValue) { + if (annotationValue.value() instanceof Type) { + Type type = (Type) annotationValue.value(); + if (type.asClassDoc() != null) { + LinkInfoImpl linkInfo = new LinkInfoImpl( + LinkInfoImpl.CONTEXT_ANNOTATION, type); + linkInfo.label = (type.asClassDoc().isIncluded() ? + type.typeName() : + type.qualifiedTypeName()) + type.dimension() + ".class"; + return getLink(linkInfo); + } else { + return type.typeName() + type.dimension() + ".class"; + } + } else if (annotationValue.value() instanceof AnnotationDesc) { + List list = getAnnotations(0, + new AnnotationDesc[]{(AnnotationDesc) annotationValue.value()}, + false); + StringBuffer buf = new StringBuffer(); + for (Iterator iter = list.iterator(); iter.hasNext(); ) { + buf.append(iter.next()); + } + return buf.toString(); + } else if (annotationValue.value() instanceof MemberDoc) { + return getDocLink(LinkInfoImpl.CONTEXT_ANNOTATION, + (MemberDoc) annotationValue.value(), + ((MemberDoc) annotationValue.value()).name(), false); + } else { + return annotationValue.toString(); + } + } + + /** + * Return the configuation for this doclet. + * + * @return the configuration for this doclet. + */ + public Configuration configuration() { + return configuration; + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java new file mode 100644 index 00000000000..ed90d540433 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialFieldWriter.java @@ -0,0 +1,167 @@ +/* + * Copyright 1998-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.taglets.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.javadoc.*; +import java.util.*; + +/** + * Generate serialized form for serializable fields. + * Documentation denoted by the tags serial and + * serialField is processed. + * + * @author Joe Fialli + */ +public class HtmlSerialFieldWriter extends FieldWriterImpl + implements SerializedFormWriter.SerialFieldWriter { + ProgramElementDoc[] members = null; + + private boolean printedOverallAnchor = false; + + private boolean printedFirstMember = false; + + public HtmlSerialFieldWriter(SubWriterHolderWriter writer, + ClassDoc classdoc) { + super(writer, classdoc); + } + + public List members(ClassDoc cd) { + return Util.asList(cd.serializableFields()); + } + + protected void printTypeLinkNoDimension(Type type) { + ClassDoc cd = type.asClassDoc(); + //Linking to package private classes in serialized for causes + //broken links. Don't link to them. + if (type.isPrimitive() || cd.isPackagePrivate()) { + print(type.typeName()); + } else { + writer.printLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_SERIAL_MEMBER, type)); + } + } + + public void writeHeader(String heading) { + if (! printedOverallAnchor) { + writer.anchor("serializedForm"); + printedOverallAnchor = true; + writer.printTableHeadingBackground(heading); + writer.println(); + if (heading.equals( + configuration().getText("doclet.Serialized_Form_class"))) { + writer.dl(); + } + } else { + writer.printTableHeadingBackground(heading); + writer.println(); + } + } + + public void writeMemberHeader(ClassDoc fieldType, String fieldTypeStr, + String fieldDimensions, String fieldName) { + if (printedFirstMember) { + writer.printMemberHeader(); + } + printedFirstMember = true; + writer.h3(); + writer.print(fieldName); + writer.h3End(); + writer.pre(); + if (fieldType == null) { + writer.print(fieldTypeStr); + } else { + writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_SERIAL_MEMBER, + fieldType)); + } + print(fieldDimensions + ' '); + bold(fieldName); + writer.preEnd(); + writer.dl(); + } + + /** + * Write the deprecated information for this member. + * + * @param field the field to document. + */ + public void writeMemberDeprecatedInfo(FieldDoc field) { + print(((TagletOutputImpl) + (new DeprecatedTaglet()).getTagletOutput(field, + writer.getTagletWriterInstance(false))).toString()); + } + + /** + * Write the description text for this member. + * + * @param field the field to document. + */ + public void writeMemberDescription(FieldDoc field) { + if (field.inlineTags().length > 0) { + writer.dd(); + writer.printInlineComment(field); + } + Tag[] tags = field.tags("serial"); + if (tags.length > 0) { + writer.dt(); + writer.dd(); + writer.printInlineComment(field, tags[0]); + } + } + + /** + * Write the description text for this member represented by the tag. + * + * @param serialFieldTag the field to document (represented by tag). + */ + public void writeMemberDescription(SerialFieldTag serialFieldTag) { + writer.dd(); + writer.print(serialFieldTag.description()); + writer.dlEnd(); + } + + /** + * Write the tag information for this member. + * + * @param field the field to document. + */ + public void writeMemberTags(FieldDoc field) { + writer.dl(); + TagletOutputImpl output = new TagletOutputImpl(""); + TagletWriter.genTagOuput(configuration().tagletManager, field, + configuration().tagletManager.getCustomTags(field), + writer.getTagletWriterInstance(false), output); + if (output.toString().length() > 0) { + print(output.toString()); + } + writer.dlEnd(); + } + public void writeMemberFooter(FieldDoc member) { + writer.dlEnd(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java new file mode 100644 index 00000000000..3f8eb66d804 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java @@ -0,0 +1,112 @@ +/* + * Copyright 1998-2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.taglets.*; +import com.sun.javadoc.*; + +/** + * Generate serialized form for Serializable/Externalizable methods. + * Documentation denoted by the serialData tag is processed. + * + * @author Joe Fialli + */ +public class HtmlSerialMethodWriter extends MethodWriterImpl implements + SerializedFormWriter.SerialMethodWriter{ + + private boolean printedFirstMember = false; + + public HtmlSerialMethodWriter(SubWriterHolderWriter writer, + ClassDoc classdoc) { + super(writer, classdoc); + } + + public void writeHeader(String heading) { + writer.anchor("serialized_methods"); + writer.printTableHeadingBackground(heading); + writer.p(); + } + + public void writeNoCustomizationMsg(String msg) { + writer.print(msg); + writer.p(); + } + + public void writeMemberHeader(MethodDoc member) { + if (printedFirstMember) { + writer.printMemberHeader(); + } + printedFirstMember = true; + writer.anchor(member); + printHead(member); + writeSignature(member); + } + + public void writeMemberFooter(MethodDoc member) { + writer.dlEnd(); + } + + public void writeDeprecatedMemberInfo(MethodDoc member) { + print(((TagletOutputImpl) + (new DeprecatedTaglet()).getTagletOutput(member, + writer.getTagletWriterInstance(false))).toString()); + } + + public void writeMemberDescription(MethodDoc member) { + printComment(member); + } + + public void writeMemberTags(MethodDoc member) { + writer.dd(); + writer.dl(); + TagletOutputImpl output = new TagletOutputImpl(""); + TagletManager tagletManager = + ConfigurationImpl.getInstance().tagletManager; + TagletWriter.genTagOuput(tagletManager, member, + tagletManager.getSerializedFormTags(), + writer.getTagletWriterInstance(false), output); + print(output.toString()); + MethodDoc method = (MethodDoc)member; + if (method.name().compareTo("writeExternal") == 0 + && method.tags("serialData").length == 0) { + serialWarning(member.position(), "doclet.MissingSerialDataTag", + method.containingClass().qualifiedName(), method.name()); + } + writer.ddEnd(); + writer.dlEnd(); + } + + protected void printTypeLinkNoDimension(Type type) { + ClassDoc cd = type.asClassDoc(); + if (type.isPrimitive() || cd.isPackagePrivate()) { + print(type.typeName()); + } else { + writer.printLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_SERIAL_MEMBER,type)); + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java new file mode 100644 index 00000000000..4a2abf11077 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkFactoryImpl.java @@ -0,0 +1,175 @@ +/* + * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.util.links.*; +import com.sun.javadoc.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; + +/** + * A factory that returns a link given the information about it. + * + * @author Jamie Ho + * @since 1.5 + */ +public class LinkFactoryImpl extends LinkFactory { + + private HtmlDocletWriter m_writer; + + public LinkFactoryImpl(HtmlDocletWriter writer) { + m_writer = writer; + } + + /** + * {@inheritDoc} + */ + protected LinkOutput getOutputInstance() { + return new LinkOutputImpl(); + } + + /** + * {@inheritDoc} + */ + protected LinkOutput getClassLink(LinkInfo linkInfo) { + LinkInfoImpl classLinkInfo = (LinkInfoImpl) linkInfo; + boolean noLabel = linkInfo.label == null || linkInfo.label.length() == 0; + ClassDoc classDoc = classLinkInfo.classDoc; + //Create a tool tip if we are linking to a class or interface. Don't + //create one if we are linking to a member. + String title = + (classLinkInfo.where == null || classLinkInfo.where.length() == 0) ? + getClassToolTip(classDoc, + classLinkInfo.type != null && + !classDoc.qualifiedTypeName().equals(classLinkInfo.type.qualifiedTypeName())) : + ""; + StringBuffer label = new StringBuffer( + classLinkInfo.getClassLinkLabel(m_writer.configuration)); + classLinkInfo.displayLength += label.length(); + if (noLabel && classLinkInfo.excludeTypeParameterLinks) { + label.append(getTypeParameterLinks(linkInfo).toString()); + } + Configuration configuration = ConfigurationImpl.getInstance(); + LinkOutputImpl linkOutput = new LinkOutputImpl(); + if (classDoc.isIncluded()) { + if (configuration.isGeneratedDoc(classDoc)) { + String filename = pathString(classLinkInfo); + if (linkInfo.linkToSelf || + !(linkInfo.classDoc.name() + ".html").equals(m_writer.filename)) { + linkOutput.append(m_writer.getHyperLink(filename, + classLinkInfo.where, label.toString(), + classLinkInfo.isBold, classLinkInfo.styleName, + title, classLinkInfo.target)); + if (noLabel && !classLinkInfo.excludeTypeParameterLinks) { + linkOutput.append(getTypeParameterLinks(linkInfo).toString()); + } + return linkOutput; + } + } + } else { + String crossLink = m_writer.getCrossClassLink( + classDoc.qualifiedName(), classLinkInfo.where, + label.toString(), classLinkInfo.isBold, classLinkInfo.styleName, + true); + if (crossLink != null) { + linkOutput.append(crossLink); + if (noLabel && !classLinkInfo.excludeTypeParameterLinks) { + linkOutput.append(getTypeParameterLinks(linkInfo).toString()); + } + return linkOutput; + } + } + // Can't link so just write label. + linkOutput.append(label.toString()); + if (noLabel && !classLinkInfo.excludeTypeParameterLinks) { + linkOutput.append(getTypeParameterLinks(linkInfo).toString()); + } + return linkOutput; + } + + /** + * {@inheritDoc} + */ + protected LinkOutput getTypeParameterLink(LinkInfo linkInfo, + Type typeParam) { + LinkInfoImpl typeLinkInfo = new LinkInfoImpl(linkInfo.getContext(), + typeParam); + typeLinkInfo.excludeTypeBounds = linkInfo.excludeTypeBounds; + typeLinkInfo.excludeTypeParameterLinks = linkInfo.excludeTypeParameterLinks; + typeLinkInfo.linkToSelf = linkInfo.linkToSelf; + LinkOutput output = getLinkOutput(typeLinkInfo); + ((LinkInfoImpl) linkInfo).displayLength += typeLinkInfo.displayLength; + return output; + } + + /** + * Given a class, return the appropriate tool tip. + * + * @param classDoc the class to get the tool tip for. + * @return the tool tip for the appropriate class. + */ + private String getClassToolTip(ClassDoc classDoc, boolean isTypeLink) { + Configuration configuration = ConfigurationImpl.getInstance(); + if (isTypeLink) { + return configuration.getText("doclet.Href_Type_Param_Title", + classDoc.name()); + } else if (classDoc.isInterface()){ + return configuration.getText("doclet.Href_Interface_Title", + Util.getPackageName(classDoc.containingPackage())); + } else if (classDoc.isAnnotationType()) { + return configuration.getText("doclet.Href_Annotation_Title", + Util.getPackageName(classDoc.containingPackage())); + } else if (classDoc.isEnum()) { + return configuration.getText("doclet.Href_Enum_Title", + Util.getPackageName(classDoc.containingPackage())); + } else { + return configuration.getText("doclet.Href_Class_Title", + Util.getPackageName(classDoc.containingPackage())); + } + } + + /** + * Return path to the given file name in the given package. So if the name + * passed is "Object.html" and the name of the package is "java.lang", and + * if the relative path is "../.." then returned string will be + * "../../java/lang/Object.html" + * + * @param linkInfo the information about the link. + * @param fileName the file name, to which path string is. + */ + private String pathString(LinkInfoImpl linkInfo) { + if (linkInfo.context == LinkInfoImpl.PACKAGE_FRAME) { + //Not really necessary to do this but we want to be consistent + //with 1.4.2 output. + return linkInfo.classDoc.name() + ".html"; + } + StringBuffer buf = new StringBuffer(m_writer.relativePath); + buf.append(DirectoryManager.getPathToPackage( + linkInfo.classDoc.containingPackage(), + linkInfo.classDoc.name() + ".html")); + return buf.toString(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java new file mode 100644 index 00000000000..9bf955db4af --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkInfoImpl.java @@ -0,0 +1,451 @@ +/* + * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + + +package com.sun.tools.doclets.formats.html; + +import com.sun.javadoc.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.util.links.*; + +public class LinkInfoImpl extends LinkInfo { + + /** + * Indicate that the link appears in a class list. + */ + public static final int ALL_CLASSES_FRAME = 1; + + /** + * Indicate that the link appears in a class documentation. + */ + public static final int CONTEXT_CLASS = 2; + + /** + * Indicate that the link appears in member documentation. + */ + public static final int CONTEXT_MEMBER = 3; + + /** + * Indicate that the link appears in class use documentation. + */ + public static final int CONTEXT_CLASS_USE = 4; + + /** + * Indicate that the link appears in index documentation. + */ + public static final int CONTEXT_INDEX = 5; + + /** + * Indicate that the link appears in constant value summary. + */ + public static final int CONTEXT_CONSTANT_SUMMARY = 6; + + /** + * Indicate that the link appears in serialized form documentation. + */ + public static final int CONTEXT_SERIALIZED_FORM = 7; + + /** + * Indicate that the link appears in serial member documentation. + */ + public static final int CONTEXT_SERIAL_MEMBER = 8; + + /** + * Indicate that the link appears in package documentation. + */ + public static final int CONTEXT_PACKAGE = 9; + + /** + * Indicate that the link appears in see tag documentation. + */ + public static final int CONTEXT_SEE_TAG = 10; + + /** + * Indicate that the link appears in value tag documentation. + */ + public static final int CONTEXT_VALUE_TAG = 11; + + /** + * Indicate that the link appears in tree documentation. + */ + public static final int CONTEXT_TREE = 12; + + /** + * Indicate that the link appears in a class list. + */ + public static final int PACKAGE_FRAME = 13; + + /** + * The header in the class documentation. + */ + public static final int CONTEXT_CLASS_HEADER = 14; + + /** + * The signature in the class documentation. + */ + public static final int CONTEXT_CLASS_SIGNATURE = 15; + + /** + * The return type of a method. + */ + public static final int CONTEXT_RETURN_TYPE = 16; + + /** + * The return type of a method in a member summary. + */ + public static final int CONTEXT_SUMMARY_RETURN_TYPE = 17; + + /** + * The type of a method/constructor parameter. + */ + public static final int CONTEXT_EXECUTABLE_MEMBER_PARAM = 18; + + /** + * Super interface links. + */ + public static final int CONTEXT_SUPER_INTERFACES = 19; + + /** + * Implemented interface links. + */ + public static final int CONTEXT_IMPLEMENTED_INTERFACES = 20; + + /** + * Implemented class links. + */ + public static final int CONTEXT_IMPLEMENTED_CLASSES = 21; + + /** + * Subinterface links. + */ + public static final int CONTEXT_SUBINTERFACES = 22; + + /** + * Subclasses links. + */ + public static final int CONTEXT_SUBCLASSES = 23; + + /** + * The signature in the class documentation (implements/extends portion). + */ + public static final int CONTEXT_CLASS_SIGNATURE_PARENT_NAME = 24; + + /** + * The header for method documentation copied from parent. + */ + public static final int CONTEXT_METHOD_DOC_COPY = 26; + + /** + * Method "specified by" link. + */ + public static final int CONTEXT_METHOD_SPECIFIED_BY = 27; + + /** + * Method "overrides" link. + */ + public static final int CONTEXT_METHOD_OVERRIDES = 28; + + /** + * Annotation link. + */ + public static final int CONTEXT_ANNOTATION = 29; + + /** + * The header for field documentation copied from parent. + */ + public static final int CONTEXT_FIELD_DOC_COPY = 30; + + /** + * The parent nodes int the class tree. + */ + public static final int CONTEXT_CLASS_TREE_PARENT = 31; + + /** + * The type parameters of a method or constructor. + */ + public static final int CONTEXT_MEMBER_TYPE_PARAMS = 32; + + /** + * Indicate that the link appears in class use documentation. + */ + public static final int CONTEXT_CLASS_USE_HEADER = 33; + + /** + * The integer indicating the location of the link. + */ + public int context; + + /** + * The value of the marker #. + */ + public String where = ""; + + /** + * String style of text defined in style sheet. + */ + public String styleName =""; + + /** + * The valueof the target. + */ + public String target = ""; + + /** + * Construct a LinkInfo object. + * + * @param context the context of the link. + * @param classDoc the class to link to. + * @param label the label for the link. + * @param target the value of the target attribute. + */ + public LinkInfoImpl (int context, ClassDoc classDoc, String label, + String target){ + this.classDoc = classDoc; + this.label = label; + this.target = target; + setContext(context); + } + + /** + * Construct a LinkInfo object. + * + * @param context the context of the link. + * @param classDoc the class to link to. + * @param where the value of the marker #. + * @param label the label for the link. + * @param isBold true if the link should be bold. + * @param styleName String style of text defined in style sheet. + */ + public LinkInfoImpl (int context, ClassDoc classDoc, String where, String label, + boolean isBold, String styleName){ + this.classDoc = classDoc; + this.where = where; + this.label = label; + this.isBold = isBold; + this.styleName = styleName; + setContext(context); + } + + /** + * Construct a LinkInfo object. + * + * @param context the context of the link. + * @param classDoc the class to link to. + * @param where the value of the marker #. + * @param label the label for the link. + * @param isBold true if the link should be bold. + */ + public LinkInfoImpl (int context, ClassDoc classDoc, String where, String label, + boolean isBold){ + this.classDoc = classDoc; + this.where = where; + this.label = label; + this.isBold = isBold; + setContext(context); + } + + /** + * Construct a LinkInfo object. + * + * @param classDoc the class to link to. + * @param label the label for the link. + */ + public LinkInfoImpl (ClassDoc classDoc, String label){ + this.classDoc = classDoc; + this.label = label; + setContext(context); + } + + /** + * Construct a LinkInfo object. + * + * @param context the context of the link. + * @param executableMemberDoc the member to link to. + * @param isBold true if the link should be bold. + */ + public LinkInfoImpl (int context, ExecutableMemberDoc executableMemberDoc, + boolean isBold){ + this.executableMemberDoc = executableMemberDoc; + this.isBold = isBold; + setContext(context); + } + + /** + * Construct a LinkInfo object. + * + * @param context the context of the link. + * @param classDoc the class to link to. + * @param isBold true if the link should be bold. + */ + public LinkInfoImpl (int context, ClassDoc classDoc, boolean isBold){ + this.classDoc = classDoc; + this.isBold = isBold; + setContext(context); + } + + /** + * Construct a LinkInfo object. + * + * @param context the context of the link. + * @param type the class to link to. + */ + public LinkInfoImpl (int context, Type type){ + this.type = type; + setContext(context); + } + + /** + * Construct a LinkInfo object. + * + * @param context the context of the link. + * @param type the class to link to. + * @param isVarArg true if this is a link to a var arg. + */ + public LinkInfoImpl (int context, Type type, boolean isVarArg){ + this.type = type; + this.isVarArg = isVarArg; + setContext(context); + } + + /** + * Construct a LinkInfo object. + * + * @param context the context of the link. + * @param type the class to link to. + * @param label the label for the link. + * @param isBold true if the link should be bold. + */ + public LinkInfoImpl (int context, Type type, String label, + boolean isBold){ + this.type = type; + this.label = label; + this.isBold = isBold; + setContext(context); + } + + /** + * Construct a LinkInfo object. + * + * @param context the context of the link. + * @param classDoc the class to link to. + * @param label the label for the link. + * @param isBold true if the link should be bold. + */ + public LinkInfoImpl (int context, ClassDoc classDoc, String label, + boolean isBold){ + this.classDoc = classDoc; + this.label = label; + this.isBold = isBold; + setContext(context); + } + + /** + * {@inheritDoc} + */ + public int getContext() { + return context; + } + + /** + * {@inheritDoc} + * + * This method sets the link attributes to the appropriate values + * based on the context. + * + * @param c the context id to set. + */ + public void setContext(int c) { + //NOTE: Put context specific link code here. + switch (c) { + case ALL_CLASSES_FRAME: + case PACKAGE_FRAME: + case CONTEXT_IMPLEMENTED_CLASSES: + case CONTEXT_SUBCLASSES: + case CONTEXT_METHOD_DOC_COPY: + case CONTEXT_FIELD_DOC_COPY: + case CONTEXT_CLASS_USE_HEADER: + includeTypeInClassLinkLabel = false; + break; + + case CONTEXT_ANNOTATION: + excludeTypeParameterLinks = true; + excludeTypeBounds = true; + break; + + case CONTEXT_IMPLEMENTED_INTERFACES: + case CONTEXT_SUPER_INTERFACES: + case CONTEXT_SUBINTERFACES: + case CONTEXT_CLASS_TREE_PARENT: + case CONTEXT_TREE: + case CONTEXT_CLASS_SIGNATURE_PARENT_NAME: + excludeTypeParameterLinks = true; + excludeTypeBounds = true; + includeTypeInClassLinkLabel = false; + includeTypeAsSepLink = true; + break; + + case CONTEXT_PACKAGE: + case CONTEXT_CLASS_USE: + excludeTypeBoundsLinks = true; + excludeTypeParameterLinks = true; + break; + + case CONTEXT_CLASS_HEADER: + case CONTEXT_CLASS_SIGNATURE: + excludeTypeParameterLinks = true; + includeTypeAsSepLink = true; + includeTypeInClassLinkLabel = false; + break; + + case CONTEXT_MEMBER_TYPE_PARAMS: + includeTypeAsSepLink = true; + includeTypeInClassLinkLabel = false; + break; + + case CONTEXT_RETURN_TYPE: + case CONTEXT_SUMMARY_RETURN_TYPE: + case CONTEXT_EXECUTABLE_MEMBER_PARAM: + excludeTypeBounds = true; + break; + } + context = c; + if (type != null && + type.asTypeVariable()!= null && + type.asTypeVariable().owner() instanceof ExecutableMemberDoc){ + excludeTypeParameterLinks = true; + } + } + + /** + * Return true if this link is linkable and false if we can't link to the + * desired place. + * + * @return true if this link is linkable and false if we can't link to the + * desired place. + */ + public boolean isLinkable() { + return Util.isLinkable(classDoc, ConfigurationImpl.getInstance()); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkOutputImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkOutputImpl.java new file mode 100644 index 00000000000..948f55417ea --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/LinkOutputImpl.java @@ -0,0 +1,65 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.util.links.*; + +/** + * Stores output of a link. + * + * @author Jamie Ho + * @since 1.5 + */ +public class LinkOutputImpl implements LinkOutput { + + /** + * The output of the link. + */ + public StringBuffer output; + + /** + * Construct a new LinkOutputImpl. + */ + public LinkOutputImpl() { + output = new StringBuffer(); + } + + /** + * {@inheritDoc} + */ + public void append(Object o) { + output.append(o instanceof String ? + (String) o : ((LinkOutputImpl)o).toString()); + } + + /** + * {@inheritDoc} + */ + public String toString() { + return output.toString(); + } + +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java new file mode 100644 index 00000000000..16976c43eb2 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java @@ -0,0 +1,405 @@ +/* + * Copyright 1997-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.taglets.*; + +import java.io.*; +import com.sun.javadoc.*; + +/** + * Writes method documentation in HTML format. + * + * @author Robert Field + * @author Atul M Dambalkar + * @author Jamie Ho (rewrite) + */ +public class MethodWriterImpl extends AbstractExecutableMemberWriter + implements MethodWriter, MemberSummaryWriter { + + private boolean printedSummaryHeader = false; + + /** + * Construct a new MethodWriterImpl. + * + * @param writer the writer for the class that the methods belong to. + * @param classDoc the class being documented. + */ + public MethodWriterImpl(SubWriterHolderWriter writer, ClassDoc classDoc) { + super(writer, classDoc); + } + + /** + * Construct a new MethodWriterImpl. + * + * @param writer The writer for the class that the methods belong to. + */ + public MethodWriterImpl(SubWriterHolderWriter writer) { + super(writer); + } + + /** + * Write the methods summary header for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeMemberSummaryHeader(ClassDoc classDoc) { + printedSummaryHeader = true; + writer.println(); + writer.println(""); + writer.println(); + writer.printSummaryHeader(this, classDoc); + } + + /** + * Write the methods summary footer for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeMemberSummaryFooter(ClassDoc classDoc) { + writer.printSummaryFooter(this, classDoc); + } + + /** + * Write the inherited methods summary header for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) { + if(! printedSummaryHeader){ + //We don't want inherited summary to not be under heading. + writeMemberSummaryHeader(classDoc); + writeMemberSummaryFooter(classDoc); + printedSummaryHeader = true; + } + writer.printInheritedSummaryHeader(this, classDoc); + } + + /** + * {@inheritDoc} + */ + public void writeInheritedMemberSummary(ClassDoc classDoc, + ProgramElementDoc method, boolean isFirst, boolean isLast) { + writer.printInheritedSummaryMember(this, classDoc, method, isFirst); + } + + /** + * Write the inherited methods summary footer for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) { + writer.printInheritedSummaryFooter(this, classDoc); ; + } + + /** + * Write the header for the method documentation. + * + * @param classDoc the class that the methods belong to. + */ + public void writeHeader(ClassDoc classDoc, String header) { + writer.println(); + writer.println(""); + writer.println(); + writer.anchor("method_detail"); + writer.printTableHeadingBackground(header); + } + + /** + * Write the method header for the given method. + * + * @param method the method being documented. + * @param isFirst the flag to indicate whether or not the method is the + * first to be documented. + */ + public void writeMethodHeader(MethodDoc method, boolean isFirst) { + if (! isFirst) { + writer.printMemberHeader(); + } + writer.println(); + String erasureAnchor; + if ((erasureAnchor = getErasureAnchor(method)) != null) { + writer.anchor(erasureAnchor); + } + writer.anchor(method); + writer.h3(); + writer.print(method.name()); + writer.h3End(); + } + + /** + * Write the signature for the given method. + * + * @param method the method being documented. + */ + public void writeSignature(MethodDoc method) { + writer.displayLength = 0; + writer.pre(); + writer.writeAnnotationInfo(method); + printModifiers(method); + writeTypeParameters(method); + printReturnType(method); + if (configuration().linksource) { + writer.printSrcLink(method, method.name()); + } else { + bold(method.name()); + } + writeParameters(method); + writeExceptions(method); + writer.preEnd(); + writer.dl(); + } + + /** + * Write the deprecated output for the given method. + * + * @param method the method being documented. + */ + public void writeDeprecated(MethodDoc method) { + String output = ((TagletOutputImpl) + (new DeprecatedTaglet()).getTagletOutput(method, + writer.getTagletWriterInstance(false))).toString(); + if (output != null && output.trim().length() > 0) { + writer.print(output); + } + } + + /** + * Write the comments for the given method. + * + * @param method the method being documented. + */ + public void writeComments(Type holder, MethodDoc method) { + ClassDoc holderClassDoc = holder.asClassDoc(); + if (method.inlineTags().length > 0) { + if (holder.asClassDoc().equals(classdoc) || + (! (holderClassDoc.isPublic() || + Util.isLinkable(holderClassDoc, configuration())))) { + writer.dd(); + writer.printInlineComment(method); + } else { + String classlink = writer.codeText( + writer.getDocLink(LinkInfoImpl.CONTEXT_METHOD_DOC_COPY, + holder.asClassDoc(), method, + holder.asClassDoc().isIncluded() ? + holder.typeName() : holder.qualifiedTypeName(), + false)); + writer.dd(); + writer.boldText(holder.asClassDoc().isClass()? + "doclet.Description_From_Class": + "doclet.Description_From_Interface", + classlink); + writer.ddEnd(); + writer.dd(); + writer.printInlineComment(method); + } + } + } + + /** + * Write the tag output for the given method. + * + * @param method the method being documented. + */ + public void writeTags(MethodDoc method) { + writer.printTags(method); + } + + /** + * Write the method footer. + */ + public void writeMethodFooter() { + writer.ddEnd(); + writer.dlEnd(); + } + + /** + * Write the footer for the method documentation. + * + * @param classDoc the class that the methods belong to. + */ + public void writeFooter(ClassDoc classDoc) { + //No footer to write for method documentation + } + + /** + * Close the writer. + */ + public void close() throws IOException { + writer.close(); + } + + public int getMemberKind() { + return VisibleMemberMap.METHODS; + } + + public void printSummaryLabel(ClassDoc cd) { + writer.boldText("doclet.Method_Summary"); + } + + public void printSummaryAnchor(ClassDoc cd) { + writer.anchor("method_summary"); + } + + public void printInheritedSummaryAnchor(ClassDoc cd) { + writer.anchor("methods_inherited_from_class_" + + ConfigurationImpl.getInstance().getClassName(cd)); + } + + public void printInheritedSummaryLabel(ClassDoc cd) { + String classlink = writer.getPreQualifiedClassLink( + LinkInfoImpl.CONTEXT_MEMBER, cd, false); + writer.bold(); + String key = cd.isClass()? + "doclet.Methods_Inherited_From_Class" : + "doclet.Methods_Inherited_From_Interface"; + writer.printText(key, classlink); + writer.boldEnd(); + } + + protected void printSummaryType(ProgramElementDoc member) { + MethodDoc meth = (MethodDoc)member; + printModifierAndType(meth, meth.returnType()); + } + + protected static void printOverridden(HtmlDocletWriter writer, + Type overriddenType, MethodDoc method) { + if(writer.configuration.nocomment){ + return; + } + ClassDoc holderClassDoc = overriddenType.asClassDoc(); + if (! (holderClassDoc.isPublic() || + Util.isLinkable(holderClassDoc, writer.configuration()))) { + //This is an implementation detail that should not be documented. + return; + } + if (overriddenType.asClassDoc().isIncluded() && ! method.isIncluded()) { + //The class is included but the method is not. That means that it + //is not visible so don't document this. + return; + } + String label = "doclet.Overrides"; + int context = LinkInfoImpl.CONTEXT_METHOD_OVERRIDES; + + if (method != null) { + if(overriddenType.asClassDoc().isAbstract() && method.isAbstract()){ + //Abstract method is implemented from abstract class, + //not overridden + label = "doclet.Specified_By"; + context = LinkInfoImpl.CONTEXT_METHOD_SPECIFIED_BY; + } + String overriddenTypeLink = writer.codeText( + writer.getLink(new LinkInfoImpl(context, overriddenType))); + String name = method.name(); + writer.dt(); + writer.boldText(label); + writer.dd(); + String methLink = writer.codeText( + writer.getLink( + new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, + overriddenType.asClassDoc(), + writer.getAnchor(method), name, false) + )); + writer.printText("doclet.in_class", methLink, overriddenTypeLink); + } + } + + /** + * Parse the <Code> tag and return the text. + */ + protected String parseCodeTag(String tag){ + if(tag == null){ + return ""; + } + + String lc = tag.toLowerCase(); + int begin = lc.indexOf(""); + int end = lc.indexOf(""); + if(begin == -1 || end == -1 || end <= begin){ + return tag; + } else { + return tag.substring(begin + 6, end); + } + } + + protected static void printImplementsInfo(HtmlDocletWriter writer, + MethodDoc method) { + if(writer.configuration.nocomment){ + return; + } + ImplementedMethods implementedMethodsFinder = + new ImplementedMethods(method, writer.configuration); + MethodDoc[] implementedMethods = implementedMethodsFinder.build(); + for (int i = 0; i < implementedMethods.length; i++) { + MethodDoc implementedMeth = implementedMethods[i]; + Type intfac = implementedMethodsFinder.getMethodHolder(implementedMeth); + String methlink = ""; + String intfaclink = writer.codeText( + writer.getLink(new LinkInfoImpl( + LinkInfoImpl.CONTEXT_METHOD_SPECIFIED_BY, intfac))); + writer.dt(); + writer.boldText("doclet.Specified_By"); + writer.dd(); + methlink = writer.codeText(writer.getDocLink( + LinkInfoImpl.CONTEXT_MEMBER, implementedMeth, + implementedMeth.name(), false)); + writer.printText("doclet.in_interface", methlink, intfaclink); + } + + } + + protected void printReturnType(MethodDoc method) { + Type type = method.returnType(); + if (type != null) { + writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_RETURN_TYPE, + type)); + print(' '); + } + } + + protected void printNavSummaryLink(ClassDoc cd, boolean link) { + if (link) { + writer.printHyperLink("", (cd == null)? + "method_summary": + "methods_inherited_from_class_" + + ConfigurationImpl.getInstance().getClassName(cd), + ConfigurationImpl.getInstance().getText("doclet.navMethod")); + } else { + writer.printText("doclet.navMethod"); + } + } + + protected void printNavDetailLink(boolean link) { + if (link) { + writer.printHyperLink("", "method_detail", + ConfigurationImpl.getInstance().getText("doclet.navMethod")); + } else { + writer.printText("doclet.navMethod"); + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java new file mode 100644 index 00000000000..db1e21f40fe --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java @@ -0,0 +1,240 @@ +/* + * Copyright 1997-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.javadoc.*; + +import java.io.*; + +/** + * Writes nested class documentation in HTML format. + * + * @author Robert Field + * @author Atul M Dambalkar + * @author Jamie Ho (rewrite) + */ +public class NestedClassWriterImpl extends AbstractMemberWriter + implements MemberSummaryWriter { + + private boolean printedSummaryHeader = false; + + public NestedClassWriterImpl(SubWriterHolderWriter writer, + ClassDoc classdoc) { + super(writer, classdoc); + } + + public NestedClassWriterImpl(SubWriterHolderWriter writer) { + super(writer); + } + + /** + * Write the classes summary header for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeMemberSummaryHeader(ClassDoc classDoc) { + printedSummaryHeader = true; + writer.println(""); + writer.println(); + writer.printSummaryHeader(this, classDoc); + } + + /** + * Write the classes summary footer for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeMemberSummaryFooter(ClassDoc classDoc) { + writer.printSummaryFooter(this, classDoc); + } + + /** + * Write the inherited classes summary header for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeInheritedMemberSummaryHeader(ClassDoc classDoc) { + if(! printedSummaryHeader){ + //We don't want inherited summary to not be under heading. + writeMemberSummaryHeader(classDoc); + writeMemberSummaryFooter(classDoc); + printedSummaryHeader = true; + } + writer.printInheritedSummaryHeader(this, classDoc); + } + + /** + * {@inheritDoc} + */ + public void writeInheritedMemberSummary(ClassDoc classDoc, + ProgramElementDoc nestedClass, boolean isFirst, boolean isLast) { + writer.printInheritedSummaryMember(this, classDoc, nestedClass, isFirst); + } + + /** + * Write the inherited classes summary footer for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeInheritedMemberSummaryFooter(ClassDoc classDoc) { + writer.printInheritedSummaryFooter(this, classDoc); + writer.println(); + } + + /** + * Write the header for the nested class documentation. + * + * @param classDoc the class that the classes belong to. + */ + public void writeHeader(ClassDoc classDoc, String header) { + writer.anchor("nested class_detail"); + writer.printTableHeadingBackground(header); + } + + /** + * Write the nested class header for the given nested class. + * + * @param nestedClass the nested class being documented. + * @param isFirst the flag to indicate whether or not the nested class is the + * first to be documented. + */ + public void writeClassHeader(ClassDoc nestedClass, boolean isFirst) { + if (! isFirst) { + writer.printMemberHeader(); + writer.println(""); + } + writer.anchor(nestedClass.name()); + writer.dl(); + writer.h3(); + writer.print(nestedClass.name()); + writer.h3End(); + } + + + + /** + * Close the writer. + */ + public void close() throws IOException { + writer.close(); + } + + public int getMemberKind() { + return VisibleMemberMap.INNERCLASSES; + } + + public void printSummaryLabel(ClassDoc cd) { + writer.boldText("doclet.Nested_Class_Summary"); + } + + public void printSummaryAnchor(ClassDoc cd) { + writer.anchor("nested_class_summary"); + } + + public void printInheritedSummaryAnchor(ClassDoc cd) { + writer.anchor("nested_classes_inherited_from_class_" + + cd.qualifiedName()); + } + + public void printInheritedSummaryLabel(ClassDoc cd) { + String clslink = writer.getPreQualifiedClassLink( + LinkInfoImpl.CONTEXT_MEMBER, cd, false); + writer.bold(); + writer.printText(cd.isInterface() ? + "doclet.Nested_Classes_Interface_Inherited_From_Interface" : + "doclet.Nested_Classes_Interfaces_Inherited_From_Class", + clslink); + writer.boldEnd(); + } + + protected void writeSummaryLink(int context, ClassDoc cd, ProgramElementDoc member) { + writer.bold(); + writer.printLink(new LinkInfoImpl(context, (ClassDoc)member, false)); + writer.boldEnd(); + } + + protected void writeInheritedSummaryLink(ClassDoc cd, + ProgramElementDoc member) { + writer.printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, + (ClassDoc)member, false)); + } + + protected void printSummaryType(ProgramElementDoc member) { + ClassDoc cd = (ClassDoc)member; + printModifierAndType(cd, null); + } + + protected void printHeader(ClassDoc cd) { + // N.A. + } + + protected void printBodyHtmlEnd(ClassDoc cd) { + // N.A. + } + + protected void printMember(ProgramElementDoc member) { + // N.A. + } + + protected void writeDeprecatedLink(ProgramElementDoc member) { + writer.printQualifiedClassLink(LinkInfoImpl.CONTEXT_MEMBER, + (ClassDoc)member); + } + + protected void printNavSummaryLink(ClassDoc cd, boolean link) { + if (link) { + writer.printHyperLink("", (cd == null) ? "nested_class_summary": + "nested_classes_inherited_from_class_" + + cd.qualifiedName(), + ConfigurationImpl.getInstance().getText("doclet.navNested")); + } else { + writer.printText("doclet.navNested"); + } + } + + protected void printNavDetailLink(boolean link) { + } + + protected void printMemberLink(ProgramElementDoc member) { + } + + protected void printMembersSummaryLink(ClassDoc cd, ClassDoc icd, + boolean link) { + if (link) { + writer.printHyperLink(cd.name() + ".html", + (cd == icd)? + "nested_class_summary": + "nested_classes_inherited_from_class_" + + icd.qualifiedName(), + ConfigurationImpl.getInstance().getText( + "doclet.Nested_Class_Summary")); + } else { + writer.printText("doclet.Nested_Class_Summary"); + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java new file mode 100644 index 00000000000..2a5da68ca2b --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java @@ -0,0 +1,216 @@ +/* + * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.*; + +import com.sun.javadoc.*; +import java.io.*; +import java.util.*; +/** + * Class to generate file for each package contents in the left-hand bottom + * frame. This will list all the Class Kinds in the package. A click on any + * class-kind will update the right-hand frame with the clicked class-kind page. + * + * @author Atul M Dambalkar + */ +public class PackageFrameWriter extends HtmlDocletWriter { + + /** + * The package being documented. + */ + private PackageDoc packageDoc; + + /** + * The classes to be documented. Use this to filter out classes + * that will not be documented. + */ + private Set documentedClasses; + + /** + * The name of the output file. + */ + public static final String OUTPUT_FILE_NAME = "package-frame.html"; + + /** + * Constructor to construct PackageFrameWriter object and to generate + * "package-frame.html" file in the respective package directory. + * For example for package "java.lang" this will generate file + * "package-frame.html" file in the "java/lang" directory. It will also + * create "java/lang" directory in the current or the destination directory + * if it doesen't exist. + * + * @param configuration the configuration of the doclet. + * @param packageDoc PackageDoc under consideration. + */ + public PackageFrameWriter(ConfigurationImpl configuration, + PackageDoc packageDoc) + throws IOException { + super(configuration, DirectoryManager.getDirectoryPath(packageDoc), OUTPUT_FILE_NAME, DirectoryManager.getRelativePath(packageDoc)); + this.packageDoc = packageDoc; + if (configuration.root.specifiedPackages().length == 0) { + documentedClasses = new HashSet(Arrays.asList(configuration.root.classes())); + } + } + + /** + * Generate a package summary page for the left-hand bottom frame. Construct + * the PackageFrameWriter object and then uses it generate the file. + * + * @param configuration the current configuration of the doclet. + * @param packageDoc The package for which "pacakge-frame.html" is to be generated. + */ + public static void generate(ConfigurationImpl configuration, + PackageDoc packageDoc) { + PackageFrameWriter packgen; + try { + packgen = new PackageFrameWriter(configuration, packageDoc); + String pkgName = Util.getPackageName(packageDoc); + packgen.printHtmlHeader(pkgName, configuration.metakeywords.getMetaKeywords(packageDoc), false); + packgen.printPackageHeader(pkgName); + packgen.generateClassListing(); + packgen.printBodyHtmlEnd(); + packgen.close(); + } catch (IOException exc) { + configuration.standardmessage.error( + "doclet.exception_encountered", + exc.toString(), OUTPUT_FILE_NAME); + throw new DocletAbortException(); + } + } + + /** + * Generate class listing for all the classes in this package. Divide class + * listing as per the class kind and generate separate listing for + * Classes, Interfaces, Exceptions and Errors. + */ + protected void generateClassListing() { + Configuration config = configuration(); + if (packageDoc.isIncluded()) { + generateClassKindListing(packageDoc.interfaces(), + configuration.getText("doclet.Interfaces")); + generateClassKindListing(packageDoc.ordinaryClasses(), + configuration.getText("doclet.Classes")); + generateClassKindListing(packageDoc.enums(), + configuration.getText("doclet.Enums")); + generateClassKindListing(packageDoc.exceptions(), + configuration.getText("doclet.Exceptions")); + generateClassKindListing(packageDoc.errors(), + configuration.getText("doclet.Errors")); + generateClassKindListing(packageDoc.annotationTypes(), + configuration.getText("doclet.AnnotationTypes")); + } else { + String name = Util.getPackageName(packageDoc); + generateClassKindListing(config.classDocCatalog.interfaces(name), + configuration.getText("doclet.Interfaces")); + generateClassKindListing(config.classDocCatalog.ordinaryClasses(name), + configuration.getText("doclet.Classes")); + generateClassKindListing(config.classDocCatalog.enums(name), + configuration.getText("doclet.Enums")); + generateClassKindListing(config.classDocCatalog.exceptions(name), + configuration.getText("doclet.Exceptions")); + generateClassKindListing(config.classDocCatalog.errors(name), + configuration.getText("doclet.Errors")); + generateClassKindListing(config.classDocCatalog.annotationTypes(name), + configuration.getText("doclet.AnnotationTypes")); + } + } + + /** + * Generate specific class kind listing. Also add label to the listing. + * + * @param arr Array of specific class kinds, namely Class or Interface or + * Exception or Error. + * @param label Label for the listing + */ + protected void generateClassKindListing(ClassDoc[] arr, String label) { + if(arr.length > 0) { + Arrays.sort(arr); + printPackageTableHeader(); + fontSizeStyle("+1", "FrameHeadingFont"); + boolean printedHeader = false; + for (int i = 0; i < arr.length; i++) { + if (documentedClasses != null && + !documentedClasses.contains(arr[i])) { + continue; + } + if (!Util.isCoreClass(arr[i]) || ! + configuration.isGeneratedDoc(arr[i])) { + continue; + } + if (!printedHeader) { + print(label); + fontEnd(); + println(" "); + fontStyle("FrameItemFont"); + printedHeader = true; + } + br(); + printLink(new LinkInfoImpl( + LinkInfoImpl.PACKAGE_FRAME, + arr[i], + (arr[i].isInterface() ? + italicsText(arr[i].name()) : + arr[i].name()),"classFrame") + ); + } + fontEnd(); + printPackageTableFooter(); + println(); + } + } + + /** + * Print the package link at the top of the class kind listing. Clicking + * this link, package-summary page will appear in the right hand frame. + * + * @param heading Top Heading to be used for the class kind listing. + */ + protected void printPackageHeader(String heading) { + fontSizeStyle("+1", "FrameTitleFont"); + printTargetPackageLink(packageDoc, "classFrame", heading); + fontEnd(); + } + + /** + * The table for the class kind listing. + */ + protected void printPackageTableHeader() { + table(); + tr(); + tdNowrap(); + } + + /** + * Closing Html tags for table of class kind listing. + */ + protected void printPackageTableFooter() { + tdEnd(); + trEnd(); + tableEnd(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java new file mode 100644 index 00000000000..20e412eb68a --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java @@ -0,0 +1,182 @@ +/* + * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.util.*; + +import com.sun.javadoc.*; +import java.io.*; + +/** + * Generate the package index for the left-hand frame in the generated output. + * A click on the package name in this frame will update the page in the bottom + * left hand frame with the listing of contents of the clicked package. + * + * @author Atul M Dambalkar + */ +public class PackageIndexFrameWriter extends AbstractPackageIndexWriter { + + /** + * Construct the PackageIndexFrameWriter object. + * + * @param filename Name of the package index file to be generated. + */ + public PackageIndexFrameWriter(ConfigurationImpl configuration, + String filename) throws IOException { + super(configuration, filename); + } + + /** + * Generate the package index file named "overview-frame.html". + * @throws DocletAbortException + */ + public static void generate(ConfigurationImpl configuration) { + PackageIndexFrameWriter packgen; + String filename = "overview-frame.html"; + try { + packgen = new PackageIndexFrameWriter(configuration, filename); + packgen.generatePackageIndexFile("doclet.Window_Overview", false); + packgen.close(); + } catch (IOException exc) { + configuration.standardmessage.error( + "doclet.exception_encountered", + exc.toString(), filename); + throw new DocletAbortException(); + } + } + + /** + * Print each package name on separate rows. + * + * @param pd PackageDoc + */ + protected void printIndexRow(PackageDoc pd) { + fontStyle("FrameItemFont"); + if (pd.name().length() > 0) { + print(getHyperLink(pathString(pd, "package-frame.html"), "", + pd.name(), false, "", "", "packageFrame")); + } else { + print(getHyperLink("package-frame.html", "", "<unnamed package>", + false, "", "", "packageFrame")); + } + fontEnd(); + br(); + } + + /** + * Print the "-packagesheader" string in bold format, at top of the page, + * if it is not the empty string. Otherwise print the "-header" string. + * Despite the name, there is actually no navigation bar for this page. + */ + protected void printNavigationBarHeader() { + printTableHeader(true); + fontSizeStyle("+1", "FrameTitleFont"); + if (configuration.packagesheader.length() > 0) { + bold(replaceDocRootDir(configuration.packagesheader)); + } else { + bold(replaceDocRootDir(configuration.header)); + } + fontEnd(); + printTableFooter(true); + } + + /** + * Do nothing as there is no overview information in this page. + */ + protected void printOverviewHeader() { + } + + /** + * Print Html "table" tag for the package index format. + * + * @param text Text string will not be used in this method. + */ + protected void printIndexHeader(String text) { + printTableHeader(false); + } + + /** + * Print Html closing "table" tag at the end of the package index. + */ + protected void printIndexFooter() { + printTableFooter(false); + } + + /** + * Print "All Classes" link at the top of the left-hand frame page. + */ + protected void printAllClassesPackagesLink() { + fontStyle("FrameItemFont"); + print(getHyperLink("allclasses-frame.html", "", + configuration.getText("doclet.All_Classes"), false, "", "", + "packageFrame")); + fontEnd(); + p(); + fontSizeStyle("+1", "FrameHeadingFont"); + printText("doclet.Packages"); + fontEnd(); + br(); + } + + /** + * Just print some space, since there is no navigation bar for this page. + */ + protected void printNavigationBarFooter() { + p(); + space(); + } + + /** + * Print Html closing tags for the table for package index. + * + * @param isHeading true if this is a table for a heading. + */ + private void printTableFooter(boolean isHeading) { + if (isHeading) { + thEnd(); + } else { + tdEnd(); + } + trEnd(); + tableEnd(); + } + + /** + * Print Html tags for the table for package index. + * + * @param isHeading true if this is a table for a heading. + */ + private void printTableHeader(boolean isHeading) { + table(); + tr(); + if (isHeading) { + thAlignNowrap("left"); + } else { + tdNowrap(); + } + + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java new file mode 100644 index 00000000000..b794d3e72c9 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java @@ -0,0 +1,213 @@ +/* + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.javadoc.*; +import java.io.*; +import java.util.*; + +/** + * Generate the package index page "overview-summary.html" for the right-hand + * frame. A click on the package name on this page will update the same frame + * with the "pacakge-summary.html" file for the clicked package. + * + * @author Atul M Dambalkar + */ +public class PackageIndexWriter extends AbstractPackageIndexWriter { + + /** + * Root of the program structure. Used for "overview" documentation. + */ + private RootDoc root; + + /** + * Map representing the group of packages as specified on the command line. + * + * @see Group + */ + private Map groupPackageMap; + + /** + * List to store the order groups as specified on the command line. + */ + private List groupList; + + /** + * Construct the PackageIndexWriter. Also constructs the grouping + * information as provided on the command line by "-group" option. Stores + * the order of groups specified by the user. + * + * @see Group + */ + public PackageIndexWriter(ConfigurationImpl configuration, + String filename) + throws IOException { + super(configuration, filename); + this.root = configuration.root; + groupPackageMap = configuration.group.groupPackages(packages); + groupList = configuration.group.getGroupList(); + } + + /** + * Generate the package index page for the right-hand frame. + * + * @param configuration the current configuration of the doclet. + */ + public static void generate(ConfigurationImpl configuration) { + PackageIndexWriter packgen; + String filename = "overview-summary.html"; + try { + packgen = new PackageIndexWriter(configuration, filename); + packgen.generatePackageIndexFile("doclet.Window_Overview_Summary", true); + packgen.close(); + } catch (IOException exc) { + configuration.standardmessage.error( + "doclet.exception_encountered", + exc.toString(), filename); + throw new DocletAbortException(); + } + } + + /** + * Print each package in separate rows in the index table. Generate link + * to each package. + * + * @param pkg Package to which link is to be generated. + */ + protected void printIndexRow(PackageDoc pkg) { + if(pkg != null && pkg.name().length() > 0) { + trBgcolorStyle("white", "TableRowColor"); + summaryRow(20); + bold(); + printPackageLink(pkg, Util.getPackageName(pkg), false); + boldEnd(); + summaryRowEnd(); + summaryRow(0); + printSummaryComment(pkg); + summaryRowEnd(); + trEnd(); + } + } + + /** + * Depending upon the grouping information and their titles, generate + * separate table indices for each package group. + */ + protected void generateIndex() { + for (int i = 0; i < groupList.size(); i++) { + String groupname = (String)groupList.get(i); + List list = (List)groupPackageMap.get(groupname); + if (list != null && list.size() > 0) { + printIndexContents((PackageDoc[])list. + toArray(new PackageDoc[list.size()]), + groupname); + } + } + } + + /** + * Print the overview summary comment for this documentation. Print one line + * summary at the top of the page and generate a link to the description, + * which is generated at the end of this page. + */ + protected void printOverviewHeader() { + if (root.inlineTags().length > 0) { + printSummaryComment(root); + p(); + bold(configuration.getText("doclet.See")); + br(); + printNbsps(); + printHyperLink("", "overview_description", + configuration.getText("doclet.Description"), true); + p(); + } + } + + /** + * Print Html tags for the table for this package index. + */ + protected void printIndexHeader(String text) { + tableIndexSummary(); + tableHeaderStart("#CCCCFF"); + bold(text); + tableHeaderEnd(); + } + + /** + * Print Html closing tags for the table for this package index. + */ + protected void printIndexFooter() { + tableEnd(); + p(); + space(); + } + + /** + * Print the overview comment as provided in the file specified by the + * "-overview" option on the command line. + */ + protected void printOverviewComment() { + if (root.inlineTags().length > 0) { + anchor("overview_description"); + p(); + printInlineComment(root); + p(); + } + } + + /** + * Call {@link #printOverviewComment()} and then genrate the tag information + * as provided in the file specified by the "-overview" option on the + * command line. + */ + protected void printOverview() throws IOException { + printOverviewComment(); + printTags(root); + } + + /** + * Print the top text (from the -top option), the upper + * navigation bar, and then the title (from the"-title" + * option), at the top of page. + */ + protected void printNavigationBarHeader() { + printTop(); + navLinks(true); + hr(); + printConfigurationTitle(); + } + + /** + * Print the lower navigation bar and the bottom text + * (from the -bottom option) at the bottom of page. + */ + protected void printNavigationBarFooter() { + hr(); + navLinks(false); + printBottom(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java new file mode 100644 index 00000000000..6633af796a0 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java @@ -0,0 +1,197 @@ +/* + * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.javadoc.*; +import java.io.*; + +/** + * Class to generate Tree page for a package. The name of the file generated is + * "package-tree.html" and it is generated in the respective package directory. + * + * @author Atul M Dambalkar + */ +public class PackageTreeWriter extends AbstractTreeWriter { + + /** + * Package for which tree is to be generated. + */ + protected PackageDoc packagedoc; + + /** + * The previous package name in the alpha-order list. + */ + protected PackageDoc prev; + + /** + * The next package name in the alpha-order list. + */ + protected PackageDoc next; + + /** + * Constructor. + * @throws IOException + * @throws DocletAbortException + */ + public PackageTreeWriter(ConfigurationImpl configuration, + String path, String filename, + PackageDoc packagedoc, + PackageDoc prev, PackageDoc next) + throws IOException { + super(configuration, path, filename, + new ClassTree( + configuration.classDocCatalog.allClasses(packagedoc), + configuration), + packagedoc); + this.packagedoc = packagedoc; + this.prev = prev; + this.next = next; + } + + /** + * Construct a PackageTreeWriter object and then use it to generate the + * package tree page. + * + * @param pkg Package for which tree file is to be generated. + * @param prev Previous package in the alpha-ordered list. + * @param next Next package in the alpha-ordered list. + * @param noDeprecated If true, do not generate any information for + * deprecated classe or interfaces. + * @throws DocletAbortException + */ + public static void generate(ConfigurationImpl configuration, + PackageDoc pkg, PackageDoc prev, + PackageDoc next, boolean noDeprecated) { + PackageTreeWriter packgen; + String path = DirectoryManager.getDirectoryPath(pkg); + String filename = "package-tree.html"; + try { + packgen = new PackageTreeWriter(configuration, path, filename, pkg, + prev, next); + packgen.generatePackageTreeFile(); + packgen.close(); + } catch (IOException exc) { + configuration.standardmessage.error( + "doclet.exception_encountered", + exc.toString(), filename); + throw new DocletAbortException(); + } + } + + /** + * Generate a separate tree file for each package. + */ + protected void generatePackageTreeFile() throws IOException { + printHtmlHeader(packagedoc.name() + " " + + configuration.getText("doclet.Window_Class_Hierarchy"), null, true); + + printPackageTreeHeader(); + + if (configuration.packages.length > 1) { + printLinkToMainTree(); + } + + generateTree(classtree.baseclasses(), "doclet.Class_Hierarchy"); + generateTree(classtree.baseinterfaces(), "doclet.Interface_Hierarchy"); + generateTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy"); + generateTree(classtree.baseEnums(), "doclet.Enum_Hierarchy"); + + printPackageTreeFooter(); + printBottom(); + printBodyHtmlEnd(); + } + + /** + * Print the navigation bar header for the package tree file. + */ + protected void printPackageTreeHeader() { + printTop(); + navLinks(true); + hr(); + center(); + h2(configuration.getText("doclet.Hierarchy_For_Package", + Util.getPackageName(packagedoc))); + centerEnd(); + } + + /** + * Generate a link to the tree for all the packages. + */ + protected void printLinkToMainTree() { + dl(); + dt(); + boldText("doclet.Package_Hierarchies"); + dd(); + navLinkMainTree(configuration.getText("doclet.All_Packages")); + dlEnd(); + hr(); + } + + /** + * Print the navigation bar footer for the package tree file. + */ + protected void printPackageTreeFooter() { + hr(); + navLinks(false); + } + + /** + * Link for the previous package tree file. + */ + protected void navLinkPrevious() { + if (prev == null) { + navLinkPrevious(null); + } else { + String path = DirectoryManager.getRelativePath(packagedoc.name(), + prev.name()); + navLinkPrevious(path + "package-tree.html"); + } + } + + /** + * Link for the next package tree file. + */ + protected void navLinkNext() { + if (next == null) { + navLinkNext(null); + } else { + String path = DirectoryManager.getRelativePath(packagedoc.name(), + next.name()); + navLinkNext(path + "package-tree.html"); + } + } + + /** + * Link to the package summary page for the package of this tree. + */ + protected void navLinkPackage() { + navCellStart(); + printHyperLink("package-summary.html", "", configuration.getText("doclet.Package"), + true, "NavBarFont1"); + navCellEnd(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java new file mode 100644 index 00000000000..c16ce6d7483 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java @@ -0,0 +1,266 @@ +/* + * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.javadoc.*; +import java.io.*; +import java.util.*; + +/** + * Generate package usage information. + * + * @author Robert G. Field + */ +public class PackageUseWriter extends SubWriterHolderWriter { + + final PackageDoc pkgdoc; + final SortedMap usingPackageToUsedClasses = new TreeMap(); + + /** + * Constructor. + * + * @param filename the file to be generated. + * @throws IOException + * @throws DocletAbortException + */ + public PackageUseWriter(ConfigurationImpl configuration, + ClassUseMapper mapper, String filename, + PackageDoc pkgdoc) throws IOException { + super(configuration, DirectoryManager.getDirectoryPath(pkgdoc), + filename, + DirectoryManager.getRelativePath(pkgdoc.name())); + this.pkgdoc = pkgdoc; + + // by examining all classes in this package, find what packages + // use these classes - produce a map between using package and + // used classes. + ClassDoc[] content = pkgdoc.allClasses(); + for (int i = 0; i < content.length; ++i) { + ClassDoc usedClass = content[i]; + Set usingClasses = (Set)mapper.classToClass.get(usedClass.qualifiedName()); + if (usingClasses != null) { + for (Iterator it = usingClasses.iterator(); it.hasNext(); ) { + ClassDoc usingClass = (ClassDoc)it.next(); + PackageDoc usingPackage = usingClass.containingPackage(); + Set usedClasses = (Set)usingPackageToUsedClasses + .get(usingPackage.name()); + if (usedClasses == null) { + usedClasses = new TreeSet(); + usingPackageToUsedClasses.put(Util.getPackageName(usingPackage), + usedClasses); + } + usedClasses.add(usedClass); + } + } + } + } + + /** + * Generate a class page. + * + * @param configuration the current configuration of the doclet. + * @param mapper the mapping of the class usage. + * @param pkgdoc the package doc being documented. + */ + public static void generate(ConfigurationImpl configuration, + ClassUseMapper mapper, PackageDoc pkgdoc) { + PackageUseWriter pkgusegen; + String filename = "package-use.html"; + try { + pkgusegen = new PackageUseWriter(configuration, + mapper, filename, pkgdoc); + pkgusegen.generatePackageUseFile(); + pkgusegen.close(); + } catch (IOException exc) { + configuration.standardmessage.error( + "doclet.exception_encountered", + exc.toString(), filename); + throw new DocletAbortException(); + } + } + + + /** + * Print the class use list. + */ + protected void generatePackageUseFile() throws IOException { + printPackageUseHeader(); + + if (usingPackageToUsedClasses.isEmpty()) { + printText("doclet.ClassUse_No.usage.of.0", pkgdoc.name()); + p(); + } else { + generatePackageUse(); + } + + printPackageUseFooter(); + } + + /** + * Print the class use list. + */ + protected void generatePackageUse() throws IOException { + if (configuration.packages.length > 1) { + generatePackageList(); + } + generateClassList(); + } + + protected void generatePackageList() throws IOException { + tableIndexSummary(); + tableHeaderStart("#CCCCFF"); + printText("doclet.ClassUse_Packages.that.use.0", + getPackageLink(pkgdoc, Util.getPackageName(pkgdoc), false)); + tableHeaderEnd(); + Iterator it = usingPackageToUsedClasses.keySet().iterator(); + while (it.hasNext()) { + PackageDoc pkg = configuration.root.packageNamed((String)it.next()); + generatePackageUse(pkg); + } + tableEnd(); + space(); + p(); + } + + protected void generateClassList() throws IOException { + Iterator itp = usingPackageToUsedClasses.keySet().iterator(); + while (itp.hasNext()) { + String packageName = (String)itp.next(); + PackageDoc usingPackage = configuration.root.packageNamed(packageName); + if (usingPackage != null) { + anchor(usingPackage.name()); + } + tableIndexSummary(); + tableHeaderStart("#CCCCFF"); + printText("doclet.ClassUse_Classes.in.0.used.by.1", + getPackageLink(pkgdoc, Util.getPackageName(pkgdoc), false), + getPackageLink(usingPackage,Util.getPackageName(usingPackage), false)); + tableHeaderEnd(); + Iterator itc = + ((Collection)usingPackageToUsedClasses.get(packageName)) + .iterator(); + while (itc.hasNext()) { + printClassRow((ClassDoc)itc.next(), packageName); + } + tableEnd(); + space(); + p(); + } + } + + protected void printClassRow(ClassDoc usedClass, String packageName) { + String path = pathString(usedClass, + "class-use/" + usedClass.name() + ".html"); + + trBgcolorStyle("white", "TableRowColor"); + summaryRow(0); + bold(); + printHyperLink(path, packageName, usedClass.name(), true); + boldEnd(); + println(); br(); + printNbsps(); + printIndexComment(usedClass); + summaryRowEnd(); + trEnd(); + } + + /** + * Print the package use list. + */ + protected void generatePackageUse(PackageDoc pkg) throws IOException { + trBgcolorStyle("white", "TableRowColor"); + summaryRow(0); + //Just want an anchor here. + printHyperLink("", pkg.name(), Util.getPackageName(pkg), true); + summaryRowEnd(); + summaryRow(0); + if (pkg != null) { + printSummaryComment(pkg); + } + space(); + summaryRowEnd(); + trEnd(); + } + + /** + * Print the header for the class use Listing. + */ + protected void printPackageUseHeader() { + String packageLabel = configuration.getText("doclet.Package"); + String name = pkgdoc.name(); + printHtmlHeader(configuration.getText("doclet.Window_ClassUse_Header", + packageLabel, name), null, true); + printTop(); + navLinks(true); + hr(); + center(); + h2(); + boldText("doclet.ClassUse_Title", packageLabel, name); + h2End(); + centerEnd(); + } + + /** + * Print the footer for the class use Listing. + */ + protected void printPackageUseFooter() { + hr(); + navLinks(false); + printBottom(); + printBodyHtmlEnd(); + } + + + /** + * Print this package link + */ + protected void navLinkPackage() { + navCellStart(); + printHyperLink("package-summary.html", "", configuration.getText("doclet.Package"), + true, "NavBarFont1"); + navCellEnd(); + } + + /** + * Print class use link + */ + protected void navLinkClassUse() { + navCellRevStart(); + fontStyle("NavBarFont1Rev"); + boldText("doclet.navClassUse"); + fontEnd(); + navCellEnd(); + } + + protected void navLinkTree() { + navCellStart(); + printHyperLink("package-tree.html", "", configuration.getText("doclet.Tree"), + true, "NavBarFont1"); + navCellEnd(); + } + +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java new file mode 100644 index 00000000000..f7911c01c9c --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java @@ -0,0 +1,275 @@ +/* + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; + +import com.sun.javadoc.*; +import java.io.*; +import java.util.*; + +/** + * Class to generate file for each package contents in the right-hand + * frame. This will list all the Class Kinds in the package. A click on any + * class-kind will update the frame with the clicked class-kind page. + * + * @author Atul M Dambalkar + */ +public class PackageWriterImpl extends HtmlDocletWriter + implements PackageSummaryWriter { + + /** + * The prev package name in the alpha-order list. + */ + protected PackageDoc prev; + + /** + * The next package name in the alpha-order list. + */ + protected PackageDoc next; + + /** + * The package being documented. + */ + protected PackageDoc packageDoc; + + /** + * The name of the output file. + */ + private static final String OUTPUT_FILE_NAME = "package-summary.html"; + + /** + * Constructor to construct PackageWriter object and to generate + * "package-summary.html" file in the respective package directory. + * For example for package "java.lang" this will generate file + * "package-summary.html" file in the "java/lang" directory. It will also + * create "java/lang" directory in the current or the destination directory + * if it doesen't exist. + * + * @param configuration the configuration of the doclet. + * @param packageDoc PackageDoc under consideration. + * @param prev Previous package in the sorted array. + * @param next Next package in the sorted array. + */ + public PackageWriterImpl(ConfigurationImpl configuration, + PackageDoc packageDoc, PackageDoc prev, PackageDoc next) + throws IOException { + super(configuration, DirectoryManager.getDirectoryPath(packageDoc), OUTPUT_FILE_NAME, + DirectoryManager.getRelativePath(packageDoc.name())); + this.prev = prev; + this.next = next; + this.packageDoc = packageDoc; + } + + /** + * Return the name of the output file. + * + * @return the name of the output file. + */ + public String getOutputFileName() { + return OUTPUT_FILE_NAME; + } + + /** + * {@inheritDoc} + */ + public void writeSummaryHeader() {} + + /** + * {@inheritDoc} + */ + public void writeSummaryFooter() {} + + /** + * {@inheritDoc} + */ + public void writeClassesSummary(ClassDoc[] classes, String label) { + if(classes.length > 0) { + Arrays.sort(classes); + tableIndexSummary(); + boolean printedHeading = false; + for (int i = 0; i < classes.length; i++) { + if (!printedHeading) { + printFirstRow(label); + printedHeading = true; + } + if (!Util.isCoreClass(classes[i]) || + !configuration.isGeneratedDoc(classes[i])) { + continue; + } + trBgcolorStyle("white", "TableRowColor"); + summaryRow(15); + bold(); + printLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_PACKAGE, + classes[i], false)); + boldEnd(); + summaryRowEnd(); + summaryRow(0); + if (Util.isDeprecated(classes[i])) { + boldText("doclet.Deprecated"); + if (classes[i].tags("deprecated").length > 0) { + space(); + printSummaryDeprecatedComment(classes[i], + classes[i].tags("deprecated")[0]); + } + } else { + printSummaryComment(classes[i]); + } + summaryRowEnd(); + trEnd(); + } + tableEnd(); + println(" "); + p(); + } + } + + /** + * Print the table heading for the class-listing. + * + * @param label Label for the Class kind listing. + */ + protected void printFirstRow(String label) { + tableHeaderStart("#CCCCFF"); + bold(label); + tableHeaderEnd(); + } + + /** + * {@inheritDoc} + */ + public void writePackageDescription() { + if (packageDoc.inlineTags().length > 0) { + anchor("package_description"); + h2(configuration.getText("doclet.Package_Description", packageDoc.name())); + p(); + printInlineComment(packageDoc); + p(); + } + } + + /** + * {@inheritDoc} + */ + public void writePackageTags() { + printTags(packageDoc); + } + + /** + * {@inheritDoc} + */ + public void writePackageHeader(String heading) { + String pkgName = packageDoc.name(); + printHtmlHeader(pkgName, + configuration.metakeywords.getMetaKeywords(packageDoc), true); + printTop(); + navLinks(true); + hr(); + writeAnnotationInfo(packageDoc); + h2(configuration.getText("doclet.Package") + " " + heading); + if (packageDoc.inlineTags().length > 0 && ! configuration.nocomment) { + printSummaryComment(packageDoc); + p(); + bold(configuration.getText("doclet.See")); + br(); + printNbsps(); + printHyperLink("", "package_description", + configuration.getText("doclet.Description"), true); + p(); + } + } + + /** + * {@inheritDoc} + */ + public void writePackageFooter() { + hr(); + navLinks(false); + printBottom(); + printBodyHtmlEnd(); + } + + /** + * Print "Use" link for this pacakge in the navigation bar. + */ + protected void navLinkClassUse() { + navCellStart(); + printHyperLink("package-use.html", "", configuration.getText("doclet.navClassUse"), + true, "NavBarFont1"); + navCellEnd(); + } + + /** + * Print "PREV PACKAGE" link in the navigation bar. + */ + protected void navLinkPrevious() { + if (prev == null) { + printText("doclet.Prev_Package"); + } else { + String path = DirectoryManager.getRelativePath(packageDoc.name(), + prev.name()); + printHyperLink(path + "package-summary.html", "", + configuration.getText("doclet.Prev_Package"), true); + } + } + + /** + * Print "NEXT PACKAGE" link in the navigation bar. + */ + protected void navLinkNext() { + if (next == null) { + printText("doclet.Next_Package"); + } else { + String path = DirectoryManager.getRelativePath(packageDoc.name(), + next.name()); + printHyperLink(path + "package-summary.html", "", + configuration.getText("doclet.Next_Package"), true); + } + } + + /** + * Print "Tree" link in the navigation bar. This will be link to the package + * tree file. + */ + protected void navLinkTree() { + navCellStart(); + printHyperLink("package-tree.html", "", configuration.getText("doclet.Tree"), + true, "NavBarFont1"); + navCellEnd(); + } + + /** + * Highlight "Package" in the navigation bar, as this is the package page. + */ + protected void navLinkPackage() { + navCellRevStart(); + fontStyle("NavBarFont1Rev"); + boldText("doclet.Package"); + fontEnd(); + navCellEnd(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java new file mode 100644 index 00000000000..7dc668a077d --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java @@ -0,0 +1,166 @@ +/* + * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.javadoc.*; +import java.io.*; + +/** + * Generate the Serialized Form Information Page. + * + * @author Atul M Dambalkar + */ +public class SerializedFormWriterImpl extends SubWriterHolderWriter + implements com.sun.tools.doclets.internal.toolkit.SerializedFormWriter { + + private static final String FILE_NAME = "serialized-form.html"; + + /** + * @throws IOException + * @throws DocletAbortException + */ + public SerializedFormWriterImpl() throws IOException { + super(ConfigurationImpl.getInstance(), FILE_NAME); + } + + /** + * Writes the given header. + * + * @param header the header to write. + */ + public void writeHeader(String header) { + printHtmlHeader(header, null, true); + printTop(); + navLinks(true); + hr(); + center(); + h1(); + print(header); + h1End(); + centerEnd(); + } + + /** + * Write the given package header. + * + * @param packageName the package header to write. + */ + public void writePackageHeader(String packageName) { + hr(4, "noshade"); + tableHeader(); + thAlign("center"); + font("+2"); + boldText("doclet.Package"); + print(' '); + bold(packageName); + tableFooter(); + } + + /** + * Write the serial UID info. + * + * @param header the header that will show up before the UID. + * @param serialUID the serial UID to print. + */ + public void writeSerialUIDInfo(String header, String serialUID) { + bold(header + " "); + println(serialUID); + p(); + } + + /** + * Write the footer. + */ + public void writeFooter() { + p(); + hr(); + navLinks(false); + printBottom(); + printBodyHtmlEnd(); + } + + + /** + * Write the serializable class heading. + * + * @param classDoc the class being processed. + */ + public void writeClassHeader(ClassDoc classDoc) { + String classLink = (classDoc.isPublic() || classDoc.isProtected())? + getLink(new LinkInfoImpl(classDoc, + configuration.getClassName(classDoc))): + classDoc.qualifiedName(); + p(); + anchor(classDoc.qualifiedName()); + String superClassLink = + classDoc.superclassType() != null ? + getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_SERIALIZED_FORM, + classDoc.superclassType())) : + null; + + //Print the heading. + String className = superClassLink == null ? + configuration.getText( + "doclet.Class_0_implements_serializable", classLink) : + configuration.getText( + "doclet.Class_0_extends_implements_serializable", classLink, + superClassLink); + tableHeader(); + thAlignColspan("left", 2); + font("+2"); + bold(className); + tableFooter(); + p(); + } + + private void tableHeader() { + tableIndexSummary(); + trBgcolorStyle("#CCCCFF", "TableSubHeadingColor"); + } + + private void tableFooter() { + fontEnd(); + thEnd(); trEnd(); tableEnd(); + } + + /** + * Return an instance of a SerialFieldWriter. + * + * @return an instance of a SerialFieldWriter. + */ + public SerialFieldWriter getSerialFieldWriter(ClassDoc classDoc) { + return new HtmlSerialFieldWriter(this, classDoc); + } + + /** + * Return an instance of a SerialMethodWriter. + * + * @return an instance of a SerialMethodWriter. + */ + public SerialMethodWriter getSerialMethodWriter(ClassDoc classDoc) { + return new HtmlSerialMethodWriter(this, classDoc); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SingleIndexWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SingleIndexWriter.java new file mode 100644 index 00000000000..7b1305a0382 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SingleIndexWriter.java @@ -0,0 +1,115 @@ +/* + * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.util.*; + +import java.io.*; + +/** + * Generate only one index file for all the Member Names with Indexing in + * Unicode Order. The name of the generated file is "index-all.html" and it is + * generated in current or the destination directory. + * + * @see java.lang.Character + * @author Atul M Dambalkar + */ +public class SingleIndexWriter extends AbstractIndexWriter { + + /** + * Construct the SingleIndexWriter with filename "index-all.html" and the + * {@link IndexBuilder} + * + * @param filename Name of the index file to be generated. + * @param indexbuilder Unicode based Index from {@link IndexBuilder} + */ + public SingleIndexWriter(ConfigurationImpl configuration, + String filename, + IndexBuilder indexbuilder) throws IOException { + super(configuration, filename, indexbuilder); + relativepathNoSlash = "."; + relativePath = "./"; + } + + /** + * Generate single index file, for all Unicode characters. + * + * @param indexbuilder IndexBuilder built by {@link IndexBuilder} + * @throws DocletAbortException + */ + public static void generate(ConfigurationImpl configuration, + IndexBuilder indexbuilder) { + SingleIndexWriter indexgen; + String filename = "index-all.html"; + try { + indexgen = new SingleIndexWriter(configuration, + filename, indexbuilder); + indexgen.generateIndexFile(); + indexgen.close(); + } catch (IOException exc) { + configuration.standardmessage.error( + "doclet.exception_encountered", + exc.toString(), filename); + throw new DocletAbortException(); + } + } + + /** + * Generate the contents of each index file, with Header, Footer, + * Member Field, Method and Constructor Description. + */ + protected void generateIndexFile() throws IOException { + printHtmlHeader(configuration.getText("doclet.Window_Single_Index"), + null, true); + printTop(); + navLinks(true); + printLinksForIndexes(); + + hr(); + + for (int i = 0; i < indexbuilder.elements().length; i++) { + Character unicode = (Character)((indexbuilder.elements())[i]); + generateContents(unicode, indexbuilder.getMemberList(unicode)); + } + + printLinksForIndexes(); + navLinks(false); + + printBottom(); + printBodyHtmlEnd(); + } + + /** + * Print Links for all the Index Files per unicode character. + */ + protected void printLinksForIndexes() { + for (int i = 0; i < indexbuilder.elements().length; i++) { + String unicode = (indexbuilder.elements())[i].toString(); + printHyperLink("#_" + unicode + "_", unicode); + print(' '); + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SplitIndexWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SplitIndexWriter.java new file mode 100644 index 00000000000..06021438a3d --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SplitIndexWriter.java @@ -0,0 +1,164 @@ +/* + * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.util.*; + +import java.io.*; + +/** + * Generate Separate Index Files for all the member names with Indexing in + * Unicode Order. This will create "index-files" directory in the current or + * destination directory and will generate separate file for each unicode index. + * + * @see java.lang.Character + * @author Atul M Dambalkar + */ +public class SplitIndexWriter extends AbstractIndexWriter { + + /** + * Previous unicode character index in the built index. + */ + protected int prev; + + /** + * Next unicode character in the built index. + */ + protected int next; + + /** + * Construct the SplitIndexWriter. Uses path to this file and relative path + * from this file. + * + * @param path Path to the file which is getting generated. + * @param filename Name of the file which is getting genrated. + * @param relpath Relative path from this file to the current directory. + * @param indexbuilder Unicode based Index from {@link IndexBuilder} + */ + public SplitIndexWriter(ConfigurationImpl configuration, + String path, String filename, + String relpath, IndexBuilder indexbuilder, + int prev, int next) throws IOException { + super(configuration, path, filename, relpath, indexbuilder); + this.prev = prev; + this.next = next; + } + + /** + * Generate separate index files, for each Unicode character, listing all + * the members starting with the particular unicode character. + * + * @param indexbuilder IndexBuilder built by {@link IndexBuilder} + * @throws DocletAbortException + */ + public static void generate(ConfigurationImpl configuration, + IndexBuilder indexbuilder) { + SplitIndexWriter indexgen; + String filename = ""; + String path = DirectoryManager.getPath("index-files"); + String relpath = DirectoryManager.getRelativePath("index-files"); + try { + for (int i = 0; i < indexbuilder.elements().length; i++) { + int j = i + 1; + int prev = (j == 1)? -1: i; + int next = (j == indexbuilder.elements().length)? -1: j + 1; + filename = "index-" + j +".html"; + indexgen = new SplitIndexWriter(configuration, + path, filename, relpath, + indexbuilder, prev, next); + indexgen.generateIndexFile((Character)indexbuilder. + elements()[i]); + indexgen.close(); + } + } catch (IOException exc) { + configuration.standardmessage.error( + "doclet.exception_encountered", + exc.toString(), filename); + throw new DocletAbortException(); + } + } + + /** + * Generate the contents of each index file, with Header, Footer, + * Member Field, Method and Constructor Description. + * + * @param unicode Unicode character referring to the character for the + * index. + */ + protected void generateIndexFile(Character unicode) throws IOException { + printHtmlHeader(configuration.getText("doclet.Window_Split_Index", + unicode.toString()), null, true); + printTop(); + navLinks(true); + printLinksForIndexes(); + + hr(); + + generateContents(unicode, indexbuilder.getMemberList(unicode)); + + navLinks(false); + printLinksForIndexes(); + + printBottom(); + printBodyHtmlEnd(); + } + + /** + * Print Links for all the Index Files per unicode character. + */ + protected void printLinksForIndexes() { + for (int i = 0; i < indexbuilder.elements().length; i++) { + int j = i + 1; + printHyperLink("index-" + j + ".html", + indexbuilder.elements()[i].toString()); + print(' '); + } + } + + /** + * Print the previous unicode character index link. + */ + protected void navLinkPrevious() { + if (prev == -1) { + printText("doclet.Prev_Letter"); + } else { + printHyperLink("index-" + prev + ".html", "", + configuration.getText("doclet.Prev_Letter"), true); + } + } + + /** + * Print the next unicode character index link. + */ + protected void navLinkNext() { + if (next == -1) { + printText("doclet.Next_Letter"); + } else { + printHyperLink("index-" + next + ".html","", + configuration.getText("doclet.Next_Letter"), true); + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/StylesheetWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/StylesheetWriter.java new file mode 100644 index 00000000000..1384bbb2bd5 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/StylesheetWriter.java @@ -0,0 +1,122 @@ +/* + * Copyright 1998-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.util.*; + +import java.io.*; + +/** + * Writes the style sheet for the doclet output. + * + * @author Atul M Dambalkar + */ +public class StylesheetWriter extends HtmlDocletWriter { + + /** + * Constructor. + */ + public StylesheetWriter(ConfigurationImpl configuration, + String filename) throws IOException { + super(configuration, filename); + } + + /** + * Generate the style file contents. + * @throws DocletAbortException + */ + public static void generate(ConfigurationImpl configuration) { + StylesheetWriter stylegen; + String filename = ""; + try { + filename = "stylesheet.css"; + stylegen = new StylesheetWriter(configuration, filename); + stylegen.generateStyleFile(); + stylegen.close(); + } catch (IOException exc) { + configuration.standardmessage.error( + "doclet.exception_encountered", + exc.toString(), filename); + throw new DocletAbortException(); + } + } + + /** + * Generate the style file contents. + */ + protected void generateStyleFile() { + print("/* "); printText("doclet.Style_line_1"); println(" */"); + println(""); + + print("/* "); printText("doclet.Style_line_2"); println(" */"); + println(""); + + print("/* "); printText("doclet.Style_line_3"); println(" */"); + println("body { background-color: #FFFFFF; color:#000000 }"); + println(""); + + print("/* "); printText("doclet.Style_Headings"); println(" */"); + println("h1 { font-size: 145% }"); + println(""); + + print("/* "); printText("doclet.Style_line_4"); println(" */"); + print(".TableHeadingColor { background: #CCCCFF; color:#000000 }"); + print(" /* "); printText("doclet.Style_line_5"); println(" */"); + print(".TableSubHeadingColor { background: #EEEEFF; color:#000000 }"); + print(" /* "); printText("doclet.Style_line_6"); println(" */"); + print(".TableRowColor { background: #FFFFFF; color:#000000 }"); + print(" /* "); printText("doclet.Style_line_7"); println(" */"); + println(""); + + print("/* "); printText("doclet.Style_line_8"); println(" */"); + println(".FrameTitleFont { font-size: 100%; font-family: Helvetica, Arial, sans-serif; color:#000000 }"); + println(".FrameHeadingFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }"); + println(".FrameItemFont { font-size: 90%; font-family: Helvetica, Arial, sans-serif; color:#000000 }"); + println(""); + + // Removed doclet.Style_line_9 as no longer needed + + print("/* "); printText("doclet.Style_line_10"); println(" */"); + print(".NavBarCell1 { background-color:#EEEEFF; color:#000000}"); + print(" /* "); printText("doclet.Style_line_6"); println(" */"); + print(".NavBarCell1Rev { background-color:#00008B; color:#FFFFFF}"); + print(" /* "); printText("doclet.Style_line_11"); println(" */"); + + print(".NavBarFont1 { font-family: Arial, Helvetica, sans-serif; color:#000000;"); + println("color:#000000;}"); + print(".NavBarFont1Rev { font-family: Arial, Helvetica, sans-serif; color:#FFFFFF;"); + println("color:#FFFFFF;}"); + println(""); + + print(".NavBarCell2 { font-family: Arial, Helvetica, sans-serif; "); + println("background-color:#FFFFFF; color:#000000}"); + print(".NavBarCell3 { font-family: Arial, Helvetica, sans-serif; "); + println("background-color:#FFFFFF; color:#000000}"); + println(""); + + } + +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java new file mode 100644 index 00000000000..e82966cf848 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java @@ -0,0 +1,175 @@ +/* + * Copyright 1997-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.javadoc.*; +import com.sun.tools.doclets.internal.toolkit.util.*; + +import java.io.*; + +/** + * This abstract class exists to provide functionality needed in the + * the formatting of member information. Since AbstractSubWriter and its + * subclasses control this, they would be the logical place to put this. + * However, because each member type has its own subclass, subclassing + * can not be used effectively to change formatting. The concrete + * class subclass of this class can be subclassed to change formatting. + * + * @see AbstractMemberWriter + * @see ClassWriterImpl + * + * @author Robert Field + * @author Atul M Dambalkar + */ +public abstract class SubWriterHolderWriter extends HtmlDocletWriter { + + public SubWriterHolderWriter(ConfigurationImpl configuration, + String filename) throws IOException { + super(configuration, filename); + } + + + public SubWriterHolderWriter(ConfigurationImpl configuration, + String path, String filename, String relpath) + throws IOException { + super(configuration, path, filename, relpath); + } + + public void printTypeSummaryHeader() { + tdIndex(); + font("-1"); + code(); + } + + public void printTypeSummaryFooter() { + codeEnd(); + fontEnd(); + tdEnd(); + } + + public void printSummaryHeader(AbstractMemberWriter mw, ClassDoc cd) { + mw.printSummaryAnchor(cd); + tableIndexSummary(); + tableHeaderStart("#CCCCFF"); + mw.printSummaryLabel(cd); + tableHeaderEnd(); + } + + public void printTableHeadingBackground(String str) { + tableIndexDetail(); + tableHeaderStart("#CCCCFF", 1); + bold(str); + tableHeaderEnd(); + tableEnd(); + } + + public void printInheritedSummaryHeader(AbstractMemberWriter mw, ClassDoc cd) { + mw.printInheritedSummaryAnchor(cd); + tableIndexSummary(); + tableInheritedHeaderStart("#EEEEFF"); + mw.printInheritedSummaryLabel(cd); + tableInheritedHeaderEnd(); + trBgcolorStyle("white", "TableRowColor"); + summaryRow(0); + code(); + } + + public void printSummaryFooter(AbstractMemberWriter mw, ClassDoc cd) { + tableEnd(); + space(); + } + + public void printInheritedSummaryFooter(AbstractMemberWriter mw, ClassDoc cd) { + codeEnd(); + summaryRowEnd(); + trEnd(); + tableEnd(); + space(); + } + + protected void printIndexComment(Doc member) { + printIndexComment(member, member.firstSentenceTags()); + } + + protected void printIndexComment(Doc member, Tag[] firstSentenceTags) { + Tag[] deprs = member.tags("deprecated"); + if (Util.isDeprecated((ProgramElementDoc) member)) { + boldText("doclet.Deprecated"); + space(); + if (deprs.length > 0) { + printInlineDeprecatedComment(member, deprs[0]); + } + return; + } else { + ClassDoc cd = ((ProgramElementDoc)member).containingClass(); + if (cd != null && Util.isDeprecated(cd)) { + boldText("doclet.Deprecated"); space(); + } + } + printSummaryComment(member, firstSentenceTags); + } + + public void printSummaryLinkType(AbstractMemberWriter mw, + ProgramElementDoc member) { + trBgcolorStyle("white", "TableRowColor"); + mw.printSummaryType(member); + summaryRow(0); + code(); + } + + public void printSummaryLinkComment(AbstractMemberWriter mw, + ProgramElementDoc member) { + printSummaryLinkComment(mw, member, member.firstSentenceTags()); + } + + public void printSummaryLinkComment(AbstractMemberWriter mw, + ProgramElementDoc member, + Tag[] firstSentenceTags) { + codeEnd(); + println(); + br(); + printNbsps(); + printIndexComment(member, firstSentenceTags); + summaryRowEnd(); + trEnd(); + } + + public void printInheritedSummaryMember(AbstractMemberWriter mw, ClassDoc cd, + ProgramElementDoc member, boolean isFirst) { + if (! isFirst) { + mw.print(", "); + } + mw.writeInheritedSummaryLink(cd, member); + } + + public void printMemberHeader() { + hr(); + } + + public void printMemberFooter() { + } + +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletOutputImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletOutputImpl.java new file mode 100644 index 00000000000..af8532486fe --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletOutputImpl.java @@ -0,0 +1,70 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.taglets.*; + +/** + * The output for HTML taglets. + * + * @since 1.5 + * @author Jamie Ho + */ + +public class TagletOutputImpl implements TagletOutput { + + private StringBuffer output; + + public TagletOutputImpl(String o) { + setOutput(o); + } + + /** + * {@inheritDoc} + */ + public void setOutput (Object o) { + output = new StringBuffer(o == null ? "" : (String) o); + } + + /** + * {@inheritDoc} + */ + public void appendOutput(TagletOutput o) { + output.append(o.toString()); + } + + /** + * {@inheritDoc} + */ + public boolean hasInheritDocTag() { + return output.indexOf(InheritDocTaglet.INHERIT_DOC_INLINE_TAG) != -1; + } + + public String toString() { + return output.toString(); + } + +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java new file mode 100644 index 00000000000..6a82d06f0f0 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TagletWriterImpl.java @@ -0,0 +1,304 @@ +/* + * Copyright 2003-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.builders.SerializedFormBuilder; +import com.sun.tools.doclets.internal.toolkit.taglets.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.javadoc.*; + +/** + * The taglet writer that writes HTML. + * + * @since 1.5 + * @author Jamie Ho + */ + +public class TagletWriterImpl extends TagletWriter { + + private HtmlDocletWriter htmlWriter; + + public TagletWriterImpl(HtmlDocletWriter htmlWriter, boolean isFirstSentence) { + this.htmlWriter = htmlWriter; + this.isFirstSentence = isFirstSentence; + } + + /** + * {@inheritDoc} + */ + public TagletOutput getOutputInstance() { + return new TagletOutputImpl(""); + } + + /** + * {@inheritDoc} + */ + public TagletOutput getDocRootOutput() { + return new TagletOutputImpl(htmlWriter.relativepathNoSlash); + } + + /** + * {@inheritDoc} + */ + public TagletOutput deprecatedTagOutput(Doc doc) { + StringBuffer output = new StringBuffer(); + Tag[] deprs = doc.tags("deprecated"); + if (doc instanceof ClassDoc) { + if (Util.isDeprecated((ProgramElementDoc) doc)) { + output.append("" + + ConfigurationImpl.getInstance(). + getText("doclet.Deprecated") + " "); + if (deprs.length > 0) { + Tag[] commentTags = deprs[0].inlineTags(); + if (commentTags.length > 0) { + + output.append(commentTagsToOutput(null, doc, + deprs[0].inlineTags(), false).toString() + ); + } + } + output.append("

    "); + } + } else { + MemberDoc member = (MemberDoc) doc; + if (Util.isDeprecated((ProgramElementDoc) doc)) { + output.append("

    " + + ConfigurationImpl.getInstance(). + getText("doclet.Deprecated") + " "); + if (deprs.length > 0) { + output.append(""); + output.append(commentTagsToOutput(null, doc, + deprs[0].inlineTags(), false).toString()); + output.append(""); + } + if (member instanceof ExecutableMemberDoc) { + output.append(DocletConstants.NL + "

    " + + DocletConstants.NL); + } + } else { + if (Util.isDeprecated(member.containingClass())) { + output.append("

    " + + ConfigurationImpl.getInstance(). + getText("doclet.Deprecated") + " "); + } + } + } + return new TagletOutputImpl(output.toString()); + } + + /** + * {@inheritDoc} + */ + public MessageRetriever getMsgRetriever() { + return htmlWriter.configuration.message; + } + + /** + * {@inheritDoc} + */ + public TagletOutput getParamHeader(String header) { + StringBuffer result = new StringBuffer(); + result.append("
    "); + result.append("" + header + ""); + return new TagletOutputImpl(result.toString()); + } + + /** + * {@inheritDoc} + */ + public TagletOutput paramTagOutput(ParamTag paramTag, String paramName) { + TagletOutput result = new TagletOutputImpl("
    " + paramName + "" + + " - " + htmlWriter.commentTagsToString(paramTag, null, paramTag.inlineTags(), false)); + return result; + } + + /** + * {@inheritDoc} + */ + public TagletOutput returnTagOutput(Tag returnTag) { + TagletOutput result = new TagletOutputImpl(DocletConstants.NL + "
    " + + "" + htmlWriter.configuration.getText("doclet.Returns") + + "" + "
    " + + htmlWriter.commentTagsToString(returnTag, null, returnTag.inlineTags(), + false)); + return result; + } + + /** + * {@inheritDoc} + */ + public TagletOutput seeTagOutput(Doc holder, SeeTag[] seeTags) { + String result = ""; + if (seeTags.length > 0) { + result = addSeeHeader(result); + for (int i = 0; i < seeTags.length; ++i) { + if (i > 0) { + result += ", " + DocletConstants.NL; + } + result += htmlWriter.seeTagToString(seeTags[i]); + } + } + if (holder.isField() && ((FieldDoc)holder).constantValue() != null && + htmlWriter instanceof ClassWriterImpl) { + //Automatically add link to constant values page for constant fields. + result = addSeeHeader(result); + result += htmlWriter.getHyperLink(htmlWriter.relativePath + + ConfigurationImpl.CONSTANTS_FILE_NAME + + "#" + ((ClassWriterImpl) htmlWriter).getClassDoc().qualifiedName() + + "." + ((FieldDoc) holder).name(), + htmlWriter.configuration.getText("doclet.Constants_Summary")); + } + if (holder.isClass() && ((ClassDoc)holder).isSerializable()) { + //Automatically add link to serialized form page for serializable classes. + if (!(SerializedFormBuilder.serialInclude(holder) && + SerializedFormBuilder.serialInclude(((ClassDoc)holder).containingPackage()))) { + return result.equals("") ? null : new TagletOutputImpl(result); + } + result = addSeeHeader(result); + result += htmlWriter.getHyperLink(htmlWriter.relativePath + "serialized-form.html", + ((ClassDoc)holder).qualifiedName(), htmlWriter.configuration.getText("doclet.Serialized_Form"), false); + } + return result.equals("") ? null : new TagletOutputImpl(result); + } + + private String addSeeHeader(String result) { + if (result != null && result.length() > 0) { + return result + ", " + DocletConstants.NL; + } else { + return "
    " + htmlWriter.configuration().getText("doclet.See_Also") + "
    "; + } + } + + /** + * {@inheritDoc} + */ + public TagletOutput simpleTagOutput(Tag[] simpleTags, String header) { + String result = "
    " + header + "
    " + DocletConstants.NL + + "
    "; + for (int i = 0; i < simpleTags.length; i++) { + if (i > 0) { + result += ", "; + } + result += htmlWriter.commentTagsToString(simpleTags[i], null, simpleTags[i].inlineTags(), false); + } + return new TagletOutputImpl(result + "
    " + DocletConstants.NL); + } + + /** + * {@inheritDoc} + */ + public TagletOutput simpleTagOutput(Tag simpleTag, String header) { + return new TagletOutputImpl("
    " + header + "
    " + "
    " + + htmlWriter.commentTagsToString(simpleTag, null, simpleTag.inlineTags(), false) + + "
    " + DocletConstants.NL); + } + + /** + * {@inheritDoc} + */ + public TagletOutput getThrowsHeader() { + return new TagletOutputImpl(DocletConstants.NL + "
    " + "" + + htmlWriter.configuration().getText("doclet.Throws") + ""); + } + + /** + * {@inheritDoc} + */ + public TagletOutput throwsTagOutput(ThrowsTag throwsTag) { + String result = DocletConstants.NL + "
    "; + result += throwsTag.exceptionType() == null ? + htmlWriter.codeText(throwsTag.exceptionName()) : + htmlWriter.codeText( + htmlWriter.getLink(new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, + throwsTag.exceptionType()))); + TagletOutput text = new TagletOutputImpl( + htmlWriter.commentTagsToString(throwsTag, null, + throwsTag.inlineTags(), false)); + if (text != null && text.toString().length() > 0) { + result += " - " + text; + } + return new TagletOutputImpl(result); + } + + /** + * {@inheritDoc} + */ + public TagletOutput throwsTagOutput(Type throwsType) { + return new TagletOutputImpl(DocletConstants.NL + "
    " + + htmlWriter.codeText(htmlWriter.getLink( + new LinkInfoImpl(LinkInfoImpl.CONTEXT_MEMBER, throwsType)))); + } + + /** + * {@inheritDoc} + */ + public TagletOutput valueTagOutput(FieldDoc field, String constantVal, + boolean includeLink) { + return new TagletOutputImpl(includeLink ? + htmlWriter.getDocLink(LinkInfoImpl.CONTEXT_VALUE_TAG, field, + constantVal, false) : constantVal); + } + + /** + * {@inheritDoc} + */ + public TagletOutput commentTagsToOutput(Tag holderTag, Tag[] tags) { + return commentTagsToOutput(holderTag, null, tags, false); + } + + /** + * {@inheritDoc} + */ + public TagletOutput commentTagsToOutput(Doc holderDoc, Tag[] tags) { + return commentTagsToOutput(null, holderDoc, tags, false); + } + + /** + * {@inheritDoc} + */ + public TagletOutput commentTagsToOutput(Tag holderTag, + Doc holderDoc, Tag[] tags, boolean isFirstSentence) { + return new TagletOutputImpl(htmlWriter.commentTagsToString( + holderTag, holderDoc, tags, isFirstSentence)); + } + + /** + * {@inheritDoc} + */ + public Configuration configuration() { + return htmlWriter.configuration(); + } + + /** + * Return an instance of a TagletWriter that knows how to write HTML. + * + * @return an instance of a TagletWriter that knows how to write HTML. + */ + public TagletOutput getTagletOutputInstance() { + return new TagletOutputImpl(""); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java new file mode 100644 index 00000000000..77e6a10a4df --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java @@ -0,0 +1,171 @@ +/* + * Copyright 1997-2005 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.javadoc.*; +import java.io.*; +/** + * Generate Class Hierarchy page for all the Classes in this run. Use + * ClassTree for building the Tree. The name of + * the generated file is "overview-tree.html" and it is generated in the + * current or the destination directory. + * + * @author Atul M Dambalkar + */ +public class TreeWriter extends AbstractTreeWriter { + + /** + * Packages in this run. + */ + private PackageDoc[] packages; + + /** + * True if there are no packages specified on the command line, + * False otherwise. + */ + private boolean classesonly; + + /** + * Constructor to construct TreeWriter object. + * + * @param configuration the current configuration of the doclet. + * @param filename String filename + * @param classtree the tree being built. + */ + public TreeWriter(ConfigurationImpl configuration, + String filename, ClassTree classtree) + throws IOException { + super(configuration, filename, classtree); + packages = configuration.packages; + classesonly = packages.length == 0; + } + + /** + * Create a TreeWriter object and use it to generate the + * "overview-tree.html" file. + * + * @param classtree the class tree being documented. + * @throws DocletAbortException + */ + public static void generate(ConfigurationImpl configuration, + ClassTree classtree) { + TreeWriter treegen; + String filename = "overview-tree.html"; + try { + treegen = new TreeWriter(configuration, filename, classtree); + treegen.generateTreeFile(); + treegen.close(); + } catch (IOException exc) { + configuration.standardmessage.error( + "doclet.exception_encountered", + exc.toString(), filename); + throw new DocletAbortException(); + } + } + + /** + * Print the interface hierarchy and class hierarchy in the file. + */ + public void generateTreeFile() throws IOException { + printHtmlHeader(configuration.getText("doclet.Window_Class_Hierarchy"), + null, true); + + printTreeHeader(); + + printPageHeading(); + + printPackageTreeLinks(); + + generateTree(classtree.baseclasses(), "doclet.Class_Hierarchy"); + generateTree(classtree.baseinterfaces(), "doclet.Interface_Hierarchy"); + generateTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy"); + generateTree(classtree.baseEnums(), "doclet.Enum_Hierarchy"); + + printTreeFooter(); + } + + /** + * Generate the links to all the package tree files. + */ + protected void printPackageTreeLinks() { + //Do nothing if only unnamed package is used + if (packages.length == 1 && packages[0].name().length() == 0) { + return; + } + if (!classesonly) { + dl(); + dt(); + boldText("doclet.Package_Hierarchies"); + dd(); + for (int i = 0; i < packages.length; i++) { + if (packages[i].name().length() == 0) { + continue; + } + String filename = pathString(packages[i], "package-tree.html"); + printHyperLink(filename, "", packages[i].name()); + if (i < packages.length - 1) { + print(", "); + } + } + dlEnd(); + hr(); + } + } + + /** + * Print the top text (from the -top option) and + * navigation bar at the top of page. + */ + protected void printTreeHeader() { + printTop(); + navLinks(true); + hr(); + } + + /** + * Print the navigation bar and bottom text (from the -bottom option) + * at the bottom of page. + */ + protected void printTreeFooter() { + hr(); + navLinks(false); + printBottom(); + printBodyHtmlEnd(); + } + + /** + * Print the page title "Hierarchy For All Packages" at the top of the tree + * page. + */ + protected void printPageHeading() { + center(); + h2(); + printText("doclet.Hierarchy_For_All_Packages"); + h2End(); + centerEnd(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/WriterFactoryImpl.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/WriterFactoryImpl.java new file mode 100644 index 00000000000..e4a9d45e833 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/WriterFactoryImpl.java @@ -0,0 +1,198 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.javadoc.*; + +/** + * The factory that returns HTML writers. + * + * @author Jamie Ho + * @since 1.5 + */ +public class WriterFactoryImpl implements WriterFactory { + + private static WriterFactoryImpl instance; + + private ConfigurationImpl configuration; + + private WriterFactoryImpl(ConfigurationImpl configuration) { + this.configuration = configuration; + } + + /** + * Return an instance of this factory. + * + * @return an instance of this factory. + */ + public static WriterFactoryImpl getInstance() { + if (instance == null) { + instance = new WriterFactoryImpl(ConfigurationImpl.getInstance()); + } + return instance; + } + + /** + * {@inheritDoc} + */ + public ConstantsSummaryWriter getConstantsSummaryWriter() throws Exception { + return new ConstantsSummaryWriterImpl(configuration); + } + + /** + * {@inheritDoc} + */ + public PackageSummaryWriter getPackageSummaryWriter(PackageDoc packageDoc, + PackageDoc prevPkg, PackageDoc nextPkg) throws Exception { + return new PackageWriterImpl(ConfigurationImpl.getInstance(), packageDoc, + prevPkg, nextPkg); + } + + /** + * {@inheritDoc} + */ + public ClassWriter getClassWriter(ClassDoc classDoc, ClassDoc prevClass, + ClassDoc nextClass, ClassTree classTree) + throws Exception { + return new ClassWriterImpl(classDoc, prevClass, nextClass, classTree); + } + + /** + * {@inheritDoc} + */ + public AnnotationTypeWriter getAnnotationTypeWriter( + AnnotationTypeDoc annotationType, Type prevType, Type nextType) + throws Exception { + return new AnnotationTypeWriterImpl(annotationType, prevType, nextType); + } + + /** + * {@inheritDoc} + */ + public AnnotationTypeOptionalMemberWriter + getAnnotationTypeOptionalMemberWriter( + AnnotationTypeWriter annotationTypeWriter) throws Exception { + return new AnnotationTypeOptionalMemberWriterImpl( + (SubWriterHolderWriter) annotationTypeWriter, + annotationTypeWriter.getAnnotationTypeDoc()); + } + + /** + * {@inheritDoc} + */ + public AnnotationTypeRequiredMemberWriter + getAnnotationTypeRequiredMemberWriter(AnnotationTypeWriter annotationTypeWriter) throws Exception { + return new AnnotationTypeRequiredMemberWriterImpl( + (SubWriterHolderWriter) annotationTypeWriter, + annotationTypeWriter.getAnnotationTypeDoc()); + } + + /** + * {@inheritDoc} + */ + public EnumConstantWriter getEnumConstantWriter(ClassWriter classWriter) + throws Exception { + return new EnumConstantWriterImpl((SubWriterHolderWriter) classWriter, + classWriter.getClassDoc()); + } + + /** + * {@inheritDoc} + */ + public FieldWriter getFieldWriter(ClassWriter classWriter) + throws Exception { + return new FieldWriterImpl((SubWriterHolderWriter) classWriter, + classWriter.getClassDoc()); + } + + /** + * {@inheritDoc} + */ + public MethodWriter getMethodWriter(ClassWriter classWriter) + throws Exception { + return new MethodWriterImpl((SubWriterHolderWriter) classWriter, + classWriter.getClassDoc()); + } + + /** + * {@inheritDoc} + */ + public ConstructorWriter getConstructorWriter(ClassWriter classWriter) + throws Exception { + return new ConstructorWriterImpl((SubWriterHolderWriter) classWriter, + classWriter.getClassDoc()); + } + + /** + * {@inheritDoc} + */ + public MemberSummaryWriter getMemberSummaryWriter( + ClassWriter classWriter, int memberType) + throws Exception { + switch (memberType) { + case VisibleMemberMap.CONSTRUCTORS: + return (ConstructorWriterImpl) getConstructorWriter(classWriter); + case VisibleMemberMap.ENUM_CONSTANTS: + return (EnumConstantWriterImpl) getEnumConstantWriter(classWriter); + case VisibleMemberMap.FIELDS: + return (FieldWriterImpl) getFieldWriter(classWriter); + case VisibleMemberMap.INNERCLASSES: + return new NestedClassWriterImpl((SubWriterHolderWriter) + classWriter, classWriter.getClassDoc()); + case VisibleMemberMap.METHODS: + return (MethodWriterImpl) getMethodWriter(classWriter); + default: + return null; + } + } + + /** + * {@inheritDoc} + */ + public MemberSummaryWriter getMemberSummaryWriter( + AnnotationTypeWriter annotationTypeWriter, int memberType) + throws Exception { + switch (memberType) { + case VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL: + return (AnnotationTypeOptionalMemberWriterImpl) + getAnnotationTypeOptionalMemberWriter(annotationTypeWriter); + case VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED: + return (AnnotationTypeRequiredMemberWriterImpl) + getAnnotationTypeRequiredMemberWriter(annotationTypeWriter); + default: + return null; + } + } + + /** + * {@inheritDoc} + */ + public SerializedFormWriter getSerializedFormWriter() throws Exception { + return new SerializedFormWriterImpl(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java new file mode 100644 index 00000000000..cb8862a9510 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java @@ -0,0 +1,357 @@ +/* + * Copyright 1997-2007 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html.markup; + +import com.sun.tools.doclets.internal.toolkit.*; + +import com.sun.javadoc.*; +import java.io.*; +import java.util.*; +import com.sun.tools.doclets.internal.toolkit.util.*; + + +/** + * Class for the Html Format Code Generation specific to JavaDoc. + * This Class contains methods related to the Html Code Generation which + * are used by the Sub-Classes in the package com.sun.tools.doclets.standard + * and com.sun.tools.doclets.oneone. + * + * @since 1.2 + * @author Atul M Dambalkar + * @author Robert Field + */ +public abstract class HtmlDocWriter extends HtmlWriter { + + /** + * Constructor. Initializes the destination file name through the super + * class HtmlWriter. + * + * @param filename String file name. + */ + public HtmlDocWriter(Configuration configuration, + String filename) throws IOException { + super(configuration, + null, configuration.destDirName + filename, + configuration.docencoding); + configuration.message.notice("doclet.Generating_0", + configuration.destDirName + filename); + } + + public HtmlDocWriter(Configuration configuration, + String path, String filename) throws IOException { + super(configuration, + configuration.destDirName + path, filename, + configuration.docencoding); + configuration.message.notice("doclet.Generating_0", + configuration.destDirName + + ((path.length() > 0)? + path + File.separator: "") + filename); + } + + /** + * Accessor for configuration. + */ + public abstract Configuration configuration(); + + /** + * Print Html Hyper Link. + * + * @param link String name of the file. + * @param where Position of the link in the file. Character '#' is not + * needed. + * @param label Tag for the link. + * @param bold Boolean that sets label to bold. + */ + public void printHyperLink(String link, String where, + String label, boolean bold) { + print(getHyperLink(link, where, label, bold, "", "", "")); + } + + /** + * Print Html Hyper Link. + * + * @param link String name of the file. + * @param where Position of the link in the file. Character '#' is not + * needed. + * @param label Tag for the link. + */ + public void printHyperLink(String link, String where, String label) { + printHyperLink(link, where, label, false); + } + + /** + * Print Html Hyper Link. + * + * @param link String name of the file. + * @param where Position of the link in the file. Character '#' is not + * needed. + * @param label Tag for the link. + * @param bold Boolean that sets label to bold. + * @param stylename String style of text defined in style sheet. + */ + public void printHyperLink(String link, String where, + String label, boolean bold, + String stylename) { + print(getHyperLink(link, where, label, bold, stylename, "", "")); + } + + /** + * Return Html Hyper Link string. + * + * @param link String name of the file. + * @param where Position of the link in the file. Character '#' is not + * needed. + * @param label Tag for the link. + * @param bold Boolean that sets label to bold. + * @return String Hyper Link. + */ + public String getHyperLink(String link, String where, + String label, boolean bold) { + return getHyperLink(link, where, label, bold, "", "", ""); + } + + /** + * Get Html Hyper Link string. + * + * @param link String name of the file. + * @param where Position of the link in the file. Character '#' is not + * needed. + * @param label Tag for the link. + * @param bold Boolean that sets label to bold. + * @param stylename String style of text defined in style sheet. + * @return String Hyper Link. + */ + public String getHyperLink(String link, String where, + String label, boolean bold, + String stylename) { + return getHyperLink(link, where, label, bold, stylename, "", ""); + } + + /** + * Get Html Hyper Link string. + * + * @param link String name of the file. + * @param where Position of the link in the file. Character '#' is not + * needed. + * @param label Tag for the link. + * @param bold Boolean that sets label to bold. + * @param stylename String style of text defined in style sheet. + * @param title String that describes the link's content for accessibility. + * @param target Target frame. + * @return String Hyper Link. + */ + public String getHyperLink(String link, String where, + String label, boolean bold, + String stylename, String title, String target) { + StringBuffer retlink = new StringBuffer(); + retlink.append(""); + if (stylename != null && stylename.length() != 0) { + retlink.append(""); + } + if (bold) { + retlink.append(""); + } + retlink.append(label); + if (bold) { + retlink.append(""); + } + if (stylename != null && stylename.length() != 0) { + retlink.append(""); + } + retlink.append(""); + return retlink.toString(); + } + + /** + * Print link without positioning in the file. + * + * @param link String name of the file. + * @param label Tag for the link. + */ + public void printHyperLink(String link, String label) { + print(getHyperLink(link, "", label, false)); + } + + /** + * Get link string without positioning in the file. + * + * @param link String name of the file. + * @param label Tag for the link. + * @return Strign Hyper link. + */ + public String getHyperLink(String link, String label) { + return getHyperLink(link, "", label, false); + } + + /** + * Print the name of the package, this class is in. + * + * @param cd ClassDoc. + */ + public void printPkgName(ClassDoc cd) { + print(getPkgName(cd)); + } + + /** + * Get the name of the package, this class is in. + * + * @param cd ClassDoc. + */ + public String getPkgName(ClassDoc cd) { + String pkgName = cd.containingPackage().name(); + if (pkgName.length() > 0) { + pkgName += "."; + return pkgName; + } + return ""; + } + + /** + * Print the frameset version of the Html file header. + * Called only when generating an HTML frameset file. + * + * @param title Title of this HTML document. + */ + public void printFramesetHeader(String title) { + printFramesetHeader(title, false); + } + + /** + * Print the frameset version of the Html file header. + * Called only when generating an HTML frameset file. + * + * @param title Title of this HTML document. + * @param noTimeStamp If true, don't print time stamp in header. + */ + public void printFramesetHeader(String title, boolean noTimeStamp) { + println(""); + println(""); + html(); + head(); + if (! noTimeStamp) { + print(""); + } + if (configuration.charset.length() > 0) { + println(""); + } + title(); + println(title); + titleEnd(); + //Script to set the classFrame if necessary. + script(); + println(" targetPage = \"\" + window.location.search;"); + println(" if (targetPage != \"\" && targetPage != \"undefined\")"); + println(" targetPage = targetPage.substring(1);"); + println(" if (targetPage.indexOf(\":\") != -1)"); + println(" targetPage = \"undefined\";"); + + println(" function loadFrames() {"); + println(" if (targetPage != \"\" && targetPage != \"undefined\")"); + println(" top.classFrame.location = top.targetPage;"); + println(" }"); + scriptEnd(); + noScript(); + noScriptEnd(); + headEnd(); + } + + /** + * Print the appropriate spaces to format the class tree in the class page. + * + * @param len Number of spaces. + */ + public String spaces(int len) { + String space = ""; + + for (int i = 0; i < len; i++) { + space += " "; + } + return space; + } + + /** + * Print the closing </body> and </html> tags. + */ + public void printBodyHtmlEnd() { + println(); + bodyEnd(); + htmlEnd(); + } + + /** + * Calls {@link #printBodyHtmlEnd()} method. + */ + public void printFooter() { + printBodyHtmlEnd(); + } + + /** + * Print closing </html> tag. + */ + public void printFrameFooter() { + htmlEnd(); + } + + /** + * Print ten non-breaking spaces("&nbsp;"). + */ + public void printNbsps() { + print("          "); + } + + /** + * Get the day and date information for today, depending upon user option. + * + * @return String Today. + * @see java.util.Calendar + * @see java.util.GregorianCalendar + * @see java.util.TimeZone + */ + public String today() { + Calendar calendar = new GregorianCalendar(TimeZone.getDefault()); + return calendar.getTime().toString(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java new file mode 100644 index 00000000000..49c882127aa --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java @@ -0,0 +1,1105 @@ +/* + * Copyright 1997-2006 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.formats.html.markup; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import java.io.*; + +/** + * Class for the Html format code generation. + * Initilizes PrintWriter with FileWriter, to enable print + * related methods to generate the code to the named File through FileWriter. + * + * @since 1.2 + * @author Atul M Dambalkar + */ +public class HtmlWriter extends PrintWriter { + + /** + * Name of the file, to which this writer is writing to. + */ + protected final String htmlFilename; + + /** + * The window title of this file + */ + protected String winTitle; + + /** + * URL file separator string("/"). + */ + public static final String fileseparator = + DirectoryManager.URL_FILE_SEPERATOR; + + /** + * The configuration + */ + protected Configuration configuration; + + /** + * Constructor. + * + * @param path The directory path to be created for this file + * or null if none to be created. + * @param filename File Name to which the PrintWriter will + * do the Output. + * @param docencoding Encoding to be used for this file. + * @exception IOException Exception raised by the FileWriter is passed on + * to next level. + * @exception UnSupportedEncodingException Exception raised by the + * OutputStreamWriter is passed on to next level. + */ + public HtmlWriter(Configuration configuration, + String path, String filename, String docencoding) + throws IOException, UnsupportedEncodingException { + super(Util.genWriter(configuration, path, filename, docencoding)); + this.configuration = configuration; + htmlFilename = filename; + } + + /** + * Print <HTML> tag. Add a newline character at the end. + */ + public void html() { + println(""); + } + + /** + * Print </HTML> tag. Add a newline character at the end. + */ + public void htmlEnd() { + println(""); + } + + /** + * Print the script code to be embeded before the </HEAD> tag. + */ + protected void printWinTitleScript(String winTitle){ + if(winTitle != null && winTitle.length() > 0) { + script(); + println("function windowTitle()"); + println("{"); + println(" if (location.href.indexOf('is-external=true') == -1) {"); + println(" parent.document.title=\"" + winTitle + "\";"); + println(" }"); + println("}"); + scriptEnd(); + noScript(); + noScriptEnd(); + } + } + + /** + * Print the Javascript <SCRIPT> start tag with its type + * attribute. + */ + public void script() { + println(""); + } + + /** + * Print the Javascript <NOSCRIPT> start tag. + */ + public void noScript() { + println(""); + } + + /** + * Return the Javascript call to be embedded in the <BODY> tag. + * Return nothing if winTitle is empty. + * @return the Javascript call to be embedded in the <BODY> tag. + */ + protected String getWindowTitleOnload(){ + if(winTitle != null && winTitle.length() > 0) { + return " onload=\"windowTitle();\""; + } else { + return ""; + } + } + + /** + * Print <BODY BGCOLOR="bgcolor">, including JavaScript + * "onload" call to load windowtitle script. This script shows the name + * of the document in the window title bar when frames are on. + * + * @param bgcolor Background color. + * @param includeScript boolean set true if printing windowtitle script + */ + public void body(String bgcolor, boolean includeScript) { + print(""); + } + + /** + * Print </BODY> tag. Add a newline character at the end. + */ + public void bodyEnd() { + println(""); + } + + /** + * Print <TITLE> tag. Add a newline character at the end. + */ + public void title() { + println(""); + } + + /** + * Print <TITLE> tag. Add a newline character at the end. + * + * @param winTitle The title of this document. + */ + public void title(String winTitle) { + // Set window title string which is later printed + this.winTitle = winTitle; + title(); + } + + + /** + * Print </TITLE> tag. Add a newline character at the end. + */ + public void titleEnd() { + println(""); + } + + /** + * Print <UL> tag. Add a newline character at the end. + */ + public void ul() { + println("
      "); + } + + /** + * Print </UL> tag. Add a newline character at the end. + */ + public void ulEnd() { + println("
    "); + } + + /** + * Print <LI> tag. + */ + public void li() { + print("
  • "); + } + + /** + * Print <LI TYPE="type"> tag. + * + * @param type Type string. + */ + public void li(String type) { + print("
  • "); + } + + /** + * Print <H1> tag. Add a newline character at the end. + */ + public void h1() { + println("

    "); + } + + /** + * Print </H1> tag. Add a newline character at the end. + */ + public void h1End() { + println("

    "); + } + + /** + * Print text with <H1> tag. Also adds </H1> tag. Add a newline character + * at the end of the text. + * + * @param text Text to be printed with <H1> format. + */ + public void h1(String text) { + h1(); + println(text); + h1End(); + } + + /** + * Print <H2> tag. Add a newline character at the end. + */ + public void h2() { + println("

    "); + } + + /** + * Print text with <H2> tag. Also adds </H2> tag. Add a newline character + * at the end of the text. + * + * @param text Text to be printed with <H2> format. + */ + public void h2(String text) { + h2(); + println(text); + h2End(); + } + + /** + * Print </H2> tag. Add a newline character at the end. + */ + public void h2End() { + println("

    "); + } + + /** + * Print <H3> tag. Add a newline character at the end. + */ + public void h3() { + println("

    "); + } + + /** + * Print text with <H3> tag. Also adds </H3> tag. Add a newline character + * at the end of the text. + * + * @param text Text to be printed with <H3> format. + */ + public void h3(String text) { + h3(); + println(text); + h3End(); + } + + /** + * Print </H3> tag. Add a newline character at the end. + */ + public void h3End() { + println("

    "); + } + + /** + * Print <H4> tag. Add a newline character at the end. + */ + public void h4() { + println("

    "); + } + + /** + * Print </H4> tag. Add a newline character at the end. + */ + public void h4End() { + println("

    "); + } + + /** + * Print text with <H4> tag. Also adds </H4> tag. Add a newline character + * at the end of the text. + * + * @param text Text to be printed with <H4> format. + */ + public void h4(String text) { + h4(); + println(text); + h4End(); + } + + /** + * Print <H5> tag. Add a newline character at the end. + */ + public void h5() { + println("
    "); + } + + /** + * Print </H5> tag. Add a newline character at the end. + */ + public void h5End() { + println("
    "); + } + + /** + * Print HTML <IMG SRC="imggif" WIDTH="width" HEIGHT="height" ALT="imgname> + * tag. It prepends the "images" directory name to the "imggif". This + * method is used for oneone format generation. Add a newline character + * at the end. + * + * @param imggif Image GIF file. + * @param imgname Image name. + * @param width Width of the image. + * @param height Height of the image. + */ + public void img(String imggif, String imgname, int width, int height) { + println("\"""); + } + + /** + * Print <MENU> tag. Add a newline character at the end. + */ + public void menu() { + println(""); + } + + /** + * Print </MENU> tag. Add a newline character at the end. + */ + public void menuEnd() { + println(""); + } + + /** + * Print <PRE> tag. Add a newline character at the end. + */ + public void pre() { + println("
    ");
    +    }
    +
    +    /**
    +     * Print <PRE> tag without adding new line character at th eend.
    +     */
    +    public void preNoNewLine() {
    +        print("
    ");
    +    }
    +
    +    /**
    +     * Print </PRE> tag. Add a newline character at the end.
    +     */
    +    public void preEnd() {
    +        println("
    "); + } + + /** + * Print <HR> tag. Add a newline character at the end. + */ + public void hr() { + println("
    "); + } + + /** + * Print <HR SIZE="size" WIDTH="widthpercent%"> tag. Add a newline + * character at the end. + * + * @param size Size of the ruler. + * @param widthPercent Percentage Width of the ruler + */ + public void hr(int size, int widthPercent) { + println("
    "); + } + + /** + * Print <HR SIZE="size" NOSHADE> tag. Add a newline character at the end. + * + * @param size Size of the ruler. + * @param noshade noshade string. + */ + public void hr(int size, String noshade) { + println("
    "); + } + + /** + * Get the "<B>" string. + * + * @return String Return String "<B>"; + */ + public String getBold() { + return ""; + } + + /** + * Get the "</B>" string. + * + * @return String Return String "</B>"; + */ + public String getBoldEnd() { + return ""; + } + + /** + * Print <B> tag. + */ + public void bold() { + print(""); + } + + /** + * Print </B> tag. + */ + public void boldEnd() { + print(""); + } + + /** + * Print text passed, in bold format using <B> and </B> tags. + * + * @param text String to be printed in between <B> and </B> tags. + */ + public void bold(String text) { + bold(); + print(text); + boldEnd(); + } + + /** + * Print text passed, in Italics using <I> and </I> tags. + * + * @param text String to be printed in between <I> and </I> tags. + */ + public void italics(String text) { + print(""); + print(text); + println(""); + } + + /** + * Return, text passed, with Italics <I> and </I> tags, surrounding it. + * So if the text passed is "Hi", then string returned will be "<I>Hi</I>". + * + * @param text String to be printed in between <I> and </I> tags. + */ + public String italicsText(String text) { + return "" + text + ""; + } + + public String codeText(String text) { + return "" + text + ""; + } + + /** + * Print "&nbsp;", non-breaking space. + */ + public void space() { + print(" "); + } + + /** + * Print <DL> tag. Add a newline character at the end. + */ + public void dl() { + println("
    "); + } + + /** + * Print </DL> tag. Add a newline character at the end. + */ + public void dlEnd() { + println("
    "); + } + + /** + * Print <DT> tag. + */ + public void dt() { + print("
    "); + } + + /** + * Print <DT> tag. + */ + public void dd() { + print("
    "); + } + + /** + * Print </DD> tag. Add a newline character at the end. + */ + public void ddEnd() { + println("
    "); + } + + /** + * Print <SUP> tag. Add a newline character at the end. + */ + public void sup() { + println(""); + } + + /** + * Print </SUP> tag. Add a newline character at the end. + */ + public void supEnd() { + println(""); + } + + /** + * Print <FONT SIZE="size"> tag. Add a newline character at the end. + * + * @param size String size. + */ + public void font(String size) { + println(""); + } + + /** + * Print <FONT SIZE="size"> tag. + * + * @param size String size. + */ + public void fontNoNewLine(String size) { + print(""); + } + + /** + * Print <FONT CLASS="stylename"> tag. Add a newline character at the end. + * + * @param stylename String stylename. + */ + public void fontStyle(String stylename) { + print(""); + } + + /** + * Print <FONT SIZE="size" CLASS="stylename"> tag. Add a newline character + * at the end. + * + * @param size String size. + * @param stylename String stylename. + */ + public void fontSizeStyle(String size, String stylename) { + println(""); + } + + /** + * Print </FONT> tag. + */ + public void fontEnd() { + print(""); + } + + /** + * Get the "<FONT COLOR="color">" string. + * + * @param color String color. + * @return String Return String "<FONT COLOR="color">". + */ + public String getFontColor(String color) { + return ""; + } + + /** + * Get the "</FONT>" string. + * + * @return String Return String "</FONT>"; + */ + public String getFontEnd() { + return ""; + } + + /** + * Print <CENTER> tag. Add a newline character at the end. + */ + public void center() { + println("
    "); + } + + /** + * Print </CENTER> tag. Add a newline character at the end. + */ + public void centerEnd() { + println("
    "); + } + + /** + * Print anchor <A NAME="name"> tag. + * + * @param name Name String. + */ + public void aName(String name) { + print(""); + } + + /** + * Print </A> tag. + */ + public void aEnd() { + print(""); + } + + /** + * Print <I> tag. + */ + public void italic() { + print(""); + } + + /** + * Print </I> tag. + */ + public void italicEnd() { + print(""); + } + + /** + * Print contents within anchor <A NAME="name"> tags. + * + * @param name String name. + * @param content String contents. + */ + public void anchor(String name, String content) { + aName(name); + print(content); + aEnd(); + } + + /** + * Print anchor <A NAME="name"> and </A>tags. Print comment string + * "<!-- -->" within those tags. + * + * @param name String name. + */ + public void anchor(String name) { + anchor(name, ""); + } + + /** + * Print newline and then print <P> tag. Add a newline character at the + * end. + */ + public void p() { + println(); + println("

    "); + } + + /** + * Print newline and then print </P> tag. Add a newline character at the + * end. + */ + public void pEnd() { + println(); + println("

    "); + } + + /** + * Print newline and then print <BR> tag. Add a newline character at the + * end. + */ + public void br() { + println(); + println("
    "); + } + + /** + * Print <ADDRESS> tag. Add a newline character at the end. + */ + public void address() { + println("
    "); + } + + /** + * Print </ADDRESS> tag. Add a newline character at the end. + */ + public void addressEnd() { + println("
    "); + } + + /** + * Print <HEAD> tag. Add a newline character at the end. + */ + public void head() { + println(""); + } + + /** + * Print </HEAD> tag. Add a newline character at the end. + */ + public void headEnd() { + println(""); + } + + /** + * Print <CODE> tag. + */ + public void code() { + print(""); + } + + /** + * Print </CODE> tag. + */ + public void codeEnd() { + print(""); + } + + /** + * Print <EM> tag. Add a newline character at the end. + */ + public void em() { + println(""); + } + + /** + * Print </EM> tag. Add a newline character at the end. + */ + public void emEnd() { + println(""); + } + + /** + * Print HTML <TABLE BORDER="border" WIDTH="width" + * CELLPADDING="cellpadding" CELLSPACING="cellspacing"> tag. + * + * @param border Border size. + * @param width Width of the table. + * @param cellpadding Cellpadding for the table cells. + * @param cellspacing Cellspacing for the table cells. + */ + public void table(int border, String width, int cellpadding, + int cellspacing) { + println(DocletConstants.NL + + ""); + } + + /** + * Print HTML <TABLE BORDER="border" CELLPADDING="cellpadding" + * CELLSPACING="cellspacing"> tag. + * + * @param border Border size. + * @param cellpadding Cellpadding for the table cells. + * @param cellspacing Cellspacing for the table cells. + */ + public void table(int border, int cellpadding, int cellspacing) { + println(DocletConstants.NL + + "
    "); + } + + /** + * Print HTML <TABLE BORDER="border" WIDTH="width"> + * + * @param border Border size. + * @param width Width of the table. + */ + public void table(int border, String width) { + println(DocletConstants.NL + + "
    "); + } + + /** + * Print the HTML table tag with border size 0 and width 100%. + */ + public void table() { + table(0, "100%"); + } + + /** + * Print </TABLE> tag. Add a newline character at the end. + */ + public void tableEnd() { + println("
    "); + } + + /** + * Print <TR> tag. Add a newline character at the end. + */ + public void tr() { + println(""); + } + + /** + * Print </TR> tag. Add a newline character at the end. + */ + public void trEnd() { + println(""); + } + + /** + * Print <TD> tag. + */ + public void td() { + print(""); + } + + /** + * Print <TD NOWRAP> tag. + */ + public void tdNowrap() { + print(""); + } + + /** + * Print <TD WIDTH="width"> tag. + * + * @param width String width. + */ + public void tdWidth(String width) { + print(""); + } + + /** + * Print </TD> tag. Add a newline character at the end. + */ + public void tdEnd() { + println(""); + } + + /** + * Print <LINK str> tag. + * + * @param str String. + */ + public void link(String str) { + println(""); + } + + /** + * Print "<!-- " comment start string. + */ + public void commentStart() { + print(""); + } + + /** + * Print <TR BGCOLOR="color" CLASS="stylename"> tag. Adds a newline character + * at the end. + * + * @param color String color. + * @param stylename String stylename. + */ + public void trBgcolorStyle(String color, String stylename) { + println(""); + } + + /** + * Print <TR BGCOLOR="color"> tag. Adds a newline character at the end. + * + * @param color String color. + */ + public void trBgcolor(String color) { + println(""); + } + + /** + * Print <TR ALIGN="align" VALIGN="valign"> tag. Adds a newline character + * at the end. + * + * @param align String align. + * @param valign String valign. + */ + public void trAlignVAlign(String align, String valign) { + println(""); + } + + /** + * Print <TH ALIGN="align"> tag. + * + * @param align the align attribute. + */ + public void thAlign(String align) { + print(""); + } + + /** + * Print <TH align="align" COLSPAN=i> tag. + * + * @param align the align attribute. + * @param i integer. + */ + public void thAlignColspan(String align, int i) { + print(""); + } + + /** + * Print <TH align="align" NOWRAP> tag. + * + * @param align the align attribute. + */ + public void thAlignNowrap(String align) { + print(""); + } + + /** + * Print </TH> tag. Add a newline character at the end. + */ + public void thEnd() { + println(""); + } + + /** + * Print <TD COLSPAN=i> tag. + * + * @param i integer. + */ + public void tdColspan(int i) { + print(""); + } + + /** + * Print <TD BGCOLOR="color" CLASS="stylename"> tag. + * + * @param color String color. + * @param stylename String stylename. + */ + public void tdBgcolorStyle(String color, String stylename) { + print(""); + } + + /** + * Print <TD COLSPAN=i BGCOLOR="color" CLASS="stylename"> tag. + * + * @param i integer. + * @param color String color. + * @param stylename String stylename. + */ + public void tdColspanBgcolorStyle(int i, String color, String stylename) { + print(""); + } + + /** + * Print <TD ALIGN="align"> tag. Adds a newline character + * at the end. + * + * @param align String align. + */ + public void tdAlign(String align) { + print(""); + } + + /** + * Print <TD ALIGN="align" CLASS="stylename"> tag. + * + * @param align String align. + * @param stylename String stylename. + */ + public void tdVAlignClass(String align, String stylename) { + print(""); + } + + /** + * Print <TD VALIGN="valign"> tag. + * + * @param valign String valign. + */ + public void tdVAlign(String valign) { + print(""); + } + + /** + * Print <TD ALIGN="align" VALIGN="valign"> tag. + * + * @param align String align. + * @param valign String valign. + */ + public void tdAlignVAlign(String align, String valign) { + print(""); + } + + /** + * Print <TD ALIGN="align" ROWSPAN=rowspan> tag. + * + * @param align String align. + * @param rowspan integer rowspan. + */ + public void tdAlignRowspan(String align, int rowspan) { + print(""); + } + + /** + * Print <TD ALIGN="align" VALIGN="valign" ROWSPAN=rowspan> tag. + * + * @param align String align. + * @param valign String valign. + * @param rowspan integer rowspan. + */ + public void tdAlignVAlignRowspan(String align, String valign, + int rowspan) { + print(""); + } + + /** + * Print <BLOCKQUOTE> tag. Add a newline character at the end. + */ + public void blockquote() { + println("
    "); + } + + /** + * Print </BLOCKQUOTE> tag. Add a newline character at the end. + */ + public void blockquoteEnd() { + println("
    "); + } + + /** + * Get the "<CODE>" string. + * + * @return String Return String "<CODE>"; + */ + public String getCode() { + return ""; + } + + /** + * Get the "</CODE>" string. + * + * @return String Return String "</CODE>"; + */ + public String getCodeEnd() { + return ""; + } + + /** + * Print <NOFRAMES> tag. Add a newline character at the end. + */ + public void noFrames() { + println(""); + } + + /** + * Print &lt;/NOFRAMES&gt; tag. Add a newline character at the end. + */ + public void noFramesEnd() { + println(""); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/package.html b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/package.html new file mode 100644 index 00000000000..a7a6d51e0cc --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/markup/package.html @@ -0,0 +1,32 @@ + + + + +com.sun.tools.doclets.formats.html.markup package + + This package contains classes that write HTML markup tags. + + diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/package.html b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/package.html new file mode 100644 index 00000000000..6563878d4d1 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/package.html @@ -0,0 +1,39 @@ + + + + +com.sun.tools.doclets.formats.html package + + + This is the default doclet provided by doclet provided by + SunTM that produces Javadoc's + default HTML-formatted API output. For more documentation + on this doclet, please refer to the link below. + + @see + http://www.java.sun.com/javadoc/standard-doclet.html + + diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties new file mode 100644 index 00000000000..492a77e7fcc --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties @@ -0,0 +1,250 @@ +doclet.build_version=Standard Doclet version {0} +doclet.Contents=Contents +doclet.Overview=Overview +doclet.Window_Overview=Overview List +doclet.Window_Overview_Summary=Overview +doclet.Package=Package +doclet.All_Packages=All Packages +doclet.Tree=Tree +doclet.Class_Hierarchy=Class Hierarchy +doclet.Window_Class_Hierarchy=Class Hierarchy +doclet.Interface_Hierarchy=Interface Hierarchy +doclet.Enum_Hierarchy=Enum Hierarchy +doclet.Annotation_Type_Hierarchy=Annotation Type Hierarchy +doclet.Prev=PREV +doclet.Next=NEXT +doclet.Prev_Class=PREV CLASS +doclet.Next_Class=NEXT CLASS +doclet.Prev_Package=PREV PACKAGE +doclet.Next_Package=NEXT PACKAGE +doclet.Prev_Letter=PREV LETTER +doclet.Next_Letter=NEXT LETTER +doclet.Show_Lists=SHOW LISTS +doclet.Hide_Lists=HIDE LISTS +doclet.Href_Class_Title=class in {0} +doclet.Href_Interface_Title=interface in {0} +doclet.Href_Annotation_Title=annotation in {0} +doclet.Href_Enum_Title=enum in {0} +doclet.Href_Type_Param_Title=type parameter in {0} +doclet.Href_Class_Or_Interface_Title=class or interface in {0} +doclet.Summary=SUMMARY: +doclet.Detail=DETAIL: +doclet.navNested=NESTED +doclet.navAnnotationTypeOptionalMember=OPTIONAL +doclet.navAnnotationTypeRequiredMember=REQUIRED +doclet.navAnnotationTypeMember=ELEMENT +doclet.navField=FIELD +doclet.navEnum=ENUM CONSTANTS +doclet.navConstructor=CONSTR +doclet.navMethod=METHOD +doclet.navFactoryMethod=FACTORY +doclet.Index=Index +doclet.Window_Single_Index=Index +doclet.Window_Split_Index={0}-Index +doclet.Help=Help +doclet.Skip_navigation_links=Skip navigation links +doclet.None=None +doclet.CLASSES=CLASSES +doclet.MEMBERS=MEMBERS +doclet.NONE=NONE +doclet.Factory_Method_Detail=Static Factory Method Detail +doclet.navDeprecated=Deprecated +doclet.Deprecated_List=Deprecated List +doclet.Window_Deprecated_List=Deprecated List +doclet.Note_0_is_deprecated=Note: {0} is deprecated. +doclet.Overrides=Overrides: +doclet.in_class={0} in class {1} +doclet.0_Fields_and_Methods="{0}" Fields and Methods +doclet.Index_of_Fields_and_Methods=Index of Fields and Methods +doclet.Static_variable_in=Static variable in {0} +doclet.Variable_in=Variable in {0} +doclet.Constructor_for=Constructor for {0} +doclet.Static_method_in=Static method in {0} +doclet.Method_in=Method in {0} +doclet.throws=throws +doclet.package=package +doclet.MalformedURL=Malformed URL: {0} +doclet.File_error=Error reading file: {0} +doclet.URL_error=Error fetching URL: {0} +doclet.No_Package_Comment_File=For Package {0} Package.Comment file not found +doclet.No_Source_For_Class=Source information for class {0} not available. +doclet.see.class_or_package_not_found=Tag {0}: reference not found: {1} +doclet.see.malformed_tag=Tag {0}: Malformed: {1} +doclet.Inherited_API_Summary=Inherited API Summary +doclet.Deprecated_API=Deprecated API +doclet.Deprecated_Classes=Deprecated Classes +doclet.Deprecated_Enums=Deprecated Enums +doclet.Deprecated_Interfaces=Deprecated Interfaces +doclet.Deprecated_Exceptions=Deprecated Exceptions +doclet.Deprecated_Annotation_Types=Deprecated Annotation Types +doclet.Deprecated_Errors=Deprecated Errors +doclet.Deprecated_Fields=Deprecated Fields +doclet.Deprecated_Constructors=Deprecated Constructors +doclet.Deprecated_Methods=Deprecated Methods +doclet.Deprecated_Enum_Constants=Deprecated Enum Constants +doclet.Deprecated_Annotation_Type_Members=Deprecated Annotation Type Elements +doclet.Frame_Output=Frame Output +doclet.Docs_generated_by_Javadoc=Documentation generated by Javadoc. +doclet.Generated_Docs_Untitled=Generated Documentation (Untitled) +doclet.Blank=Blank +doclet.Other_Packages=Other Packages +doclet.Package_Description=Package {0} Description +doclet.Description=Description +doclet.Specified_By=Specified by: +doclet.in_interface={0} in interface {1} +doclet.Subclasses=Direct Known Subclasses: +doclet.Subinterfaces=All Known Subinterfaces: +doclet.Implementing_Classes=All Known Implementing Classes: +doclet.also=also +doclet.Option=Option +doclet.Or=Or +doclet.Frames=Frames +doclet.FRAMES=FRAMES +doclet.NO_FRAMES=NO FRAMES +doclet.Package_Hierarchies=Package Hierarchies: +doclet.Hierarchy_For_Package=Hierarchy For Package {0} +doclet.Source_Code=Source Code: +doclet.Hierarchy_For_All_Packages=Hierarchy For All Packages +doclet.Cannot_handle_no_packages=Cannot handle no packages. +doclet.Frame_Alert=Frame Alert +doclet.Overview-Member-Frame=Overview Member Frame +doclet.Frame_Warning_Message=This document is designed to be viewed using the frames feature. If you see this message, you are using a non-frame-capable web client. +doclet.Non_Frame_Version=Non-frame version. +doclet.Frame_Version=Frame version +doclet.Link_To=Link to +doclet.Following_From_Class=Following copied from class: {0} +doclet.Following_From_Interface=Following copied from interface: {0} +doclet.Description_From_Interface=Description copied from interface: {0} +doclet.Description_From_Class=Description copied from class: {0} +doclet.Standard_doclet_invoked=Standard doclet invoked... +doclet.No_Non_Deprecated_Classes_To_Document=No non-deprecated classes found to document. +doclet.Interfaces_Italic=Interfaces (italic) +doclet.Enclosing_Class=Enclosing class: +doclet.Enclosing_Interface=Enclosing interface: +doclet.Help_title=API Help +doclet.Window_Help_title=API Help +doclet.Help_line_1=How This API Document Is Organized +doclet.Help_line_2=This API (Application Programming Interface) document has pages corresponding to the items in the navigation bar, described as follows. +doclet.Help_line_3=The {0} page is the front page of this API document and provides a list of all packages with a summary for each. This page can also contain an overall description of the set of packages. +doclet.Help_line_4=Each package has a page that contains a list of its classes and interfaces, with a summary for each. This page can contain four categories: +doclet.Help_line_5=Class/Interface +doclet.Help_line_6=Each class, interface, nested class and nested interface has its own separate page. Each of these pages has three sections consisting of a class/interface description, summary tables, and detailed member descriptions: +doclet.Help_line_7=Class inheritance diagram +doclet.Help_line_8=Direct Subclasses +doclet.Help_line_9=All Known Subinterfaces +doclet.Help_line_10=All Known Implementing Classes +doclet.Help_line_11=Class/interface declaration +doclet.Help_line_12=Class/interface description +doclet.Help_line_13=Each summary entry contains the first sentence from the detailed description for that item. The summary entries are alphabetical, while the detailed descriptions are in the order they appear in the source code. This preserves the logical groupings established by the programmer. +doclet.Help_line_14=Use +doclet.Help_line_15=Each documented package, class and interface has its own Use page. This page describes what packages, classes, methods, constructors and fields use any part of the given class or package. Given a class or interface A, its Use page includes subclasses of A, fields declared as A, methods that return A, and methods and constructors with parameters of type A. You can access this page by first going to the package, class or interface, then clicking on the "Use" link in the navigation bar. +doclet.Help_line_16=Tree (Class Hierarchy) +doclet.Help_line_17_with_tree_link=There is a {0} page for all packages, plus a hierarchy for each package. Each hierarchy page contains a list of classes and a list of interfaces. The classes are organized by inheritance structure starting with java.lang.Object. The interfaces do not inherit from java.lang.Object. +doclet.Help_line_18=When viewing the Overview page, clicking on "Tree" displays the hierarchy for all packages. +doclet.Help_line_19=When viewing a particular package, class or interface page, clicking "Tree" displays the hierarchy for only that package. +doclet.Help_line_20_with_deprecated_api_link=The {0} page lists all of the API that have been deprecated. A deprecated API is not recommended for use, generally due to improvements, and a replacement API is usually given. Deprecated APIs may be removed in future implementations. +doclet.Help_line_21=Index +doclet.Help_line_22=The {0} contains an alphabetic list of all classes, interfaces, constructors, methods, and fields. +doclet.Help_line_23=Prev/Next +doclet.Help_line_24=These links take you to the next or previous class, interface, package, or related page. +doclet.Help_line_25=Frames/No Frames +doclet.Help_line_26=These links show and hide the HTML frames. All pages are available with or without frames. +doclet.Help_line_27=Each serializable or externalizable class has a description of its serialization fields and methods. This information is of interest to re-implementors, not to developers using the API. While there is no link in the navigation bar, you can get to this information by going to any serialized class and clicking "Serialized Form" in the "See also" section of the class description. +doclet.Help_line_28=The Constant Field Values page lists the static final fields and their values. +doclet.Help_line_29=This help file applies to API documentation generated using the standard doclet. +doclet.Help_enum_line_1=Each enum has its own separate page with the following sections: +doclet.Help_enum_line_2=Enum declaration +doclet.Help_enum_line_3=Enum description +doclet.Help_annotation_type_line_1=Each annotation type has its own separate page with the following sections: +doclet.Help_annotation_type_line_2=Annotation Type declaration +doclet.Help_annotation_type_line_3=Annotation Type description +doclet.The=The +doclet.Style_line_1=Javadoc style sheet +doclet.Style_line_2=Define colors, fonts and other style attributes here to override the defaults +doclet.Style_line_3=Page background color +doclet.Style_Headings=Headings +doclet.Style_line_4=Table colors +doclet.Style_line_5=Dark mauve +doclet.Style_line_6=Light mauve +doclet.Style_line_7=White +doclet.Style_line_8=Font used in left-hand frame lists +doclet.Style_line_9=Example of smaller, sans-serif font in frames +doclet.Style_line_10=Navigation bar fonts and colors +doclet.Style_line_11=Dark Blue +doclet.ClassUse_Packages.that.use.0=Packages that use {0} +doclet.ClassUse_Uses.of.0.in.1=Uses of {0} in {1} +doclet.ClassUse_Classes.in.0.used.by.1=Classes in {0} used by {1} +doclet.ClassUse_PackageAnnotation=Packages with annotations of type {0} +doclet.ClassUse_Annotation=Classes in {1} with annotations of type {0} +doclet.ClassUse_TypeParameter=Classes in {1} with type parameters of type {0} +doclet.ClassUse_MethodTypeParameter=Methods in {1} with type parameters of type {0} +doclet.ClassUse_FieldTypeParameter=Fields in {1} with type parameters of type {0} +doclet.ClassUse_FieldAnnotations=Fields in {1} with annotations of type {0} +doclet.ClassUse_MethodAnnotations=Methods in {1} with annotations of type {0} +doclet.ClassUse_MethodParameterAnnotations=Method parameters in {1} with annotations of type {0} +doclet.ClassUse_MethodReturnTypeParameter=Methods in {1} that return types with arguments of type {0} +doclet.ClassUse_Subclass=Subclasses of {0} in {1} +doclet.ClassUse_Subinterface=Subinterfaces of {0} in {1} +doclet.ClassUse_ImplementingClass=Classes in {1} that implement {0} +doclet.ClassUse_Field=Fields in {1} declared as {0} +doclet.ClassUse_MethodReturn=Methods in {1} that return {0} +doclet.ClassUse_MethodArgs=Methods in {1} with parameters of type {0} +doclet.ClassUse_MethodArgsTypeParameters=Method parameters in {1} with type arguments of type {0} +doclet.ClassUse_MethodThrows=Methods in {1} that throw {0} +doclet.ClassUse_ConstructorAnnotations=Constructors in {1} with annotations of type {0} +doclet.ClassUse_ConstructorParameterAnnotations=Constructor parameters in {1} with annotations of type {0} +doclet.ClassUse_ConstructorArgs=Constructors in {1} with parameters of type {0} +doclet.ClassUse_ConstructorArgsTypeParameters=Constructor parameters in {1} with type arguments of type {0} +doclet.ClassUse_ConstructorThrows=Constructors in {1} that throw {0} +doclet.ClassUse_No.usage.of.0=No usage of {0} +doclet.Window_ClassUse_Header=Uses of {0} {1} +doclet.ClassUse_Title=Uses of {0}
    {1} +doclet.navClassUse=Use +doclet.link_option_twice=Extern URL link option (link or linkoffline) used twice. +doclet.Error_in_packagelist=Error in using -group option: {0} {1} +doclet.Groupname_already_used=In -group option, groupname already used: {0} +doclet.Same_package_name_used=Package name format used twice: {0} +doclet.Serialization.Excluded_Class=Non-transient field {1} uses excluded class {0}. +doclet.Serialization.Nonexcluded_Class=Non-transient field {1} uses hidden, non-included class {0}. +doclet.usage=Provided by Standard doclet:\n\ + -d Destination directory for output files\n\ + -use Create class and package usage pages\n\ + -version Include @version paragraphs\n\ + -author Include @author paragraphs\n\ + -docfilessubdirs Recursively copy doc-file subdirectories\n\ + -splitindex Split index into one file per letter\n\ + -windowtitle Browser window title for the documenation\n\ + -doctitle Include title for the overview page\n\ + -header Include header text for each page\n\ + -footer Include footer text for each page\n\ + -top Include top text for each page\n\ + -bottom Include bottom text for each page\n\ + -link Create links to javadoc output at \n\ + -linkoffline Link to docs at using package list at \n\ + -excludedocfilessubdir :.. Exclude any doc-files subdirectories with given name.\n\ + -group :.. Group specified packages together in overview page\n\ + -nocomment Supress description and tags, generate only declarations.\n\ + -nodeprecated Do not include @deprecated information\n\ + -noqualifier ::... Exclude the list of qualifiers from the output.\n\ + -nosince Do not include @since information\n\ + -notimestamp Do not include hidden time stamp\n\ + -nodeprecatedlist Do not generate deprecated list\n\ + -notree Do not generate class hierarchy\n\ + -noindex Do not generate index\n\ + -nohelp Do not generate help link\n\ + -nonavbar Do not generate navigation bar\n\ + -serialwarn Generate warning about @serial tag\n\ + -tag ::
    Specify single argument custom tags\n\ + -taglet The fully qualified name of Taglet to register\n\ + -tagletpath The path to Taglets\n\ + -charset Charset for cross-platform viewing of generated documentation.\n\ + -helpfile Include file that help link links to\n\ + -linksource Generate source in HTML\n\ + -sourcetab Specify the number of spaces each tab takes up in the source\n\ + -keywords Include HTML meta tags with package, class and member info\n\ + -stylesheetfile File to change style of the generated documentation\n\ + -docencoding Output encoding name + + + + diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_ja.properties b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_ja.properties new file mode 100644 index 00000000000..9489cc201fb --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_ja.properties @@ -0,0 +1,250 @@ +doclet.build_version=\u6a19\u6e96 Doclet \u30d0\u30fc\u30b8\u30e7\u30f3 {0} +doclet.Contents=\u30b3\u30f3\u30c6\u30f3\u30c4 +doclet.Overview=\u6982\u8981 +doclet.Window_Overview=\u6982\u8981\u30ea\u30b9\u30c8 +doclet.Window_Overview_Summary=\u6982\u8981 +doclet.Package=\u30d1\u30c3\u30b1\u30fc\u30b8 +doclet.All_Packages=\u3059\u3079\u3066\u306e\u30d1\u30c3\u30b1\u30fc\u30b8 +doclet.Tree=\u968e\u5c64\u30c4\u30ea\u30fc +doclet.Class_Hierarchy=\u30af\u30e9\u30b9\u968e\u5c64 +doclet.Window_Class_Hierarchy=\u30af\u30e9\u30b9\u968e\u5c64 +doclet.Interface_Hierarchy=\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u968e\u5c64 +doclet.Enum_Hierarchy=\u5217\u6319\u578b\u968e\u5c64 +doclet.Annotation_Type_Hierarchy=\u6ce8\u91c8\u578b\u968e\u5c64 +doclet.Prev=\u524d +doclet.Next=\u6b21 +doclet.Prev_Class=\u524d\u306e\u30af\u30e9\u30b9 +doclet.Next_Class=\u6b21\u306e\u30af\u30e9\u30b9 +doclet.Prev_Package=\u524d\u306e\u30d1\u30c3\u30b1\u30fc\u30b8 +doclet.Next_Package=\u6b21\u306e\u30d1\u30c3\u30b1\u30fc\u30b8 +doclet.Prev_Letter=\u524d\u306e\u6587\u5b57 +doclet.Next_Letter=\u6b21\u306e\u6587\u5b57 +doclet.Show_Lists=\u30ea\u30b9\u30c8\u306e\u8868\u793a +doclet.Hide_Lists=\u30ea\u30b9\u30c8\u306e\u975e\u8868\u793a +doclet.Href_Class_Title={0} \u5185\u306e\u30af\u30e9\u30b9 +doclet.Href_Interface_Title={0} \u5185\u306e\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9 +doclet.Href_Annotation_Title={0} \u5185\u306e\u6ce8\u91c8 +doclet.Href_Enum_Title={0} \u5185\u306e\u5217\u6319\u578b +doclet.Href_Type_Param_Title={0} \u5185\u306e\u578b\u30d1\u30e9\u30e1\u30fc\u30bf +doclet.Href_Class_Or_Interface_Title={0} \u5185\u306e\u30af\u30e9\u30b9\u307e\u305f\u306f\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9 +doclet.Summary=\u6982\u8981: +doclet.Detail=\u8a73\u7d30: +doclet.navNested=\u5165\u308c\u5b50 +doclet.navAnnotationTypeOptionalMember=\u30aa\u30d7\u30b7\u30e7\u30f3 +doclet.navAnnotationTypeRequiredMember=\u5fc5\u9808 +doclet.navAnnotationTypeMember=\u8981\u7d20 +doclet.navField=\u30d5\u30a3\u30fc\u30eb\u30c9 +doclet.navEnum=\u5217\u6319\u578b\u5b9a\u6570 +doclet.navConstructor=\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf +doclet.navMethod=\u30e1\u30bd\u30c3\u30c9 +doclet.navFactoryMethod=\u30d5\u30a1\u30af\u30c8\u30ea +doclet.Index=\u7d22\u5f15 +doclet.Window_Single_Index=\u7d22\u5f15 +doclet.Window_Split_Index={0} \u306e\u7d22\u5f15 +doclet.Help=\u30d8\u30eb\u30d7 +doclet.Skip_navigation_links=\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u30ea\u30f3\u30af\u3092\u30b9\u30ad\u30c3\u30d7 +doclet.None=\u306a\u3057 +doclet.CLASSES=\u30af\u30e9\u30b9 +doclet.MEMBERS=\u30e1\u30f3\u30d0 +doclet.NONE=\u306a\u3057 +doclet.Factory_Method_Detail=static \u30d5\u30a1\u30af\u30c8\u30ea\u30e1\u30bd\u30c3\u30c9\u306e\u8a73\u7d30 +doclet.navDeprecated=\u975e\u63a8\u5968 API +doclet.Deprecated_List=\u975e\u63a8\u5968 API \u306e\u30ea\u30b9\u30c8 +doclet.Window_Deprecated_List=\u975e\u63a8\u5968 API \u306e\u30ea\u30b9\u30c8 +doclet.Note_0_is_deprecated=\u6ce8: {0} \u306f\u63a8\u5968\u3055\u308c\u3066\u3044\u307e\u305b\u3093\u3002 +doclet.Overrides=\u30aa\u30fc\u30d0\u30fc\u30e9\u30a4\u30c9: +doclet.in_class=\u30af\u30e9\u30b9 {1} \u5185\u306e {0} +doclet.0_Fields_and_Methods="{0}" \u30d5\u30a3\u30fc\u30eb\u30c9\u3068\u30e1\u30bd\u30c3\u30c9 +doclet.Index_of_Fields_and_Methods=\u30d5\u30a3\u30fc\u30eb\u30c9\u3068\u30e1\u30bd\u30c3\u30c9\u306e\u7d22\u5f15 +doclet.Static_variable_in={0} \u306e static \u5909\u6570 +doclet.Variable_in={0} \u306e\u5909\u6570 +doclet.Constructor_for={0} \u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf +doclet.Static_method_in={0} \u306e static \u30e1\u30bd\u30c3\u30c9 +doclet.Method_in={0} \u306e\u30e1\u30bd\u30c3\u30c9 +doclet.throws=\u30b9\u30ed\u30fc +doclet.package=\u30d1\u30c3\u30b1\u30fc\u30b8 +doclet.MalformedURL=\u4e0d\u6b63\u306a URL: {0} +doclet.File_error=\u30d5\u30a1\u30a4\u30eb\u8aad\u307f\u8fbc\u307f\u30a8\u30e9\u30fc: {0} +doclet.URL_error=URL \u53d6\u308a\u51fa\u3057\u30a8\u30e9\u30fc: {0} +doclet.No_Package_Comment_File=\u30d1\u30c3\u30b1\u30fc\u30b8 {0} \u306e Package.Comment \u30d5\u30a1\u30a4\u30eb\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002 +doclet.No_Source_For_Class=\u30af\u30e9\u30b9 {0} \u306e\u30bd\u30fc\u30b9\u60c5\u5831\u304c\u4f7f\u7528\u3067\u304d\u307e\u305b\u3093\u3002 +doclet.see.class_or_package_not_found=\u30bf\u30b0 {0}: \u53c2\u7167\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093: {1} +doclet.see.malformed_tag={0} \u30bf\u30b0: \u4e0d\u6b63\u306a {1} \u30bf\u30b0 +doclet.Inherited_API_Summary=\u7d99\u627f\u3055\u308c\u305f API \u306e\u6982\u8981 +doclet.Deprecated_API=\u63a8\u5968\u3055\u308c\u3066\u3044\u306a\u3044 API +doclet.Deprecated_Classes=\u63a8\u5968\u3055\u308c\u3066\u3044\u306a\u3044\u30af\u30e9\u30b9 +doclet.Deprecated_Enums=\u63a8\u5968\u3055\u308c\u3066\u3044\u306a\u3044\u5217\u6319\u578b +doclet.Deprecated_Interfaces=\u63a8\u5968\u3055\u308c\u3066\u3044\u306a\u3044\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9 +doclet.Deprecated_Exceptions=\u63a8\u5968\u3055\u308c\u3066\u3044\u306a\u3044\u4f8b\u5916 +doclet.Deprecated_Annotation_Types=\u63a8\u5968\u3055\u308c\u3066\u3044\u306a\u3044\u6ce8\u91c8\u578b +doclet.Deprecated_Errors=\u63a8\u5968\u3055\u308c\u3066\u3044\u306a\u3044\u30a8\u30e9\u30fc +doclet.Deprecated_Fields=\u63a8\u5968\u3055\u308c\u3066\u3044\u306a\u3044\u30d5\u30a3\u30fc\u30eb\u30c9 +doclet.Deprecated_Constructors=\u63a8\u5968\u3055\u308c\u3066\u3044\u306a\u3044\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf +doclet.Deprecated_Methods=\u63a8\u5968\u3055\u308c\u3066\u3044\u306a\u3044\u30e1\u30bd\u30c3\u30c9 +doclet.Deprecated_Enum_Constants=\u63a8\u5968\u3055\u308c\u3066\u3044\u306a\u3044\u5217\u6319\u578b\u5b9a\u6570 +doclet.Deprecated_Annotation_Type_Members=\u63a8\u5968\u3055\u308c\u3066\u3044\u306a\u3044\u6ce8\u91c8\u578b\u306e\u8981\u7d20 +doclet.Frame_Output=\u30d5\u30ec\u30fc\u30e0\u51fa\u529b +doclet.Docs_generated_by_Javadoc=\u3053\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306f javadoc \u3067\u751f\u6210\u3055\u308c\u3066\u3044\u307e\u3059\u3002 +doclet.Generated_Docs_Untitled=\u751f\u6210\u3055\u308c\u305f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8 (\u30bf\u30a4\u30c8\u30eb\u306a\u3057) +doclet.Blank=\u30d6\u30e9\u30f3\u30af +doclet.Other_Packages=\u305d\u306e\u4ed6\u306e\u30d1\u30c3\u30b1\u30fc\u30b8 +doclet.Package_Description=\u30d1\u30c3\u30b1\u30fc\u30b8 {0} \u306e\u8aac\u660e +doclet.Description=\u8aac\u660e +doclet.Specified_By=\u5b9a\u7fa9: +doclet.in_interface=\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9 {1} \u5185\u306e {0} +doclet.Subclasses=\u76f4\u7cfb\u306e\u65e2\u77e5\u306e\u30b5\u30d6\u30af\u30e9\u30b9: +doclet.Subinterfaces=\u65e2\u77e5\u306e\u30b5\u30d6\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u306e\u4e00\u89a7: +doclet.Implementing_Classes=\u65e2\u77e5\u306e\u5b9f\u88c5\u30af\u30e9\u30b9\u306e\u4e00\u89a7: +doclet.also=\u540c\u69d8\u306b +doclet.Option=\u30aa\u30d7\u30b7\u30e7\u30f3 +doclet.Or=\u307e\u305f\u306f +doclet.Frames=\u30d5\u30ec\u30fc\u30e0\u3042\u308a +doclet.FRAMES=\u30d5\u30ec\u30fc\u30e0\u3042\u308a +doclet.NO_FRAMES=\u30d5\u30ec\u30fc\u30e0\u306a\u3057 +doclet.Package_Hierarchies=\u30d1\u30c3\u30b1\u30fc\u30b8\u968e\u5c64: +doclet.Hierarchy_For_Package=\u30d1\u30c3\u30b1\u30fc\u30b8 {0} \u306e\u968e\u5c64 +doclet.Source_Code=\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9: +doclet.Hierarchy_For_All_Packages=\u3059\u3079\u3066\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u968e\u5c64 +doclet.Cannot_handle_no_packages=\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u51e6\u7406\u3067\u304d\u307e\u305b\u3093\u3002 +doclet.Frame_Alert=\u30d5\u30ec\u30fc\u30e0\u95a2\u9023\u306e\u8b66\u544a +doclet.Overview-Member-Frame=\u6982\u8981\u30e1\u30f3\u30d0\u30d5\u30ec\u30fc\u30e0 +doclet.Frame_Warning_Message=\u3053\u306e\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306f\u30d5\u30ec\u30fc\u30e0\u6a5f\u80fd\u3092\u4f7f\u3063\u3066\u8868\u793a\u3059\u308b\u3088\u3046\u306b\u4f5c\u3089\u308c\u3066\u3044\u307e\u3059\u3002\u30d5\u30ec\u30fc\u30e0\u3092\u8868\u793a\u3067\u304d\u306a\u3044 Web \u30af\u30e9\u30a4\u30a2\u30f3\u30c8\u306e\u5834\u5408\u306b\u3053\u306e\u30e1\u30c3\u30bb\u30fc\u30b8\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002 +doclet.Non_Frame_Version=\u30d5\u30ec\u30fc\u30e0\u306a\u3057\u306e\u30d0\u30fc\u30b8\u30e7\u30f3 +doclet.Frame_Version=\u30d5\u30ec\u30fc\u30e0\u3042\u308a\u306e\u30d0\u30fc\u30b8\u30e7\u30f3 +doclet.Link_To=\u30ea\u30f3\u30af\u5148 +doclet.Following_From_Class=\u30af\u30e9\u30b9 {0} \u304b\u3089\u30b3\u30d4\u30fc\u3055\u308c\u305f\u30bf\u30b0: +doclet.Following_From_Interface=\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9 {0} \u304b\u3089\u30b3\u30d4\u30fc\u3055\u308c\u305f\u30bf\u30b0: +doclet.Description_From_Interface=\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9 {0} \u306e\u8a18\u8ff0: +doclet.Description_From_Class=\u30af\u30e9\u30b9 {0} \u306e\u8a18\u8ff0: +doclet.Standard_doclet_invoked=\u6a19\u6e96\u306e doclet \u304c\u8d77\u52d5\u3055\u308c\u307e\u3057\u305f... +doclet.No_Non_Deprecated_Classes_To_Document=\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u5316\u3059\u308b\u975e\u63a8\u5968\u4ee5\u5916\u306e\u30af\u30e9\u30b9\u304c\u898b\u3064\u304b\u308a\u307e\u305b\u3093\u3002 +doclet.Interfaces_Italic=\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9 (\u30a4\u30bf\u30ea\u30c3\u30af) +doclet.Enclosing_Class=\u542b\u307e\u308c\u3066\u3044\u308b\u30af\u30e9\u30b9: +doclet.Enclosing_Interface=\u542b\u307e\u308c\u3066\u3044\u308b\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9: +doclet.Help_title=API \u30d8\u30eb\u30d7 +doclet.Window_Help_title=API \u30d8\u30eb\u30d7 +doclet.Help_line_1=API \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u69cb\u6210 +doclet.Help_line_2=\u3053\u306e API (Application Programming Interface) \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u306f\u3001\u6b21\u306b\u8aac\u660e\u3059\u308b\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u30d0\u30fc\u306b\u3042\u308b\u9805\u76ee\u306b\u5bfe\u5fdc\u3059\u308b\u30da\u30fc\u30b8\u304c\u542b\u307e\u308c\u307e\u3059\u3002 +doclet.Help_line_3={0} \u30da\u30fc\u30b8\u306f API \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u30d5\u30ed\u30f3\u30c8\u30da\u30fc\u30b8\u3067\u3001\u5404\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u6982\u8981\u3092\u542b\u3080\u5168\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u4e00\u89a7\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u4e00\u9023\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u6982\u8981\u8aac\u660e\u3082\u8868\u793a\u3055\u308c\u307e\u3059\u3002 +doclet.Help_line_4=\u5404\u30d1\u30c3\u30b1\u30fc\u30b8\u306f\u3001\u305d\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u30af\u30e9\u30b9\u3068\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3078\u306e\u30ea\u30f3\u30af\u3092\u542b\u3080\u30da\u30fc\u30b8\u3092\u6301\u3061\u307e\u3059\u3002\u3053\u306e\u30da\u30fc\u30b8\u306f 4 \u3064\u306e\u30ab\u30c6\u30b4\u30ea\u3067\u69cb\u6210\u3055\u308c\u307e\u3059: +doclet.Help_line_5=\u30af\u30e9\u30b9\u307e\u305f\u306f\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9 +doclet.Help_line_6=\u5404\u30af\u30e9\u30b9\u3001\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3001\u5165\u308c\u5b50\u30af\u30e9\u30b9\u3001\u304a\u3088\u3073\u5165\u308c\u5b50\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u306f\u500b\u5225\u306e\u30da\u30fc\u30b8\u3092\u6301\u3061\u307e\u3059\u3002\u5404\u30da\u30fc\u30b8\u306b\u306f\u6b21\u306e\u3088\u3046\u306b\u3001\u30af\u30e9\u30b9\u307e\u305f\u306f\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u306e\u8aac\u660e\u3068\u3001\u6982\u8981\u30c6\u30fc\u30d6\u30eb\u3001\u304a\u3088\u3073\u30e1\u30f3\u30d0\u306e\u8a73\u7d30\u8aac\u660e\u304c\u542b\u307e\u308c\u307e\u3059: +doclet.Help_line_7=\u30af\u30e9\u30b9\u968e\u5c64\u8868\u793a +doclet.Help_line_8=\u76f4\u7cfb\u306e\u30b5\u30d6\u30af\u30e9\u30b9 +doclet.Help_line_9=\u65e2\u77e5\u306e\u30b5\u30d6\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u306e\u4e00\u89a7 +doclet.Help_line_10=\u65e2\u77e5\u306e\u5b9f\u88c5\u30af\u30e9\u30b9\u306e\u4e00\u89a7 +doclet.Help_line_11=\u30af\u30e9\u30b9\u307e\u305f\u306f\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u306e\u5ba3\u8a00 +doclet.Help_line_12=\u30af\u30e9\u30b9\u307e\u305f\u306f\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u306e\u8a18\u8ff0 +doclet.Help_line_13=\u5404\u6982\u8981\u30a8\u30f3\u30c8\u30ea\u306b\u306f\u3001\u305d\u306e\u9805\u76ee\u306e\u8a73\u7d30\u306a\u8a18\u8ff0\u306e\u4e2d\u304b\u3089 1 \u884c\u76ee\u306e\u6587\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002\u8a73\u7d30\u306a\u8a18\u8ff0\u306f\u30bd\u30fc\u30b9\u30b3\u30fc\u30c9\u306b\u73fe\u308f\u308c\u308b\u9806\u306b\u4e26\u3079\u3089\u308c\u307e\u3059\u304c\u3001\u6982\u8981\u30a8\u30f3\u30c8\u30ea\u306f\u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c8\u9806\u306b\u4e26\u3079\u3089\u308c\u307e\u3059\u3002\u3053\u308c\u306b\u3088\u3063\u3066\u3001\u30d7\u30ed\u30b0\u30e9\u30de\u304c\u8a2d\u5b9a\u3057\u305f\u8ad6\u7406\u7684\u306a\u30b0\u30eb\u30fc\u30d7\u5206\u3051\u304c\u4fdd\u6301\u3055\u308c\u307e\u3059\u3002 +doclet.Help_line_14=\u4f7f\u7528 +doclet.Help_line_15=\u5404\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u5316\u3055\u308c\u305f\u30d1\u30c3\u30b1\u30fc\u30b8\u3001\u30af\u30e9\u30b9\u3001\u304a\u3088\u3073\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u306f\u305d\u308c\u305e\u308c [\u4f7f\u7528] \u30da\u30fc\u30b8\u3092\u6301\u3063\u3066\u3044\u307e\u3059\u3002\u3053\u306e\u30da\u30fc\u30b8\u306b\u306f\u3001\u3069\u306e\u3088\u3046\u306a\u30d1\u30c3\u30b1\u30fc\u30b8\u3001\u30af\u30e9\u30b9\u3001\u30e1\u30bd\u30c3\u30c9\u3001\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3001\u304a\u3088\u3073\u30d5\u30a3\u30fc\u30eb\u30c9\u304c\u3001\u7279\u5b9a\u306e\u30af\u30e9\u30b9\u307e\u305f\u306f\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u4e00\u90e8\u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u304b\u304c\u8a18\u8ff0\u3055\u308c\u3066\u3044\u307e\u3059\u3002\u305f\u3068\u3048\u3070\u3001\u30af\u30e9\u30b9 A \u307e\u305f\u306f\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9 A \u306e\u5834\u5408\u3001\u305d\u306e [\u4f7f\u7528] \u30da\u30fc\u30b8\u306b\u306f\u3001A \u306e\u30b5\u30d6\u30af\u30e9\u30b9\u3001A \u3068\u3057\u3066\u5ba3\u8a00\u3055\u308c\u308b\u30d5\u30a3\u30fc\u30eb\u30c9\u3001A \u3092\u8fd4\u3059\u30e1\u30bd\u30c3\u30c9\u3001\u304a\u3088\u3073\u3001\u578b A \u3092\u6301\u3064\u30e1\u30bd\u30c3\u30c9\u3068\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u304c\u542b\u307e\u308c\u307e\u3059\u3002\u3053\u306e\u30da\u30fc\u30b8\u306b\u30a2\u30af\u30bb\u30b9\u3059\u308b\u306b\u306f\u3001\u307e\u305a\u305d\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3001\u30af\u30e9\u30b9\u3001\u307e\u305f\u306f\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u306b\u79fb\u52d5\u3057\u3001\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u30d0\u30fc\u306e [\u4f7f\u7528] \u30ea\u30f3\u30af\u3092\u30af\u30ea\u30c3\u30af\u3057\u3066\u304f\u3060\u3055\u3044\u3002 +doclet.Help_line_16=\u968e\u5c64\u30c4\u30ea\u30fc (\u30af\u30e9\u30b9\u968e\u5c64) +doclet.Help_line_17_with_tree_link=\u3059\u3079\u3066\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u306b\u306f {0} \u30da\u30fc\u30b8\u304c\u3042\u308a\u3001\u3055\u3089\u306b\u5404\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u968e\u5c64\u304c\u3042\u308a\u307e\u3059\u3002\u5404\u968e\u5c64\u30da\u30fc\u30b8\u306f\u3001\u30af\u30e9\u30b9\u306e\u30ea\u30b9\u30c8\u3068\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u306e\u30ea\u30b9\u30c8\u3092\u542b\u307f\u307e\u3059\u3002\u30af\u30e9\u30b9\u306f java.lang.Object \u3092\u958b\u59cb\u70b9\u3068\u3059\u308b\u7d99\u627f\u69cb\u9020\u3067\u7de8\u6210\u3055\u308c\u307e\u3059\u3002\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u306f\u3001java.lang.Object \u304b\u3089\u306f\u7d99\u627f\u3057\u307e\u305b\u3093\u3002 +doclet.Help_line_18=\u6982\u8981\u30da\u30fc\u30b8\u3092\u8868\u793a\u3057\u3066\u3044\u308b\u3068\u304d\u306b [\u30c4\u30ea\u30fc] \u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u5168\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u968e\u5c64\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002 +doclet.Help_line_19=\u7279\u5b9a\u306e\u30d1\u30c3\u30b1\u30fc\u30b8\u3001\u30af\u30e9\u30b9\u3001\u307e\u305f\u306f\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3092\u8868\u793a\u3057\u3066\u3044\u308b\u3068\u304d\u306b [\u30c4\u30ea\u30fc] \u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3068\u3001\u8a72\u5f53\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3060\u3051\u306e\u968e\u5c64\u304c\u8868\u793a\u3055\u308c\u307e\u3059\u3002 +doclet.Help_line_20_with_deprecated_api_link={0} \u30da\u30fc\u30b8\u306f\u3001\u63a8\u5968\u3055\u308c\u3066\u3044\u306a\u3044\u3059\u3079\u3066\u306e API \u306e\u30ea\u30b9\u30c8\u3092\u8868\u793a\u3057\u307e\u3059\u3002\u975e\u63a8\u5968 API \u3068\u306f\u3001\u6a5f\u80fd\u6539\u826f\u306a\u3069\u306e\u7406\u7531\u304b\u3089\u4f7f\u7528\u3092\u304a\u52e7\u3081\u3067\u304d\u306a\u304f\u306a\u3063\u305f API \u306e\u3053\u3068\u3067\u3001\u901a\u5e38\u306f\u305d\u308c\u306b\u4ee3\u308f\u308b API \u304c\u63d0\u4f9b\u3055\u308c\u307e\u3059\u3002\u975e\u63a8\u5968 API \u306f\u4eca\u5f8c\u306e\u5b9f\u88c5\u3067\u524a\u9664\u3055\u308c\u308b\u53ef\u80fd\u6027\u304c\u3042\u308a\u307e\u3059\u3002 +doclet.Help_line_21=\u7d22\u5f15 +doclet.Help_line_22={0} \u306b\u306f\u3001\u3059\u3079\u3066\u306e\u30af\u30e9\u30b9\u3001\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3001\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u3001\u30e1\u30bd\u30c3\u30c9\u3001\u304a\u3088\u3073\u30d5\u30a3\u30fc\u30eb\u30c9\u306e\u30a2\u30eb\u30d5\u30a1\u30d9\u30c3\u30c8\u9806\u306e\u30ea\u30b9\u30c8\u304c\u542b\u307e\u308c\u307e\u3059\u3002 +doclet.Help_line_23=\u524d/\u6b21 +doclet.Help_line_24=\u3053\u308c\u3089\u306e\u30ea\u30f3\u30af\u306b\u3088\u308a\u3001\u524d\u307e\u305f\u306f\u6b21\u306e\u30af\u30e9\u30b9\u3001\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u3001\u307e\u305f\u306f\u95a2\u9023\u30da\u30fc\u30b8\u3078\u79fb\u52d5\u3067\u304d\u307e\u3059\u3002 +doclet.Help_line_25=\u30d5\u30ec\u30fc\u30e0\u3042\u308a/\u30d5\u30ec\u30fc\u30e0\u306a\u3057 +doclet.Help_line_26=\u3053\u308c\u3089\u306e\u30ea\u30f3\u30af\u306f HTML \u30d5\u30ec\u30fc\u30e0\u3092\u8868\u793a\u3057\u305f\u308a\u96a0\u3057\u305f\u308a\u3057\u307e\u3059\u3002\u3059\u3079\u3066\u306e\u30da\u30fc\u30b8\u306f\u30d5\u30ec\u30fc\u30e0\u3042\u308a\u3067\u3082\u3001\u30d5\u30ec\u30fc\u30e0\u306a\u3057\u3067\u3082\u8868\u793a\u3067\u304d\u307e\u3059\u3002 +doclet.Help_line_27=\u76f4\u5217\u5316\u53ef\u80fd\u3001\u307e\u305f\u306f\u5916\u90e8\u5316\u53ef\u80fd\u306a\u5404\u30af\u30e9\u30b9\u306f\u3001\u76f4\u5217\u5316\u30d5\u30a3\u30fc\u30eb\u30c9\u3068\u30e1\u30bd\u30c3\u30c9\u306e\u8a18\u8ff0\u3092\u542b\u307f\u307e\u3059\u3002\u3053\u306e\u60c5\u5831\u306f\u3001API \u3092\u4f7f\u7528\u3059\u308b\u958b\u767a\u8005\u3067\u306f\u306a\u304f\u3001\u518d\u5b9f\u88c5\u3092\u884c\u3046\u62c5\u5f53\u8005\u306b\u5f79\u7acb\u3061\u307e\u3059\u3002\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u30d0\u30fc\u306b\u30ea\u30f3\u30af\u304c\u306a\u3044\u5834\u5408\u3001\u76f4\u5217\u5316\u3055\u308c\u305f\u30af\u30e9\u30b9\u306b\u79fb\u52d5\u3057\u3066\u3001\u30af\u30e9\u30b9\u8a18\u8ff0\u306e [\u95a2\u9023\u9805\u76ee] \u30bb\u30af\u30b7\u30e7\u30f3\u306b\u3042\u308b [\u76f4\u5217\u5316\u3055\u308c\u305f\u5f62\u5f0f] \u3092\u30af\u30ea\u30c3\u30af\u3059\u308b\u3053\u3068\u306b\u3088\u308a\u3001\u3053\u306e\u60c5\u5831\u3092\u8868\u793a\u3067\u304d\u307e\u3059\u3002 +doclet.Help_line_28=\u300c\u5b9a\u6570\u30d5\u30a3\u30fc\u30eb\u30c9\u5024\u300d \u30da\u30fc\u30b8\u306b\u306f\u3001static final \u30d5\u30a3\u30fc\u30eb\u30c9\u3068\u305d\u306e\u5024\u306e\u30ea\u30b9\u30c8\u304c\u3042\u308a\u307e\u3059\u3002 +doclet.Help_line_29=\u3053\u306e\u30d8\u30eb\u30d7\u30d5\u30a1\u30a4\u30eb\u306f\u3001\u6a19\u6e96 doclet \u3092\u4f7f\u7528\u3057\u3066\u751f\u6210\u3055\u308c\u305f API \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306b\u9069\u7528\u3055\u308c\u307e\u3059\u3002 +doclet.Help_enum_line_1=\u5404\u5217\u6319\u578b\u306b\u306f\u3001\u305d\u308c\u81ea\u8eab\u306e\u500b\u5225\u306e\u30da\u30fc\u30b8\u3068\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u304c\u3042\u308a\u307e\u3059: +doclet.Help_enum_line_2=\u5217\u6319\u578b\u306e\u5ba3\u8a00 +doclet.Help_enum_line_3=\u5217\u6319\u578b\u306e\u8aac\u660e +doclet.Help_annotation_type_line_1=\u5404\u6ce8\u91c8\u578b\u306b\u306f\u3001\u305d\u308c\u81ea\u8eab\u306e\u500b\u5225\u306e\u30da\u30fc\u30b8\u3068\u6b21\u306e\u30bb\u30af\u30b7\u30e7\u30f3\u304c\u3042\u308a\u307e\u3059: +doclet.Help_annotation_type_line_2=\u6ce8\u91c8\u578b\u306e\u5ba3\u8a00 +doclet.Help_annotation_type_line_3=\u6ce8\u91c8\u578b\u306e\u8aac\u660e +doclet.The= +doclet.Style_line_1=javadoc \u30b9\u30bf\u30a4\u30eb\u30b7\u30fc\u30c8 +doclet.Style_line_2=\u8272\u3084\u30d5\u30a9\u30f3\u30c8\u306a\u3069\u306e\u30b9\u30bf\u30a4\u30eb\u5c5e\u6027\u306e\u30c7\u30d5\u30a9\u30eb\u30c8\u5024\u3092\u4e0a\u66f8\u304d\u3059\u308b\u306b\u306f\u3001\u3053\u3053\u3067\u5b9a\u7fa9\u3057\u307e\u3059\u3002 +doclet.Style_line_3=\u30da\u30fc\u30b8\u306e\u30d0\u30c3\u30af\u30b0\u30e9\u30a6\u30f3\u30c9\u306e\u8272 +doclet.Style_Headings=\u898b\u51fa\u3057 +doclet.Style_line_4=\u30c6\u30fc\u30d6\u30eb\u306e\u8272 +doclet.Style_line_5=\u6fc3\u3044\u85e4\u8272 +doclet.Style_line_6=\u8584\u3044\u85e4\u8272 +doclet.Style_line_7=\u767d +doclet.Style_line_8=\u5de6\u5074\u306e\u30d5\u30ec\u30fc\u30e0\u306e\u30ea\u30b9\u30c8\u306b\u4f7f\u7528\u3059\u308b\u30d5\u30a9\u30f3\u30c8 +doclet.Style_line_9=\u30d5\u30ec\u30fc\u30e0\u306b\u304a\u3051\u308b\u3001\u3088\u308a\u5c0f\u3055\u3044\u3001\u30bb\u30ea\u30d5\u306a\u3057\u30d5\u30a9\u30f3\u30c8\u306e\u4f8b +doclet.Style_line_10=\u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u30d0\u30fc\u306e\u30d5\u30a9\u30f3\u30c8\u3068\u8272 +doclet.Style_line_11=\u6fc3\u3044\u9752 +doclet.ClassUse_Packages.that.use.0={0} \u3092\u4f7f\u7528\u3057\u3066\u3044\u308b\u30d1\u30c3\u30b1\u30fc\u30b8 +doclet.ClassUse_Uses.of.0.in.1={1} \u3067\u306e {0} \u306e\u4f7f\u7528 +doclet.ClassUse_Classes.in.0.used.by.1={1} \u306b\u3088\u308a\u4f7f\u7528\u3055\u308c\u308b {0} \u306e\u30af\u30e9\u30b9 +doclet.ClassUse_PackageAnnotation={0} \u578b\u306e\u6ce8\u91c8\u3092\u6301\u3064\u30d1\u30c3\u30b1\u30fc\u30b8 +doclet.ClassUse_Annotation={0} \u578b\u306e\u6ce8\u91c8\u3092\u6301\u3064 {1} \u306e\u30e1\u30bd\u30c3\u30c9 +doclet.ClassUse_TypeParameter={0} \u578b\u306e\u578b\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u6301\u3064 {1} \u306e\u30af\u30e9\u30b9 +doclet.ClassUse_MethodTypeParameter={0} \u578b\u306e\u578b\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u6301\u3064 {1} \u306e\u30e1\u30bd\u30c3\u30c9 +doclet.ClassUse_FieldTypeParameter={0} \u578b\u306e\u578b\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u6301\u3064 {1} \u306e\u30d5\u30a3\u30fc\u30eb\u30c9 +doclet.ClassUse_FieldAnnotations={0} \u578b\u306e\u6ce8\u91c8\u3092\u6301\u3064 {1} \u306e\u30d5\u30a3\u30fc\u30eb\u30c9 +doclet.ClassUse_MethodAnnotations={0} \u578b\u306e\u6ce8\u91c8\u3092\u6301\u3064 {1} \u306e\u30e1\u30bd\u30c3\u30c9 +doclet.ClassUse_MethodParameterAnnotations={0} \u578b\u306e\u6ce8\u91c8\u3092\u6301\u3064 {1} \u306e\u30e1\u30bd\u30c3\u30c9\u30d1\u30e9\u30e1\u30fc\u30bf +doclet.ClassUse_MethodReturnTypeParameter={0} \u578b\u306e\u5f15\u6570\u3092\u6301\u3064\u578b\u3092\u8fd4\u3059 {1} \u306e\u30e1\u30bd\u30c3\u30c9 +doclet.ClassUse_Subclass={1} \u3067\u306e {0} \u306e\u30b5\u30d6\u30af\u30e9\u30b9 +doclet.ClassUse_Subinterface={1} \u3067\u306e {0} \u306e\u30b5\u30d6\u30a4\u30f3\u30bf\u30d5\u30a7\u30fc\u30b9 +doclet.ClassUse_ImplementingClass={0} \u3092\u5b9f\u88c5\u3057\u3066\u3044\u308b {1} \u306e\u30af\u30e9\u30b9 +doclet.ClassUse_Field={0} \u3068\u3057\u3066\u5ba3\u8a00\u3055\u308c\u3066\u3044\u308b {1} \u306e\u30d5\u30a3\u30fc\u30eb\u30c9 +doclet.ClassUse_MethodReturn={0} \u3092\u8fd4\u3059 {1} \u306e\u30e1\u30bd\u30c3\u30c9 +doclet.ClassUse_MethodArgs={0} \u578b\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u6301\u3064 {1} \u306e\u30e1\u30bd\u30c3\u30c9 +doclet.ClassUse_MethodArgsTypeParameters={0} \u578b\u306e\u578b\u5f15\u6570\u3092\u6301\u3064 {1} \u306e\u30e1\u30bd\u30c3\u30c9\u30d1\u30e9\u30e1\u30fc\u30bf +doclet.ClassUse_MethodThrows={0} \u3092\u30b9\u30ed\u30fc\u3059\u308b {1} \u306e\u30e1\u30bd\u30c3\u30c9 +doclet.ClassUse_ConstructorAnnotations={0} \u578b\u306e\u6ce8\u91c8\u3092\u6301\u3064 {1} \u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf +doclet.ClassUse_ConstructorParameterAnnotations={0} \u578b\u306e\u6ce8\u91c8\u3092\u6301\u3064 {1} \u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u30d1\u30e9\u30e1\u30fc\u30bf +doclet.ClassUse_ConstructorArgs={0} \u578b\u306e\u30d1\u30e9\u30e1\u30fc\u30bf\u3092\u6301\u3064 {1} \u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf +doclet.ClassUse_ConstructorArgsTypeParameters={0} \u578b\u306e\u578b\u5f15\u6570\u3092\u6301\u3064 {1} \u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf\u30d1\u30e9\u30e1\u30fc\u30bf +doclet.ClassUse_ConstructorThrows={0} \u3092\u30b9\u30ed\u30fc\u3059\u308b {1} \u306e\u30b3\u30f3\u30b9\u30c8\u30e9\u30af\u30bf +doclet.ClassUse_No.usage.of.0={0} \u306f\u3069\u3053\u304b\u3089\u3082\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u305b\u3093 +doclet.Window_ClassUse_Header={0} {1} \u306e\u4f7f\u7528 +doclet.ClassUse_Title={0}
    {1} \u306e\u4f7f\u7528 +doclet.navClassUse=\u4f7f\u7528 +doclet.link_option_twice=\u5916\u90e8 URL \u30ea\u30f3\u30af\u30aa\u30d7\u30b7\u30e7\u30f3 (link \u307e\u305f\u306f linkoffline) \u304c 2 \u56de\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059\u3002 +doclet.Error_in_packagelist=-group \u30aa\u30d7\u30b7\u30e7\u30f3\u306e\u4f7f\u7528\u65b9\u6cd5\u306e\u30a8\u30e9\u30fc: {0} {1} +doclet.Groupname_already_used=-group \u30aa\u30d7\u30b7\u30e7\u30f3\u306b\u304a\u3044\u3066\u3001\u3059\u3067\u306b\u30b0\u30eb\u30fc\u30d7\u540d\u304c\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059: {0} +doclet.Same_package_name_used=\u30d1\u30c3\u30b1\u30fc\u30b8\u540d\u5f62\u5f0f\u304c 2 \u56de\u4f7f\u7528\u3055\u308c\u3066\u3044\u307e\u3059: {0} +doclet.Serialization.Excluded_Class=\u5e38\u99d0\u30d5\u30a3\u30fc\u30eb\u30c9 {1} \u306f\u3001\u9664\u5916\u3055\u308c\u305f\u30af\u30e9\u30b9 {0} \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 +doclet.Serialization.Nonexcluded_Class=\u5e38\u99d0\u30d5\u30a3\u30fc\u30eb\u30c9 {1} \u306f\u3001\u975e\u8868\u793a\u306e\u3001\u542b\u307e\u308c\u306a\u3044\u30af\u30e9\u30b9 {0} \u3092\u4f7f\u7528\u3057\u307e\u3059\u3002 +doclet.usage=\u6a19\u6e96\u306e doclet \u306b\u3088\u308a\u63d0\u4f9b\u3055\u308c\u308b\u3082\u306e:\n\ + -d \u51fa\u529b\u30d5\u30a1\u30a4\u30eb\u306e\u8ee2\u9001\u5148\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\n\ + -use \u30af\u30e9\u30b9\u3068\u30d1\u30c3\u30b1\u30fc\u30b8\u306e\u4f7f\u7528\u30da\u30fc\u30b8\u3092\u4f5c\u6210\u3059\u308b\n\ + -version @version \u30d1\u30e9\u30b0\u30e9\u30d5\u3092\u542b\u3081\u308b\n\ + -author @author \u30d1\u30e9\u30b0\u30e9\u30d5\u3092\u542b\u3081\u308b\n\ + -docfilessubdirs doc-file \u30b5\u30d6\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u518d\u5e30\u7684\u306b\u30b3\u30d4\u30fc\u3059\u308b\n\ + -splitindex 1 \u5b57\u3054\u3068\u306b 1 \u30d5\u30a1\u30a4\u30eb\u306b\u7d22\u5f15\u3092\u5206\u5272\u3059\u308b\n\ + -windowtitle \u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u7528\u306e\u30d6\u30e9\u30a6\u30b6\u30a6\u30a3\u30f3\u30c9\u30a6\u30bf\u30a4\u30c8\u30eb\n\ + -doctitle \u6982\u8981\u30da\u30fc\u30b8\u306b\u30bf\u30a4\u30c8\u30eb\u3092\u542b\u3081\u308b\n\ + -header \u5404\u30da\u30fc\u30b8\u306b\u30d8\u30c3\u30c0\u30fc\u3092\u542b\u3081\u308b\n\ + -footer \u5404\u30da\u30fc\u30b8\u306b\u30d5\u30c3\u30bf\u30fc\u3092\u542b\u3081\u308b\n\ + -top \u5404\u30da\u30fc\u30b8\u306b\u4e0a\u90e8\u30c6\u30ad\u30b9\u30c8\u3092\u542b\u3081\u308b\n\ + -bottom \u5404\u30da\u30fc\u30b8\u306b\u4e0b\u90e8\u30c6\u30ad\u30b9\u30c8\u3092\u542b\u3081\u308b\n\ + -link \u306b javadoc \u51fa\u529b\u3078\u306e\u30ea\u30f3\u30af\u3092\u4f5c\u6210\u3059\u308b\n\ + -linkoffline \u306b\u3042\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u30ea\u30b9\u30c8\u3092\u4f7f\u7528\u3057\u3066 \u306e docs \u306b\u30ea\u30f3\u30af\u3059\u308b\n\ + -excludedocfilessubdir :.. \u6307\u5b9a\u3055\u308c\u305f\u540d\u524d\u306e doc-files \u30b5\u30d6\u30c7\u30a3\u30ec\u30af\u30c8\u30ea\u3092\u3059\u3079\u3066\u9664\u5916\u3059\u308b\n\ + -group :.. \u6307\u5b9a\u3059\u308b\u30d1\u30c3\u30b1\u30fc\u30b8\u3092\u6982\u8981\u30da\u30fc\u30b8\u306b\u304a\u3044\u3066\u30b0\u30eb\u30fc\u30d7\u5316\u3059\u308b\n\ + -nocomment \u8a18\u8ff0\u304a\u3088\u3073\u30bf\u30b0\u3092\u6291\u5236\u3057\u3066\u5ba3\u8a00\u3060\u3051\u3092\u751f\u6210\u3059\u308b\n\ + -nodeprecated @deprecated \u60c5\u5831\u3092\u9664\u5916\u3059\u308b\n\ + -noqualifier ::... \u51fa\u529b\u304b\u3089\u4fee\u98fe\u5b50\u306e\u30ea\u30b9\u30c8\u3092\u9664\u5916\u3059\u308b\n\ + -nosince @since \u60c5\u5831\u3092\u9664\u5916\u3059\u308b\n\ + -notimestamp \u975e\u8868\u793a\u306e\u30bf\u30a4\u30e0\u30b9\u30bf\u30f3\u30d7\u3092\u9664\u5916\u3059\u308b\n\ + -nodeprecatedlist \u975e\u63a8\u5968 \u306e\u30ea\u30b9\u30c8\u3092\u751f\u6210\u3057\u306a\u3044\n\ + -notree \u30af\u30e9\u30b9\u968e\u5c64\u3092\u751f\u6210\u3057\u306a\u3044\n\ + -noindex \u7d22\u5f15\u3092\u751f\u6210\u3057\u306a\u3044\n\ + -nohelp \u30d8\u30eb\u30d7\u30ea\u30f3\u30af\u3092\u751f\u6210\u3057\u306a\u3044\n\ + -nonavbar \u30ca\u30d3\u30b2\u30fc\u30b7\u30e7\u30f3\u30d0\u30fc\u3092\u751f\u6210\u3057\u306a\u3044\n\ + -serialwarn @serial \u30bf\u30b0\u306b\u95a2\u3059\u308b\u8b66\u544a\u3092\u751f\u6210\u3059\u308b\n\ + -tag ::
    \u5358\u4e00\u306e\u5f15\u6570\u3092\u6301\u3064\u30ab\u30b9\u30bf\u30e0\u30bf\u30b0\u3092\u6307\u5b9a\u3059\u308b\n\ + -taglet \u30bf\u30b0\u30ec\u30c3\u30c8\u306e\u5b8c\u5168\u4fee\u98fe\u540d\u3092\u767b\u9332\u3059\u308b\n\ + -tagletpath \u30bf\u30b0\u30ec\u30c3\u30c8\u306e\u30d1\u30b9\n\ + -charset \u751f\u6210\u3055\u308c\u308b\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u30af\u30ed\u30b9\u30d7\u30e9\u30c3\u30c8\u30d5\u30a9\u30fc\u30e0\u3067\u306e\u6587\u5b57\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\n\ + -helpfile \u30d8\u30eb\u30d7\u30ea\u30f3\u30af\u306e\u30ea\u30f3\u30af\u5148\u30d5\u30a1\u30a4\u30eb\u3092\u542b\u3081\u308b\n\ + -linksource HTML \u5f62\u5f0f\u3067\u30bd\u30fc\u30b9\u3092\u751f\u6210\u3059\u308b\n\ + -sourcetab \u30bd\u30fc\u30b9\u5185\u306e\u30bf\u30d6\u306e\u7a7a\u767d\u6587\u5b57\u306e\u6570\u3092\u6307\u5b9a\u3059\u308b\n\ + -keywords HTML \u306e meta \u30bf\u30b0\u306b\u3001\u30d1\u30c3\u30b1\u30fc\u30b8\u3001\u30af\u30e9\u30b9\u3001\u304a\u3088\u3073\u30e1\u30f3\u30d0\u30fc\u306e\u60c5\u5831\u3092\u542b\u3081\u308b\n\ + -stylesheetfile \u751f\u6210\u3055\u308c\u305f\u30c9\u30ad\u30e5\u30e1\u30f3\u30c8\u306e\u30b9\u30bf\u30a4\u30eb\u5909\u66f4\u7528\u30d5\u30a1\u30a4\u30eb\n\ + -docencoding \u51fa\u529b\u30a8\u30f3\u30b3\u30fc\u30c7\u30a3\u30f3\u30b0\u540d + + + + diff --git a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties new file mode 100644 index 00000000000..31d1cccf0f9 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/resources/standard_zh_CN.properties @@ -0,0 +1,250 @@ +doclet.build_version=\u6807\u51c6 Doclet \u7248\u672c {0} +doclet.Contents=\u76ee\u5f55 +doclet.Overview=\u6982\u8ff0 +doclet.Window_Overview=\u6982\u8ff0\u5217\u8868 +doclet.Window_Overview_Summary=\u6982\u8ff0 +doclet.Package=\u8f6f\u4ef6\u5305 +doclet.All_Packages=\u6240\u6709\u8f6f\u4ef6\u5305 +doclet.Tree=\u6811 +doclet.Class_Hierarchy=\u7c7b\u5206\u5c42\u7ed3\u6784 +doclet.Window_Class_Hierarchy=\u7c7b\u5206\u5c42\u7ed3\u6784 +doclet.Interface_Hierarchy=\u63a5\u53e3\u5206\u5c42\u7ed3\u6784 +doclet.Enum_Hierarchy=\u679a\u4e3e\u5206\u5c42\u7ed3\u6784 +doclet.Annotation_Type_Hierarchy=\u6ce8\u91ca\u7c7b\u578b\u5206\u5c42\u7ed3\u6784 +doclet.Prev=\u4e0a\u4e00\u4e2a +doclet.Next=\u4e0b\u4e00\u4e2a +doclet.Prev_Class=\u4e0a\u4e00\u4e2a\u7c7b +doclet.Next_Class=\u4e0b\u4e00\u4e2a\u7c7b +doclet.Prev_Package=\u4e0a\u4e00\u4e2a\u8f6f\u4ef6\u5305 +doclet.Next_Package=\u4e0b\u4e00\u4e2a\u8f6f\u4ef6\u5305 +doclet.Prev_Letter=\u4e0a\u4e00\u4e2a\u5b57\u6bcd +doclet.Next_Letter=\u4e0b\u4e00\u4e2a\u5b57\u6bcd +doclet.Show_Lists=\u663e\u793a\u5217\u8868 +doclet.Hide_Lists=\u9690\u85cf\u5217\u8868 +doclet.Href_Class_Title={0} \u4e2d\u7684\u7c7b +doclet.Href_Interface_Title={0} \u4e2d\u7684\u63a5\u53e3 +doclet.Href_Annotation_Title={0} \u4e2d\u7684\u6ce8\u91ca +doclet.Href_Enum_Title={0} \u4e2d\u7684\u679a\u4e3e +doclet.Href_Type_Param_Title={0} \u4e2d\u7684\u7c7b\u578b\u53c2\u6570 +doclet.Href_Class_Or_Interface_Title={0} \u4e2d\u7684\u7c7b\u6216\u63a5\u53e3 +doclet.Summary=\u6458\u8981\uff1a +doclet.Detail=\u8be6\u7ec6\u4fe1\u606f\uff1a +doclet.navNested=\u5d4c\u5957 +doclet.navAnnotationTypeOptionalMember=\u53ef\u9009 +doclet.navAnnotationTypeRequiredMember=\u5fc5\u9700 +doclet.navAnnotationTypeMember=\u5143\u7d20 +doclet.navField=\u5b57\u6bb5 +doclet.navEnum=\u679a\u4e3e\u5e38\u91cf +doclet.navConstructor=\u6784\u9020\u65b9\u6cd5 +doclet.navMethod=\u65b9\u6cd5 +doclet.navFactoryMethod=\u5de5\u5382 +doclet.Index=\u7d22\u5f15 +doclet.Window_Single_Index=\u7d22\u5f15 +doclet.Window_Split_Index={0} - \u7d22\u5f15 +doclet.Help=\u5e2e\u52a9 +doclet.Skip_navigation_links=\u8df3\u8fc7\u5bfc\u822a\u94fe\u63a5 +doclet.None=\u65e0 +doclet.CLASSES=\u7c7b +doclet.MEMBERS=\u6210\u5458 +doclet.NONE=\u65e0 +doclet.Factory_Method_Detail=\u9759\u6001\u5de5\u5382\u65b9\u6cd5\u8be6\u7ec6\u4fe1\u606f +doclet.navDeprecated=\u5df2\u8fc7\u65f6 +doclet.Deprecated_List=\u5df2\u8fc7\u65f6\u9879\u76ee\u5217\u8868 +doclet.Window_Deprecated_List=\u5df2\u8fc7\u65f6\u9879\u76ee\u5217\u8868 +doclet.Note_0_is_deprecated=\u6ce8\u610f\uff1a{0} \u5df2\u8fc7\u65f6\u3002 +doclet.Overrides=\u8986\u76d6\uff1a +doclet.in_class=\u7c7b {1} \u4e2d\u7684 {0} +doclet.0_Fields_and_Methods="{0}" \u5b57\u6bb5\u548c\u65b9\u6cd5 +doclet.Index_of_Fields_and_Methods=\u5b57\u6bb5\u548c\u65b9\u6cd5\u7684\u7d22\u5f15 +doclet.Static_variable_in={0} \u4e2d\u7684\u9759\u6001\u53d8\u91cf +doclet.Variable_in={0} \u4e2d\u7684\u53d8\u91cf +doclet.Constructor_for={0} \u7684\u6784\u9020\u65b9\u6cd5 +doclet.Static_method_in={0} \u4e2d\u7684\u9759\u6001\u65b9\u6cd5 +doclet.Method_in={0} \u4e2d\u7684\u65b9\u6cd5 +doclet.throws=\u629b\u51fa +doclet.package=\u8f6f\u4ef6\u5305 +doclet.MalformedURL=\u4e0d\u89c4\u5219\u7684 URL\uff1a {0} +doclet.File_error=\u8bfb\u53d6\u6587\u4ef6\u65f6\u51fa\u9519\uff1a{0} +doclet.URL_error=\u83b7\u53d6 URL \u65f6\u51fa\u9519\uff1a{0} +doclet.No_Package_Comment_File=\u5bf9\u4e8e\u8f6f\u4ef6\u5305 {0}\uff0c\u627e\u4e0d\u5230 Package.Comment \u6587\u4ef6 +doclet.No_Source_For_Class=\u7c7b {0} \u7684\u6e90\u4fe1\u606f\u4e0d\u53ef\u7528\u3002 +doclet.see.class_or_package_not_found=\u6807\u8bb0 {0}\uff1a\u627e\u4e0d\u5230\u5f15\u7528\uff1a {1} +doclet.see.malformed_tag=\u6807\u8bb0 {0}\uff1a\u4e0d\u89c4\u5219\uff1a {1} +doclet.Inherited_API_Summary=\u7ee7\u627f\u7684 API \u6458\u8981 +doclet.Deprecated_API=\u5df2\u8fc7\u65f6\u7684 API +doclet.Deprecated_Classes=\u5df2\u8fc7\u65f6\u7684\u7c7b +doclet.Deprecated_Enums=\u5df2\u8fc7\u65f6\u7684\u679a\u4e3e +doclet.Deprecated_Interfaces=\u5df2\u8fc7\u65f6\u7684\u63a5\u53e3 +doclet.Deprecated_Exceptions=\u5df2\u8fc7\u65f6\u7684\u5f02\u5e38 +doclet.Deprecated_Annotation_Types=\u5df2\u8fc7\u65f6\u7684\u6ce8\u91ca\u7c7b\u578b +doclet.Deprecated_Errors=\u5df2\u8fc7\u65f6\u7684\u9519\u8bef +doclet.Deprecated_Fields=\u5df2\u8fc7\u65f6\u7684\u5b57\u6bb5 +doclet.Deprecated_Constructors=\u5df2\u8fc7\u65f6\u7684\u6784\u9020\u65b9\u6cd5 +doclet.Deprecated_Methods=\u5df2\u8fc7\u65f6\u7684\u65b9\u6cd5 +doclet.Deprecated_Enum_Constants=\u5df2\u8fc7\u65f6\u7684\u679a\u4e3e\u5e38\u91cf +doclet.Deprecated_Annotation_Type_Members=\u5df2\u8fc7\u65f6\u7684\u6ce8\u91ca\u7c7b\u578b\u5143\u7d20 +doclet.Frame_Output=\u6846\u67b6\u8f93\u51fa +doclet.Docs_generated_by_Javadoc=\u7531 Javadoc \u751f\u6210\u7684\u6587\u6863\u3002 +doclet.Generated_Docs_Untitled=\u751f\u6210\u7684\u6587\u6863\uff08\u65e0\u6807\u9898\uff09 +doclet.Blank=\u7a7a\u767d +doclet.Other_Packages=\u5176\u4ed6\u8f6f\u4ef6\u5305 +doclet.Package_Description=\u8f6f\u4ef6\u5305 {0} \u7684\u63cf\u8ff0 +doclet.Description=\u63cf\u8ff0 +doclet.Specified_By=\u6307\u5b9a\u8005\uff1a +doclet.in_interface=\u63a5\u53e3 {1} \u4e2d\u7684 {0} +doclet.Subclasses=\u76f4\u63a5\u5df2\u77e5\u5b50\u7c7b\uff1a +doclet.Subinterfaces=\u6240\u6709\u5df2\u77e5\u5b50\u63a5\u53e3\uff1a +doclet.Implementing_Classes=\u6240\u6709\u5df2\u77e5\u5b9e\u73b0\u7c7b\uff1a +doclet.also=\u5e76 +doclet.Option=\u9009\u9879 +doclet.Or=\u6216 +doclet.Frames=\u6846\u67b6 +doclet.FRAMES=\u6846\u67b6 +doclet.NO_FRAMES=\u65e0\u6846\u67b6 +doclet.Package_Hierarchies=\u8f6f\u4ef6\u5305\u5206\u5c42\u7ed3\u6784\uff1a +doclet.Hierarchy_For_Package=\u8f6f\u4ef6\u5305 {0} \u7684\u5206\u5c42\u7ed3\u6784 +doclet.Source_Code=\u6e90\u4ee3\u7801\uff1a +doclet.Hierarchy_For_All_Packages=\u6240\u6709\u8f6f\u4ef6\u5305\u7684\u5206\u5c42\u7ed3\u6784 +doclet.Cannot_handle_no_packages=\u65e0\u6cd5\u5904\u7406\u6ca1\u6709\u8f6f\u4ef6\u5305\u7684\u60c5\u51b5\u3002 +doclet.Frame_Alert=\u6846\u67b6\u8b66\u62a5 +doclet.Overview-Member-Frame=\u6210\u5458\u6846\u67b6\u6982\u8ff0 +doclet.Frame_Warning_Message=\u8bf7\u4f7f\u7528\u6846\u67b6\u529f\u80fd\u67e5\u770b\u6b64\u6587\u6863\u3002\u5982\u679c\u770b\u5230\u6b64\u6d88\u606f\uff0c\u5219\u8868\u660e\u60a8\u4f7f\u7528\u7684\u662f\u4e0d\u652f\u6301\u6846\u67b6\u7684 Web \u5ba2\u6237\u673a\u3002 +doclet.Non_Frame_Version=\u975e\u6846\u67b6\u7248\u672c\u3002 +doclet.Frame_Version=\u6846\u67b6\u7248\u672c +doclet.Link_To=\u94fe\u63a5\u5230 +doclet.Following_From_Class=\u4ee5\u4e0b\u5185\u5bb9\u662f\u4ece\u7c7b {0} \u590d\u5236\u7684 +doclet.Following_From_Interface=\u4ee5\u4e0b\u5185\u5bb9\u662f\u4ece\u63a5\u53e3 {0} \u590d\u5236\u7684 +doclet.Description_From_Interface=\u4ece\u63a5\u53e3 {0} \u590d\u5236\u7684\u63cf\u8ff0 +doclet.Description_From_Class=\u4ece\u7c7b {0} \u590d\u5236\u7684\u63cf\u8ff0 +doclet.Standard_doclet_invoked=\u5df2\u8c03\u7528\u7684\u6807\u51c6 doclet... +doclet.No_Non_Deprecated_Classes_To_Document=\u627e\u4e0d\u5230\u53ef\u4ee5\u6587\u6863\u5316\u7684\u672a\u8fc7\u65f6\u7684\u7c7b\u3002 +doclet.Interfaces_Italic=\u63a5\u53e3\uff08\u659c\u4f53\uff09 +doclet.Enclosing_Class=\u6b63\u5728\u5c01\u95ed\u7c7b\uff1a +doclet.Enclosing_Interface=\u6b63\u5728\u5c01\u95ed\u63a5\u53e3\uff1a +doclet.Help_title=API \u5e2e\u52a9 +doclet.Window_Help_title=API \u5e2e\u52a9 +doclet.Help_line_1=\u6b64 API \u6587\u6863\u7684\u7ec4\u7ec7\u65b9\u5f0f +doclet.Help_line_2=\u6b64 API\uff08\u5e94\u7528\u7a0b\u5e8f\u7f16\u7a0b\u63a5\u53e3\uff09\u6587\u6863\u5305\u542b\u5bf9\u5e94\u4e8e\u5bfc\u822a\u680f\u4e2d\u7684\u9879\u76ee\u7684\u9875\u9762\uff0c\u5982\u4e0b\u6240\u8ff0\u3002 +doclet.Help_line_3={0} \u9875\u9762\u662f\u6b64 API \u6587\u6863\u7684\u9996\u9875\uff0c\u63d0\u4f9b\u4e86\u6240\u6709\u8f6f\u4ef6\u5305\u7684\u5217\u8868\u53ca\u5176\u6458\u8981\u3002\u6b64\u9875\u9762\u4e5f\u53ef\u80fd\u5305\u542b\u8fd9\u4e9b\u8f6f\u4ef6\u5305\u7684\u603b\u4f53\u63cf\u8ff0\u3002 +doclet.Help_line_4=\u6bcf\u4e2a\u8f6f\u4ef6\u5305\u90fd\u6709\u4e00\u4e2a\u9875\u9762\uff0c\u5176\u4e2d\u5305\u542b\u5b83\u7684\u7c7b\u548c\u63a5\u53e3\u7684\u5217\u8868\u53ca\u5176\u6458\u8981\u3002\u6b64\u9875\u9762\u53ef\u4ee5\u5305\u542b\u56db\u4e2a\u7c7b\u522b\uff1a +doclet.Help_line_5=\u7c7b/\u63a5\u53e3 +doclet.Help_line_6=\u6bcf\u4e2a\u7c7b\u3001\u63a5\u53e3\u3001\u5d4c\u5957\u7c7b\u548c\u5d4c\u5957\u63a5\u53e3\u90fd\u6709\u5404\u81ea\u7684\u9875\u9762\u3002\u5176\u4e2d\u6bcf\u4e2a\u9875\u9762\u90fd\u7531\u4e09\u90e8\u5206\uff08\u7c7b/\u63a5\u53e3\u63cf\u8ff0\u3001\u6458\u8981\u8868\uff0c\u4ee5\u53ca\u8be6\u7ec6\u7684\u6210\u5458\u63cf\u8ff0\uff09\u7ec4\u6210\uff1a +doclet.Help_line_7=\u7c7b\u7ee7\u627f\u56fe +doclet.Help_line_8=\u76f4\u63a5\u5b50\u7c7b +doclet.Help_line_9=\u6240\u6709\u5df2\u77e5\u5b50\u63a5\u53e3 +doclet.Help_line_10=\u6240\u6709\u5df2\u77e5\u5b9e\u73b0\u7c7b +doclet.Help_line_11=\u7c7b/\u63a5\u53e3\u58f0\u660e +doclet.Help_line_12=\u7c7b/\u63a5\u53e3\u63cf\u8ff0 +doclet.Help_line_13=\u6bcf\u4e2a\u6458\u8981\u6761\u76ee\u90fd\u5305\u542b\u8be5\u9879\u76ee\u7684\u8be6\u7ec6\u63cf\u8ff0\u7684\u7b2c\u4e00\u53e5\u3002\u6458\u8981\u6761\u76ee\u6309\u5b57\u6bcd\u987a\u5e8f\u6392\u5217\uff0c\u800c\u8be6\u7ec6\u63cf\u8ff0\u5219\u6309\u5176\u5728\u6e90\u4ee3\u7801\u4e2d\u51fa\u73b0\u7684\u987a\u5e8f\u6392\u5217\u3002\u8fd9\u6837\u4fdd\u6301\u4e86\u7a0b\u5e8f\u5458\u6240\u5efa\u7acb\u7684\u903b\u8f91\u5206\u7ec4\u3002 +doclet.Help_line_14=\u4f7f\u7528 +doclet.Help_line_15=\u6bcf\u4e2a\u5df2\u6587\u6863\u5316\u7684\u8f6f\u4ef6\u5305\u3001\u7c7b\u548c\u63a5\u53e3\u90fd\u6709\u5404\u81ea\u7684\u201c\u4f7f\u7528\u201d\u9875\u9762\u3002\u6b64\u9875\u9762\u4ecb\u7ecd\u4e86\u4f7f\u7528\u7ed9\u5b9a\u7c7b\u6216\u8f6f\u4ef6\u5305\u7684\u4efb\u4f55\u90e8\u5206\u7684\u8f6f\u4ef6\u5305\u3001\u7c7b\u3001\u65b9\u6cd5\u3001\u6784\u9020\u65b9\u6cd5\u548c\u5b57\u6bb5\u3002\u5bf9\u4e8e\u7ed9\u5b9a\u7684\u7c7b\u6216\u63a5\u53e3 A\uff0c\u5176\u201c\u4f7f\u7528\u201d\u9875\u9762\u5305\u542b A \u7684\u5b50\u7c7b\u3001\u58f0\u660e\u4e3a A \u7684\u5b57\u6bb5\u3001\u8fd4\u56de A \u7684\u65b9\u6cd5\uff0c\u4ee5\u53ca\u5e26\u6709\u7c7b\u578b\u4e3a A \u7684\u53c2\u6570\u7684\u65b9\u6cd5\u548c\u6784\u9020\u65b9\u6cd5\u3002\u8bbf\u95ee\u6b64\u9875\u9762\u7684\u65b9\u6cd5\u662f\uff1a\u9996\u5148\u8f6c\u81f3\u8f6f\u4ef6\u5305\u3001\u7c7b\u6216\u63a5\u53e3\uff0c\u7136\u540e\u5355\u51fb\u5bfc\u822a\u680f\u4e2d\u7684\u201c\u4f7f\u7528\u201d\u94fe\u63a5\u3002 +doclet.Help_line_16=\u6811\uff08\u7c7b\u5206\u5c42\u7ed3\u6784\uff09 +doclet.Help_line_17_with_tree_link=\u5bf9\u4e8e\u6240\u6709\u8f6f\u4ef6\u5305\uff0c\u6709\u4e00\u4e2a {0} \u9875\u9762\uff0c\u4ee5\u53ca\u6bcf\u4e2a\u8f6f\u4ef6\u5305\u7684\u5206\u5c42\u7ed3\u6784\u3002\u6bcf\u4e2a\u5206\u5c42\u7ed3\u6784\u9875\u9762\u90fd\u5305\u542b\u7c7b\u7684\u5217\u8868\u548c\u63a5\u53e3\u7684\u5217\u8868\u3002\u4ece java.lang.Object \u5f00\u59cb\uff0c\u6309\u7ee7\u627f\u7ed3\u6784\u5bf9\u7c7b\u8fdb\u884c\u6392\u5217\u3002\u63a5\u53e3\u4e0d\u4ece java.lang.Object \u7ee7\u627f\u3002 +doclet.Help_line_18=\u67e5\u770b\u201c\u6982\u8ff0\u201d\u9875\u9762\u65f6\uff0c\u5355\u51fb\u201c\u6811\u201d\u5c06\u663e\u793a\u6240\u6709\u8f6f\u4ef6\u5305\u7684\u5206\u5c42\u7ed3\u6784\u3002 +doclet.Help_line_19=\u67e5\u770b\u7279\u5b9a\u8f6f\u4ef6\u5305\u3001\u7c7b\u6216\u63a5\u53e3\u9875\u9762\u65f6\uff0c\u5355\u51fb\u201c\u6811\u201d\u5c06\u4ec5\u663e\u793a\u8be5\u8f6f\u4ef6\u5305\u7684\u5206\u5c42\u7ed3\u6784\u3002 +doclet.Help_line_20_with_deprecated_api_link={0} \u9875\u9762\u5217\u51fa\u4e86\u6240\u6709\u5df2\u8fc7\u65f6\u7684 API\u3002\u4e00\u822c\u7531\u4e8e\u8fdb\u884c\u4e86\u6539\u8fdb\u5e76\u4e14\u901a\u5e38\u63d0\u4f9b\u4e86\u66ff\u4ee3\u7684 API\uff0c\u6240\u4ee5\u5efa\u8bae\u4e0d\u8981\u4f7f\u7528\u5df2\u8fc7\u65f6\u7684 API\u3002\u5728\u5c06\u6765\u7684\u5b9e\u65bd\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u80fd\u4f1a\u5220\u9664\u5df2\u8fc7\u65f6\u7684 API\u3002 +doclet.Help_line_21=\u7d22\u5f15 +doclet.Help_line_22={0} \u5305\u542b\u6309\u5b57\u6bcd\u987a\u5e8f\u6392\u5217\u7684\u6240\u6709\u7c7b\u3001\u63a5\u53e3\u3001\u6784\u9020\u65b9\u6cd5\u3001\u65b9\u6cd5\u548c\u5b57\u6bb5\u7684\u5217\u8868\u3002 +doclet.Help_line_23=\u4e0a\u4e00\u4e2a/\u4e0b\u4e00\u4e2a +doclet.Help_line_24=\u8fd9\u4e9b\u94fe\u63a5\u4f7f\u60a8\u53ef\u4ee5\u8f6c\u81f3\u4e0b\u4e00\u4e2a\u6216\u4e0a\u4e00\u4e2a\u7c7b\u3001\u63a5\u53e3\u3001\u8f6f\u4ef6\u5305\u6216\u76f8\u5173\u9875\u9762\u3002 +doclet.Help_line_25=\u6846\u67b6/\u65e0\u6846\u67b6 +doclet.Help_line_26=\u8fd9\u4e9b\u94fe\u63a5\u7528\u4e8e\u663e\u793a\u548c\u9690\u85cf HTML \u6846\u67b6\u3002\u6240\u6709\u9875\u9762\u5747\u5177\u6709\u6709\u6846\u67b6\u548c\u65e0\u6846\u67b6\u4e24\u79cd\u663e\u793a\u65b9\u5f0f\u3002 +doclet.Help_line_27=\u6bcf\u4e2a\u53ef\u5e8f\u5217\u5316\u6216\u53ef\u5916\u90e8\u5316\u7684\u7c7b\u90fd\u6709\u5176\u5e8f\u5217\u5316\u5b57\u6bb5\u548c\u65b9\u6cd5\u7684\u63cf\u8ff0\u3002\u6b64\u4fe1\u606f\u5bf9\u91cd\u65b0\u5b9e\u73b0\u8005\u6709\u7528\uff0c\u800c\u5bf9\u4f7f\u7528 API \u7684\u5f00\u53d1\u8005\u5219\u6ca1\u6709\u4ec0\u4e48\u7528\u5904\u3002\u5c3d\u7ba1\u5bfc\u822a\u680f\u4e2d\u6ca1\u6709\u94fe\u63a5\uff0c\u4f46\u60a8\u53ef\u4ee5\u901a\u8fc7\u4e0b\u5217\u65b9\u5f0f\u83b7\u53d6\u6b64\u4fe1\u606f\uff1a\u8f6c\u81f3\u4efb\u4f55\u5e8f\u5217\u5316\u7c7b\uff0c\u7136\u540e\u5355\u51fb\u7c7b\u63cf\u8ff0\u7684\u201c\u53e6\u8bf7\u53c2\u89c1\u201d\u90e8\u5206\u4e2d\u7684\u201c\u5e8f\u5217\u5316\u8868\u683c\u201d\u3002 +doclet.Help_line_28=\u5e38\u91cf\u5b57\u6bb5\u503c\u9875\u9762\u5217\u51fa\u4e86\u9759\u6001\u6700\u7ec8\u5b57\u6bb5\u53ca\u5176\u503c\u3002 +doclet.Help_line_29=\u6b64\u5e2e\u52a9\u6587\u4ef6\u9002\u7528\u4e8e\u4f7f\u7528\u6807\u51c6 doclet \u751f\u6210\u7684 API \u6587\u6863\u3002 +doclet.Help_enum_line_1=\u6bcf\u4e2a\u679a\u4e3e\u90fd\u6709\u5404\u81ea\u7684\u9875\u9762\uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u90e8\u5206\uff1a +doclet.Help_enum_line_2=\u679a\u4e3e\u58f0\u660e +doclet.Help_enum_line_3=\u679a\u4e3e\u63cf\u8ff0 +doclet.Help_annotation_type_line_1=\u6bcf\u4e2a\u6ce8\u91ca\u7c7b\u578b\u90fd\u6709\u5404\u81ea\u7684\u9875\u9762\uff0c\u5176\u4e2d\u5305\u542b\u4ee5\u4e0b\u90e8\u5206\uff1a +doclet.Help_annotation_type_line_2=\u6ce8\u91ca\u7c7b\u578b\u58f0\u660e +doclet.Help_annotation_type_line_3=\u6ce8\u91ca\u7c7b\u578b\u63cf\u8ff0 +doclet.The=The +doclet.Style_line_1=Javadoc \u6837\u5f0f\u8868 +doclet.Style_line_2=\u5728\u6b64\u5904\u5b9a\u4e49\u989c\u8272\u3001\u5b57\u4f53\u548c\u5176\u4ed6\u6837\u5f0f\u5c5e\u6027\u4ee5\u8986\u76d6\u9ed8\u8ba4\u503c +doclet.Style_line_3=\u9875\u9762\u80cc\u666f\u989c\u8272 +doclet.Style_Headings=\u6807\u9898 +doclet.Style_line_4=\u8868\u683c\u989c\u8272 +doclet.Style_line_5=\u6df1\u7d2b\u8272 +doclet.Style_line_6=\u6de1\u7d2b\u8272 +doclet.Style_line_7=\u767d\u8272 +doclet.Style_line_8=\u5de6\u4fa7\u7684\u6846\u67b6\u5217\u8868\u4e2d\u4f7f\u7528\u7684\u5b57\u4f53 +doclet.Style_line_9=\u6846\u67b6\u4e2d\u5c0f\u53f7 sans-serif \u5b57\u4f53\u7684\u793a\u4f8b +doclet.Style_line_10=\u5bfc\u822a\u680f\u5b57\u4f53\u548c\u989c\u8272 +doclet.Style_line_11=\u6df1\u84dd\u8272 +doclet.ClassUse_Packages.that.use.0=\u4f7f\u7528 {0} \u7684\u8f6f\u4ef6\u5305 +doclet.ClassUse_Uses.of.0.in.1={1} \u4e2d {0} \u7684\u4f7f\u7528 +doclet.ClassUse_Classes.in.0.used.by.1={1} \u4f7f\u7528\u7684 {0} \u4e2d\u7684\u7c7b +doclet.ClassUse_PackageAnnotation=\u6ce8\u91ca\u7c7b\u578b\u4e3a {0} \u7684\u8f6f\u4ef6\u5305 +doclet.ClassUse_Annotation=\u6ce8\u91ca\u7c7b\u578b\u4e3a {0} \u7684 {1} \u4e2d\u7684\u7c7b +doclet.ClassUse_TypeParameter=\u7c7b\u578b\u53c2\u6570\u7c7b\u578b\u4e3a {0} \u7684 {1} \u4e2d\u7684\u7c7b +doclet.ClassUse_MethodTypeParameter=\u7c7b\u578b\u53c2\u6570\u7c7b\u578b\u4e3a {0} \u7684 {1} \u4e2d\u7684\u65b9\u6cd5 +doclet.ClassUse_FieldTypeParameter=\u7c7b\u578b\u53c2\u6570\u7c7b\u578b\u4e3a {0} \u7684 {1} \u4e2d\u7684\u5b57\u6bb5 +doclet.ClassUse_FieldAnnotations=\u6ce8\u91ca\u7c7b\u578b\u4e3a {0} \u7684 {1} \u4e2d\u7684\u5b57\u6bb5 +doclet.ClassUse_MethodAnnotations=\u6ce8\u91ca\u7c7b\u578b\u4e3a {0} \u7684 {1} \u4e2d\u7684\u65b9\u6cd5 +doclet.ClassUse_MethodParameterAnnotations=\u6ce8\u91ca\u7c7b\u578b\u4e3a {0} \u7684 {1} \u4e2d\u7684\u65b9\u6cd5\u53c2\u6570 +doclet.ClassUse_MethodReturnTypeParameter=\u8fd4\u56de\u53d8\u91cf\u7c7b\u578b\u4e3a {0} \u7684\u7c7b\u578b\u7684 {1} \u4e2d\u7684\u65b9\u6cd5 +doclet.ClassUse_Subclass={1} \u4e2d {0} \u7684\u5b50\u7c7b +doclet.ClassUse_Subinterface={1} \u4e2d {0} \u7684\u5b50\u63a5\u53e3 +doclet.ClassUse_ImplementingClass=\u5b9e\u73b0 {0} \u7684 {1} \u4e2d\u7684\u7c7b +doclet.ClassUse_Field=\u58f0\u660e\u4e3a {0} \u7684 {1} \u4e2d\u7684\u5b57\u6bb5 +doclet.ClassUse_MethodReturn=\u8fd4\u56de {0} \u7684 {1} \u4e2d\u7684\u65b9\u6cd5 +doclet.ClassUse_MethodArgs=\u53c2\u6570\u7c7b\u578b\u4e3a {0} \u7684 {1} \u4e2d\u7684\u65b9\u6cd5 +doclet.ClassUse_MethodArgsTypeParameters=\u7c7b\u578b\u53d8\u91cf\u7c7b\u578b\u4e3a {0} \u7684 {1} \u4e2d\u7684\u65b9\u6cd5\u53c2\u6570 +doclet.ClassUse_MethodThrows=\u629b\u51fa {0} \u7684 {1} \u4e2d\u7684\u65b9\u6cd5 +doclet.ClassUse_ConstructorAnnotations=\u6ce8\u91ca\u7c7b\u578b\u4e3a {0} \u7684 {1} \u4e2d\u7684\u6784\u9020\u65b9\u6cd5 +doclet.ClassUse_ConstructorParameterAnnotations=\u6ce8\u91ca\u7c7b\u578b\u4e3a {0} \u7684 {1} \u4e2d\u7684\u6784\u9020\u65b9\u6cd5\u53c2\u6570 +doclet.ClassUse_ConstructorArgs=\u53c2\u6570\u7c7b\u578b\u4e3a {0} \u7684 {1} \u4e2d\u7684\u6784\u9020\u65b9\u6cd5 +doclet.ClassUse_ConstructorArgsTypeParameters=\u7c7b\u578b\u53d8\u91cf\u7c7b\u578b\u4e3a {0} \u7684 {1} \u4e2d\u7684\u6784\u9020\u65b9\u6cd5\u53c2\u6570 +doclet.ClassUse_ConstructorThrows=\u629b\u51fa {0} \u7684 {1} \u4e2d\u7684\u6784\u9020\u65b9\u6cd5 +doclet.ClassUse_No.usage.of.0=\u6ca1\u6709 {0} \u7684\u7528\u6cd5 +doclet.Window_ClassUse_Header={0} {1} \u7684\u4f7f\u7528 +doclet.ClassUse_Title={0} {1}
    \u7684\u4f7f\u7528 +doclet.navClassUse=\u4f7f\u7528 +doclet.link_option_twice=\u5916\u90e8 URL \u94fe\u63a5\u9009\u9879\uff08link \u6216 linkoffline\uff09\u4f7f\u7528\u4e86\u4e24\u6b21\u3002 +doclet.Error_in_packagelist=\u4f7f\u7528 -group \u9009\u9879\u65f6\u51fa\u9519\uff1a {0} {1} +doclet.Groupname_already_used=\u5728 -group \u9009\u9879\u4e2d\uff0cgroupname \u5df2\u4f7f\u7528\uff1a {0} +doclet.Same_package_name_used=\u8f6f\u4ef6\u5305\u540d\u79f0\u5f62\u5f0f\u4f7f\u7528\u4e86\u4e24\u6b21\uff1a {0} +doclet.Serialization.Excluded_Class=\u975e\u77ac\u6001\u5b57\u6bb5 {1} \u4f7f\u7528\u4e86\u6392\u9664\u7684\u7c7b {0}\u3002 +doclet.Serialization.Nonexcluded_Class=\u975e\u77ac\u6001\u5b57\u6bb5 {1} \u4f7f\u7528\u4e86\u9690\u85cf\u7684\u3001\u672a\u5305\u542b\u7684\u7c7b {0}\u3002 +doclet.usage=\u901a\u8fc7\u6807\u51c6 doclet \u63d0\u4f9b:\n\ +-d \u8f93\u51fa\u6587\u4ef6\u7684\u76ee\u6807\u76ee\u5f55\n\ +-use \u521b\u5efa\u7c7b\u548c\u5305\u7528\u6cd5\u9875\u9762\n\ +-version \u5305\u542b @version \u6bb5\n\ +-author \u5305\u542b @author \u6bb5\n\ +-docfilessubdirs \u9012\u5f52\u590d\u5236\u6587\u6863\u6587\u4ef6\u5b50\u76ee\u5f55\n\ +-splitindex \u5c06\u7d22\u5f15\u5206\u4e3a\u6bcf\u4e2a\u5b57\u6bcd\u5bf9\u5e94\u4e00\u4e2a\u6587\u4ef6\n\ +-windowtitle \u6587\u6863\u7684\u6d4f\u89c8\u5668\u7a97\u53e3\u6807\u9898\n\ +-doctitle \u5305\u542b\u6982\u8ff0\u9875\u9762\u7684\u6807\u9898\n\ +-header \u5305\u542b\u6bcf\u4e2a\u9875\u9762\u7684\u9875\u7709\u6587\u672c\n\ +-footer \u5305\u542b\u6bcf\u4e2a\u9875\u9762\u7684\u9875\u811a\u6587\u672c\n\ +-top \u5305\u542b\u6bcf\u4e2a\u9875\u9762\u7684\u9876\u90e8\u6587\u672c\n\ +-bottom \u5305\u542b\u6bcf\u4e2a\u9875\u9762\u7684\u5e95\u90e8\u6587\u672c\n\ +-link \u521b\u5efa\u6307\u5411\u4f4d\u4e8e \u7684 javadoc \u8f93\u51fa\u7684\u94fe\u63a5\n\ +-linkoffline \u5229\u7528\u4f4d\u4e8e \u7684\u5305\u5217\u8868\u94fe\u63a5\u81f3\u4f4d\u4e8e \u7684\u6587\u6863\n\ +-excludedocfilessubdir :..\u6392\u9664\u5177\u6709\u7ed9\u5b9a\u540d\u79f0\u7684\u6240\u6709\u6587\u6863\u6587\u4ef6\u5b50\u76ee\u5f55\u3002\n\ +-group :..\u5728\u6982\u8ff0\u9875\u9762\u4e2d\uff0c\u5c06\u6307\u5b9a\u7684\u5305\u5206\u7ec4\n\ +-nocomment \u4e0d\u751f\u6210\u63cf\u8ff0\u548c\u6807\u8bb0\uff0c\u53ea\u751f\u6210\u58f0\u660e\u3002\n\ +-nodeprecated \u4e0d\u5305\u542b @deprecated \u4fe1\u606f\n\ +-noqualifier ::...\u8f93\u51fa\u4e2d\u4e0d\u5305\u62ec\u6307\u5b9a\u9650\u5b9a\u7b26\u7684\u5217\u8868\u3002\n\ +-nosince \u4e0d\u5305\u542b @since \u4fe1\u606f\n\ +-notimestamp \u4e0d\u5305\u542b\u9690\u85cf\u65f6\u95f4\u6233\n\ +-nodeprecatedlist \u4e0d\u751f\u6210\u5df2\u8fc7\u65f6\u7684\u5217\u8868\n\ +-notree \u4e0d\u751f\u6210\u7c7b\u5206\u5c42\u7ed3\u6784\n\ +-noindex \u4e0d\u751f\u6210\u7d22\u5f15\n\ +-nohelp \u4e0d\u751f\u6210\u5e2e\u52a9\u94fe\u63a5\n\ +-nonavbar \u4e0d\u751f\u6210\u5bfc\u822a\u680f\n\ +-serialwarn \u751f\u6210\u6709\u5173 @serial \u6807\u8bb0\u7684\u8b66\u544a\n\ +-tag ::
    \u6307\u5b9a\u5355\u4e2a\u53c2\u6570\u81ea\u5b9a\u4e49\u6807\u8bb0\n\ +-taglet \u8981\u6ce8\u518c\u7684 Taglet \u7684\u5168\u9650\u5b9a\u540d\u79f0\n\ +-tagletpath Taglet \u7684\u8def\u5f84\n\ +-charset \u7528\u4e8e\u8de8\u5e73\u53f0\u67e5\u770b\u751f\u6210\u7684\u6587\u6863\u7684\u5b57\u7b26\u96c6\u3002\n\ +-helpfile \u5305\u542b\u5e2e\u52a9\u94fe\u63a5\u6240\u94fe\u63a5\u5230\u7684\u6587\u4ef6\n\ +-linksource \u4ee5 HTML \u683c\u5f0f\u751f\u6210\u6e90\u6587\u4ef6\n\ +-sourcetab \u6307\u5b9a\u6e90\u4e2d\u6bcf\u4e2a\u5236\u8868\u7b26\u5360\u636e\u7684\u7a7a\u683c\u6570\n\ +-keywords \u4f7f\u5305\u3001\u7c7b\u548c\u6210\u5458\u4fe1\u606f\u9644\u5e26 HTML \u5143\u6807\u8bb0\n\ +-stylesheetfile \u7528\u4e8e\u66f4\u6539\u751f\u6210\u6587\u6863\u7684\u6837\u5f0f\u7684\u6587\u4ef6\n\ +-docencoding \u8f93\u51fa\u7f16\u7801\u540d\u79f0 + + + + diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java new file mode 100644 index 00000000000..740f63998bc --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AbstractDoclet.java @@ -0,0 +1,199 @@ +/* + * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit; + +import com.sun.tools.doclets.internal.toolkit.builders.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.javadoc.*; +import java.util.*; +import java.io.*; + +/** + * An abstract implementation of a Doclet. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API. + * + * @author Jamie Ho + */ +public abstract class AbstractDoclet { + + /** + * The global configuration information for this run. + */ + public Configuration configuration = configuration(); + + /** + * The only doclet that may use this toolkit is {@value} + */ + private static final String TOOLKIT_DOCLET_NAME = new + com.sun.tools.doclets.formats.html.HtmlDoclet().getClass().getName(); + + /** + * Verify that the only doclet that is using this toolkit is + * {@value #TOOLKIT_DOCLET_NAME}. + */ + private boolean isValidDoclet(AbstractDoclet doclet) { + if (! doclet.getClass().getName().equals(TOOLKIT_DOCLET_NAME)) { + configuration.message.error("doclet.Toolkit_Usage_Violation", + TOOLKIT_DOCLET_NAME); + return false; + } + return true; + } + + /** + * The method that starts the execution of the doclet. + * + * @param doclet the doclet to start the execution for. + * @param root the {@link RootDoc} that points to the source to document. + * @return true if the doclet executed without error. False otherwise. + */ + public boolean start(AbstractDoclet doclet, RootDoc root) { + configuration.root = root; + if (! isValidDoclet(doclet)) { + return false; + } + try { + doclet.startGeneration(root); + } catch (Exception exc) { + exc.printStackTrace(); + return false; + } + return true; + } + + /** + * Indicate that this doclet supports the 1.5 language features. + * @return JAVA_1_5, indicating that the new features are supported. + */ + public static LanguageVersion languageVersion() { + return LanguageVersion.JAVA_1_5; + } + + + /** + * Create the configuration instance and returns it. + * @return the configuration of the doclet. + */ + public abstract Configuration configuration(); + + /** + * Start the generation of files. Call generate methods in the individual + * writers, which will in turn genrate the documentation files. Call the + * TreeWriter generation first to ensure the Class Hierarchy is built + * first and then can be used in the later generation. + * + * @see com.sun.javadoc.RootDoc + */ + private void startGeneration(RootDoc root) throws Exception { + if (root.classes().length == 0) { + configuration.message. + error("doclet.No_Public_Classes_To_Document"); + return; + } + 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(); + } + + /** + * Generate additional documentation that is added to the API documentation. + * + * @param root the RootDoc of source to document. + * @param classtree the data structure representing the class tree. + */ + protected void generateOtherFiles(RootDoc root, ClassTree classtree) throws Exception { + BuilderFactory builderFactory = configuration.getBuilderFactory(); + AbstractBuilder constantsSummaryBuilder = builderFactory.getConstantsSummaryBuider(); + constantsSummaryBuilder.build(); + AbstractBuilder serializedFormBuilder = builderFactory.getSerializedFormBuilder(); + serializedFormBuilder.build(); + } + + /** + * Generate the package documentation. + * + * @param classtree the data structure representing the class tree. + */ + protected abstract void generatePackageFiles(ClassTree classtree) throws Exception; + + /** + * Generate the class documentation. + * + * @param classtree the data structure representing the class tree. + */ + protected abstract void generateClassFiles(ClassDoc[] arr, ClassTree classtree); + + /** + * Iterate through all classes and construct documentation for them. + * + * @param root the RootDoc of source to document. + * @param classtree the data structure representing the class tree. + */ + protected void generateClassFiles(RootDoc root, ClassTree classtree) { + generateClassFiles(classtree); + PackageDoc[] packages = root.specifiedPackages(); + for (int i = 0; i < packages.length; i++) { + generateClassFiles(packages[i].allClasses(), classtree); + } + } + + /** + * Generate the class files for single classes specified on the command line. + * + * @param classtree the data structure representing the class tree. + */ + private void generateClassFiles(ClassTree classtree) { + String[] packageNames = configuration.classDocCatalog.packageNames(); + for (int packageNameIndex = 0; packageNameIndex < packageNames.length; + packageNameIndex++) { + generateClassFiles(configuration.classDocCatalog.allClasses( + packageNames[packageNameIndex]), classtree); + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeOptionalMemberWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeOptionalMemberWriter.java new file mode 100644 index 00000000000..edf81bf90af --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeOptionalMemberWriter.java @@ -0,0 +1,48 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit; + +import com.sun.javadoc.*; + +/** + * The interface for writing annotation type optional member output. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ + +public interface AnnotationTypeOptionalMemberWriter extends + AnnotationTypeRequiredMemberWriter { + + /** + * Write the default value documentation. + */ + public void writeDefaultValueInfo(MemberDoc member); +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeRequiredMemberWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeRequiredMemberWriter.java new file mode 100644 index 00000000000..50ef9636ce0 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeRequiredMemberWriter.java @@ -0,0 +1,105 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit; + +import java.io.*; +import com.sun.javadoc.*; + +/** + * The interface for writing annotation type required member output. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ + +public interface AnnotationTypeRequiredMemberWriter { + + /** + * Write the header for the member documentation. + * + * @param classDoc the annotation type that the members belong to. + * @param header the header to write. + */ + public void writeHeader(ClassDoc classDoc, String header); + + /** + * Write the member header for the given member. + * + * @param member the member being documented. + * @param isFirst the flag to indicate whether or not the member is + * the first to be documented. + */ + public void writeMemberHeader(MemberDoc member, boolean isFirst); + + /** + * Write the signature for the given member. + * + * @param member the member being documented. + */ + public void writeSignature(MemberDoc member); + + /** + * Write the deprecated output for the given member. + * + * @param member the member being documented. + */ + public void writeDeprecated(MemberDoc member); + + /** + * Write the comments for the given member. + * + * @param member the member being documented. + */ + public void writeComments(MemberDoc member); + + /** + * Write the tag output for the given member. + * + * @param member the member being documented. + */ + public void writeTags(MemberDoc member); + + /** + * Write the member footer. + */ + public void writeMemberFooter(); + + /** + * Write the footer for the member documentation. + * + * @param classDoc the class that the member belong to. + */ + public void writeFooter(ClassDoc classDoc); + + /** + * Close the writer. + */ + public void close() throws IOException; +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeWriter.java new file mode 100644 index 00000000000..3386ae1c490 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeWriter.java @@ -0,0 +1,95 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + + +package com.sun.tools.doclets.internal.toolkit; + +import java.io.*; +import com.sun.javadoc.*; + +/** + * The interface for writing annotation type output. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API. + * + * @author Jamie Ho + * @since 1.5 + */ + +public interface AnnotationTypeWriter { + + /** + * Write the header of the page. + * @param header the header to write. + */ + public void writeHeader(String header); + + /** + * Write the signature of the current annotation type. + * + * @param modifiers the modifiers for the signature. + */ + public void writeAnnotationTypeSignature(String modifiers); + + /** + * Build the annotation type description. + */ + public void writeAnnotationTypeDescription(); + + /** + * Write the tag information for the current annotation type. + */ + public void writeAnnotationTypeTagInfo(); + + /** + * If this annotation type is deprecated, write the appropriate information. + */ + public void writeAnnotationTypeDeprecationInfo(); + + /** + * Write the footer of the page. + */ + public void writeFooter(); + + /** + * Close the writer. + */ + public void close() throws IOException; + + /** + * Return the {@link AnnotationTypeDoc} being documented. + * + * @return the AnnotationTypeDoc being documented. + */ + public AnnotationTypeDoc getAnnotationTypeDoc(); + + /** + * Perform any operations that are necessary when the member summary + * finished building. + */ + public void completeMemberSummaryBuild(); +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java new file mode 100644 index 00000000000..4ac86af0a49 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java @@ -0,0 +1,137 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + + +package com.sun.tools.doclets.internal.toolkit; + +import java.io.*; +import com.sun.javadoc.*; + +/** + * The interface for writing class output. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ + +public interface ClassWriter { + + /** + * Write the header of the page. + * @param header the header to write. + */ + public void writeHeader(String header); + + /** + * Write the class tree documentation. + */ + public void writeClassTree(); + + /** + * Write all implemented interfaces if this is a class. + */ + public void writeImplementedInterfacesInfo(); + + /** + * Write all super interfaces if this is an interface. + */ + public void writeSuperInterfacesInfo(); + + /** + * Write the type parameter information. + */ + public void writeTypeParamInfo(); + + /** + * Write all the classes that extend this one. + */ + public void writeSubClassInfo(); + + /** + * Write all the interfaces that extend this one. + */ + public void writeSubInterfacesInfo(); + + /** + * If this is an interface, write all classes that implement this + * interface. + */ + public void writeInterfaceUsageInfo (); + + /** + * If this is an inner class or interface, write the enclosing class or + * interface. + */ + public void writeNestedClassInfo (); + + /** + * If this class is deprecated, write the appropriate information. + */ + public void writeClassDeprecationInfo (); + + /** + * Write the signature of the current class. + * + * @param modifiers the modifiers for the signature. + */ + public void writeClassSignature(String modifiers); + + /** + * Build the class description. + */ + public void writeClassDescription(); + + /** + * Write the tag information for the current class. + */ + public void writeClassTagInfo(); + + /** + * Write the footer of the page. + */ + public void writeFooter(); + + /** + * Close the writer. + */ + public void close() throws IOException; + + /** + * Return the classDoc being documented. + * + * @return the classDoc being documented. + */ + public ClassDoc getClassDoc(); + + /** + * Perform any operations that are necessary when the member summary + * finished building. + */ + public void completeMemberSummaryBuild(); +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java new file mode 100644 index 00000000000..794c5c6d044 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/Configuration.java @@ -0,0 +1,716 @@ +/* + * Copyright 1997-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit; + +import com.sun.tools.doclets.internal.toolkit.taglets.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.builders.BuilderFactory; +import com.sun.javadoc.*; +import java.util.*; +import java.io.*; + +/** + * Configure the output based on the options. Doclets should sub-class + * Configuration, to configure and add their own options. This class contains + * all user options which are supported by the 1.1 doclet and the standard + * doclet. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Robert Field. + * @author Atul Dambalkar. + * @author Jamie Ho + */ +public abstract class Configuration { + + /** + * The factory for builders. + */ + protected BuilderFactory builderFactory; + + /** + * The taglet manager. + */ + public TagletManager tagletManager; + + /** + * The path to the builder XML input file. + */ + public String builderXMLPath; + + /** + * The default path to the builder XML. + */ + private static final String DEFAULT_BUILDER_XML = "resources/doclet.xml"; + + /** + * The path to Taglets + */ + public String tagletpath = ""; + + /** + * This is true if option "-serialwarn" is used. Defualt value is false to + * supress excessive warnings about serial tag. + */ + public boolean serialwarn = false; + + /** + * The specified amount of space between tab stops. + */ + public int sourcetab = DocletConstants.DEFAULT_TAB_STOP_LENGTH; + + /** + * True if we should generate browsable sources. + */ + public boolean linksource = false; + + /** + * True if command line option "-nosince" is used. Default value is + * false. + */ + public boolean nosince = false; + + /** + * True if we should recursively copy the doc-file subdirectories + */ + public boolean copydocfilesubdirs = false; + + /** + * The META charset tag used for cross-platform viewing. + */ + public String charset = ""; + + /** + * True if user wants to add member names as meta keywords. + * Set to false because meta keywords are ignored in general + * by most Internet search engines. + */ + public boolean keywords = false; + + /** + * The meta tag keywords sole-instance. + */ + public final MetaKeywords metakeywords = MetaKeywords.getInstance(this); + + /** + * The list of doc-file subdirectories to exclude + */ + protected Set excludedDocFileDirs; + + /** + * The list of qualifiers to exclude + */ + protected Set excludedQualifiers; + + /** + * The Root of the generated Program Structure from the Doclet API. + */ + public RootDoc root; + + /** + * Destination directory name, in which doclet will generate the entire + * documentation. Default is current directory. + */ + public String destDirName = ""; + + /** + * Destination directory name, in which doclet will copy the doc-files to. + */ + public String docFileDestDirName = ""; + + /** + * Encoding for this document. Default is default encoding for this + * platform. + */ + public String docencoding = null; + + /** + * True if user wants to suppress descriptions and tags. + */ + public boolean nocomment = false; + + /** + * Encoding for this document. Default is default encoding for this + * platform. + */ + public String encoding = null; + + /** + * Generate author specific information for all the classes if @author + * tag is used in the doc comment and if -author option is used. + * showauthor is set to true if -author option is used. + * Default is don't show author information. + */ + public boolean showauthor = false; + + /** + * Generate version specific information for the all the classes + * if @version tag is used in the doc comment and if -version option is + * used. showversion is set to true if -version option is + * used.Default is don't show version information. + */ + public boolean showversion = false; + + /** + * Sourcepath from where to read the source files. Default is classpath. + * + */ + public String sourcepath = ""; + + /** + * Don't generate deprecated API information at all, if -nodeprecated + * option is used. nodepracted is set to true if + * -nodeprecated option is used. Default is generate deprected API + * information. + */ + public boolean nodeprecated = false; + + /** + * The catalog of classes specified on the command-line + */ + public ClassDocCatalog classDocCatalog; + + /** + * Message Retriever for the doclet, to retrieve message from the resource + * file for this Configuration, which is common for 1.1 and standard + * doclets. + * + * TODO: Make this private!!! + */ + public MessageRetriever message = null; + + /** + * True if user wants to suppress time stamp in output. + * Default is false. + */ + public boolean notimestamp= false; + + /** + * The package grouping sole-instance. + */ + public final Group group = Group.getInstance(this); + + /** + * The tracker of external package links (sole-instance). + */ + public final Extern extern = new Extern(this); + + /** + * Return the build date for the doclet. + */ + public abstract String getDocletSpecificBuildDate(); + + /** + * This method should be defined in all those doclets(configurations), + * which want to derive themselves from this Configuration. This method + * can be used to set its own command line options. + * + * @param options The array of option names and values. + * @throws DocletAbortException + */ + public abstract void setSpecificDocletOptions(String[][] options); + + /** + * Return the doclet specific {@link MessageRetriever} + * @return the doclet specific MessageRetriever. + */ + public abstract MessageRetriever getDocletSpecificMsg(); + + /** + * An array of the packages specified on the command-line merged + * with the array of packages that contain the classes specified on the + * command-line. The array is sorted. + */ + public PackageDoc[] packages; + + /** + * Constructor. Constructs the message retriever with resource file. + */ + public Configuration() { + message = + new MessageRetriever(this, + "com.sun.tools.doclets.internal.toolkit.resources.doclets"); + excludedDocFileDirs = new HashSet(); + excludedQualifiers = new HashSet(); + } + + /** + * Return the builder factory for this doclet. + * + * @return the builder factory for this doclet. + */ + public BuilderFactory getBuilderFactory() { + if (builderFactory == null) { + builderFactory = new BuilderFactory(this); + } + return builderFactory; + } + + /** + * This method should be defined in all those doclets + * which want to inherit from this Configuration. This method + * should return the number of arguments to the command line + * option (including the option name). For example, + * -notimestamp is a single-argument option, so this method would + * return 1. + * + * @param option Command line option under consideration. + * @return number of arguments to option (including the + * option name). Zero return means option not known. + * Negative value means error occurred. + */ + public int optionLength(String option) { + option = option.toLowerCase(); + if (option.equals("-author") || + option.equals("-docfilessubdirs") || + option.equals("-keywords") || + option.equals("-linksource") || + option.equals("-nocomment") || + option.equals("-nodeprecated") || + option.equals("-nosince") || + option.equals("-notimestamp") || + option.equals("-quiet") || + option.equals("-xnodate") || + option.equals("-version")) { + return 1; + } else if (option.equals("-d") || + option.equals("-docencoding") || + option.equals("-encoding") || + option.equals("-excludedocfilessubdir") || + option.equals("-link") || + option.equals("-sourcetab") || + option.equals("-noqualifier") || + option.equals("-output") || + option.equals("-sourcepath") || + option.equals("-tag") || + option.equals("-taglet") || + option.equals("-tagletpath")) { + return 2; + } else if (option.equals("-group") || + option.equals("-linkoffline")) { + return 3; + } else { + return -1; // indicate we don't know about it + } + } + + /** + * Perform error checking on the given options. + * + * @param options the given options to check. + * @param reporter the reporter used to report errors. + */ + public abstract boolean validOptions(String options[][], + DocErrorReporter reporter); + + private void initPackageArray() { + Set set = new HashSet(Arrays.asList(root.specifiedPackages())); + ClassDoc[] classes = root.specifiedClasses(); + for (int i = 0; i < classes.length; i++) { + set.add(classes[i].containingPackage()); + } + ArrayList results = new ArrayList(set); + Collections.sort(results); + packages = (PackageDoc[]) results.toArray(new PackageDoc[] {}); + } + + /** + * Set the command line options supported by this configuration. + * + * @param options the two dimensional array of options. + */ + public void setOptions(String[][] options) { + LinkedHashSet customTagStrs = new LinkedHashSet(); + for (int oi = 0; oi < options.length; ++oi) { + String[] os = options[oi]; + String opt = os[0].toLowerCase(); + if (opt.equals("-d")) { + destDirName = addTrailingFileSep(os[1]); + docFileDestDirName = destDirName; + } else if (opt.equals("-docfilessubdirs")) { + copydocfilesubdirs = true; + } else if (opt.equals("-docencoding")) { + docencoding = os[1]; + } else if (opt.equals("-encoding")) { + encoding = os[1]; + } else if (opt.equals("-author")) { + showauthor = true; + } else if (opt.equals("-version")) { + showversion = true; + } else if (opt.equals("-nodeprecated")) { + nodeprecated = true; + } else if (opt.equals("-sourcepath")) { + sourcepath = os[1]; + } else if (opt.equals("-classpath") && + sourcepath.length() == 0) { + sourcepath = os[1]; + } else if (opt.equals("-excludedocfilessubdir")) { + addToSet(excludedDocFileDirs, os[1]); + } else if (opt.equals("-noqualifier")) { + addToSet(excludedQualifiers, os[1]); + } else if (opt.equals("-linksource")) { + linksource = true; + } else if (opt.equals("-sourcetab")) { + linksource = true; + try { + sourcetab = Integer.parseInt(os[1]); + } catch (NumberFormatException e) { + //Set to -1 so that warning will be printed + //to indicate what is valid argument. + sourcetab = -1; + } + if (sourcetab <= 0) { + message.warning("doclet.sourcetab_warning"); + sourcetab = DocletConstants.DEFAULT_TAB_STOP_LENGTH; + } + } else if (opt.equals("-notimestamp")) { + notimestamp = true; + } else if (opt.equals("-nocomment")) { + nocomment = true; + } else if (opt.equals("-tag") || opt.equals("-taglet")) { + customTagStrs.add(os); + } else if (opt.equals("-tagletpath")) { + tagletpath = os[1]; + } else if (opt.equals("-keywords")) { + keywords = true; + } else if (opt.equals("-serialwarn")) { + serialwarn = true; + } else if (opt.equals("-group")) { + group.checkPackageGroups(os[1], os[2]); + } else if (opt.equals("-link")) { + String url = os[1]; + extern.url(url, url, root, false); + } else if (opt.equals("-linkoffline")) { + String url = os[1]; + String pkglisturl = os[2]; + extern.url(url, pkglisturl, root, true); + } + } + if (sourcepath.length() == 0) { + sourcepath = System.getProperty("env.class.path") == null ? "" : + System.getProperty("env.class.path"); + } + if (docencoding == null) { + docencoding = encoding; + } + + classDocCatalog = new ClassDocCatalog(root.specifiedClasses()); + initTagletManager(customTagStrs); + } + + /** + * Set the command line options supported by this configuration. + * + * @throws DocletAbortException + */ + public void setOptions() { + initPackageArray(); + setOptions(root.options()); + setSpecificDocletOptions(root.options()); + } + + + /** + * Initialize the taglet manager. The strings to initialize the simple custom tags should + * be in the following format: "[tag name]:[location str]:[heading]". + * @param customTagStrs the set two dimentional arrays of strings. These arrays contain + * either -tag or -taglet arguments. + */ + private void initTagletManager(Set customTagStrs) { + tagletManager = tagletManager == null ? + new TagletManager(nosince, showversion, showauthor, message) : + tagletManager; + String[] args; + for (Iterator it = customTagStrs.iterator(); it.hasNext(); ) { + args = (String[]) it.next(); + if (args[0].equals("-taglet")) { + tagletManager.addCustomTag(args[1], tagletpath); + continue; + } + String[] tokens = Util.tokenize(args[1], + TagletManager.SIMPLE_TAGLET_OPT_SEPERATOR, 3); + if (tokens.length == 1) { + String tagName = args[1]; + if (tagletManager.isKnownCustomTag(tagName)) { + //reorder a standard tag + tagletManager.addNewSimpleCustomTag(tagName, null, ""); + } else { + //Create a simple tag with the heading that has the same name as the tag. + StringBuffer heading = new StringBuffer(tagName + ":"); + heading.setCharAt(0, Character.toUpperCase(tagName.charAt(0))); + tagletManager.addNewSimpleCustomTag(tagName, heading.toString(), "a"); + } + } else if (tokens.length == 2) { + //Add simple taglet without heading, probably to excluding it in the output. + tagletManager.addNewSimpleCustomTag(tokens[0], tokens[1], ""); + } else if (tokens.length >= 3) { + tagletManager.addNewSimpleCustomTag(tokens[0], tokens[2], tokens[1]); + } else { + message.error("doclet.Error_invalid_custom_tag_argument", args[1]); + } + } + } + + private void addToSet(Set s, String str){ + StringTokenizer st = new StringTokenizer(str, ":"); + String current; + while(st.hasMoreTokens()){ + current = st.nextToken(); + s.add(current); + } + } + + /** + * Add a traliling file separator, if not found or strip off extra trailing + * file separators if any. + * + * @param path Path under consideration. + * @return String Properly constructed path string. + */ + String addTrailingFileSep(String path) { + String fs = System.getProperty("file.separator"); + String dblfs = fs + fs; + int indexDblfs; + while ((indexDblfs = path.indexOf(dblfs)) >= 0) { + path = path.substring(0, indexDblfs) + + path.substring(indexDblfs + fs.length()); + } + if (!path.endsWith(fs)) + path += fs; + return path; + } + + /** + * This checks for the validity of the options used by the user. + * This works exactly like + * {@link com.sun.javadoc.Doclet#validOptions(String[][], + * DocErrorReporter)}. This will validate the options which are shared + * by our doclets. For example, this method will flag an error using + * the DocErrorReporter if user has used "-nohelp" and "-helpfile" option + * together. + * + * @param options options used on the command line. + * @param reporter used to report errors. + * @return true if all the options are valid. + */ + public boolean generalValidOptions(String options[][], + DocErrorReporter reporter) { + boolean docencodingfound = false; + String encoding = ""; + for (int oi = 0; oi < options.length; oi++) { + String[] os = options[oi]; + String opt = os[0].toLowerCase(); + if (opt.equals("-d")) { + String destdirname = addTrailingFileSep(os[1]); + File destDir = new File(destdirname); + if (!destDir.exists()) { + //Create the output directory (in case it doesn't exist yet) + reporter.printNotice(getText("doclet.dest_dir_create", + destdirname)); + (new File(destdirname)).mkdirs(); + } else if (!destDir.isDirectory()) { + reporter.printError(getText( + "doclet.destination_directory_not_directory_0", + destDir.getPath())); + return false; + } else if (!destDir.canWrite()) { + reporter.printError(getText( + "doclet.destination_directory_not_writable_0", + destDir.getPath())); + return false; + } + } else if (opt.equals("-docencoding")) { + docencodingfound = true; + if (!checkOutputFileEncoding(os[1], reporter)) { + return false; + } + } else if (opt.equals("-encoding")) { + encoding = os[1]; + } + } + if (!docencodingfound && encoding.length() > 0) { + if (!checkOutputFileEncoding(encoding, reporter)) { + return false; + } + } + return true; + } + + /** + * Check the validity of the given Source or Output File encoding on this + * platform. + * + * @param docencoding output file encoding. + * @param reporter used to report errors. + */ + private boolean checkOutputFileEncoding(String docencoding, + DocErrorReporter reporter) { + OutputStream ost= new ByteArrayOutputStream(); + OutputStreamWriter osw = null; + try { + osw = new OutputStreamWriter(ost, docencoding); + } catch (UnsupportedEncodingException exc) { + reporter.printError(getText("doclet.Encoding_not_supported", + docencoding)); + return false; + } finally { + try { + if (osw != null) { + osw.close(); + } + } catch (IOException exc) { + } + } + return true; + } + + /** + * Return true if the given doc-file subdirectory should be excluded and + * false otherwise. + * @param docfilesubdir the doc-files subdirectory to check. + */ + public boolean shouldExcludeDocFileDir(String docfilesubdir){ + if (excludedDocFileDirs.contains(docfilesubdir)) { + return true; + } else { + return false; + } + } + + /** + * Return true if the given qualifier should be excluded and false otherwise. + * @param qualifier the qualifier to check. + */ + public boolean shouldExcludeQualifier(String qualifier){ + if (excludedQualifiers.contains("all") || + excludedQualifiers.contains(qualifier) || + excludedQualifiers.contains(qualifier + ".*")) { + return true; + } else { + int index = -1; + while ((index = qualifier.indexOf(".", index + 1)) != -1) { + if (excludedQualifiers.contains(qualifier.substring(0, index + 1) + "*")) { + return true; + } + } + return false; + } + } + + /** + * Return the qualified name of the ClassDoc if it's qualifier is not excluded. Otherwise, + * return the unqualified ClassDoc name. + * @param cd the ClassDoc to check. + */ + public String getClassName(ClassDoc cd) { + PackageDoc pd = cd.containingPackage(); + if (pd != null && shouldExcludeQualifier(cd.containingPackage().name())) { + return cd.name(); + } else { + return cd.qualifiedName(); + } + } + + public String getText(String key) { + try { + //Check the doclet specific properties file. + return getDocletSpecificMsg().getText(key); + } catch (Exception e) { + //Check the shared properties file. + return message.getText(key); + } + } + + public String getText(String key, String a1) { + try { + //Check the doclet specific properties file. + return getDocletSpecificMsg().getText(key, a1); + } catch (Exception e) { + //Check the shared properties file. + return message.getText(key, a1); + } + } + + public String getText(String key, String a1, String a2) { + try { + //Check the doclet specific properties file. + return getDocletSpecificMsg().getText(key, a1, a2); + } catch (Exception e) { + //Check the shared properties file. + return message.getText(key, a1, a2); + } + } + + public String getText(String key, String a1, String a2, String a3) { + try { + //Check the doclet specific properties file. + return getDocletSpecificMsg().getText(key, a1, a2, a3); + } catch (Exception e) { + //Check the shared properties file. + return message.getText(key, a1, a2, a3); + } + } + + /** + * Return true if the doc element is getting documented, depending upon + * -nodeprecated option and @deprecated tag used. Return true if + * -nodeprecated is not used or @deprecated tag is not used. + */ + public boolean isGeneratedDoc(Doc doc) { + if (!nodeprecated) { + return true; + } + return (doc.tags("deprecated")).length == 0; + } + + /** + * Return the doclet specific instance of a writer factory. + * @return the {@link WriterFactory} for the doclet. + */ + public abstract WriterFactory getWriterFactory(); + + /** + * Return the input stream to the builder XML. + * + * @return the input steam to the builder XML. + * @throws FileNotFoundException when the given XML file cannot be found. + */ + public InputStream getBuilderXML() throws FileNotFoundException { + return builderXMLPath == null ? + Configuration.class.getResourceAsStream(DEFAULT_BUILDER_XML) : + new FileInputStream(new File(builderXMLPath)); + } + + /** + * Return the comparator that will be used to sort member documentation. + * To no do any sorting, return null. + * + * @return the {@link java.util.Comparator} used to sort members. + */ + public abstract Comparator getMemberComparator(); +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java new file mode 100644 index 00000000000..c7c944e369f --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java @@ -0,0 +1,114 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit; + +import com.sun.javadoc.*; +import java.util.*; +import java.io.*; + +/** + * The interface for writing constants summary output. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ + +public interface ConstantsSummaryWriter { + + /** + * Write the header for the summary. + */ + public abstract void writeHeader(); + + /** + * Write the footer for the summary. + */ + public abstract void writeFooter(); + + /** + * Close the writer. + */ + public abstract void close() throws IOException; + + /** + * Write the header for the index. + */ + public abstract void writeContentsHeader(); + + /** + * Write the footer for the index. + */ + public abstract void writeContentsFooter(); + + /** + * Add the given package name to the index. + * @param pkg the {@link PackageDoc} to index. + * @param parsedPackageName the parsed package name. We only Write the + * first 2 directory levels of the package + * name. For example, java.lang.ref would be + * indexed as java.lang.*. + * @param WriteedPackageHeaders the set of package headers that have already + * been indexed. We don't want to index + * something more than once. + */ + public abstract void writeLinkToPackageContent(PackageDoc pkg, String parsedPackageName, + Set WriteedPackageHeaders); + + /** + * Write the given package name. + * @param pkg the {@link PackageDoc} to index. + * @param parsedPackageName the parsed package name. We only Write the + * first 2 directory levels of the package + * name. For example, java.lang.ref would be + * indexed as java.lang.*. + */ + public abstract void writePackageName(PackageDoc pkg, + String parsedPackageName); + + /** + * Write the heading for the current table of constants for a given class. + * @param cd the class whose constants are being documented. + */ + public abstract void writeConstantMembersHeader(ClassDoc cd); + + /** + * Document the given constants. + * @param cd the class whose constants are being documented. + * @param fields the constants being documented. + */ + public abstract void writeConstantMembers(ClassDoc cd, List fields); + + /** + * Document the given constants. + * @param cd the class whose constants are being documented. + */ + public abstract void writeConstantMembersFooter(ClassDoc cd); + +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstructorWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstructorWriter.java new file mode 100644 index 00000000000..5a633e188a1 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/ConstructorWriter.java @@ -0,0 +1,112 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit; + +import java.io.*; +import com.sun.javadoc.*; + +/** + * The interface for writing constructor output. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ + +public interface ConstructorWriter { + + /** + * Write the header for the constructor documentation. + * + * @param classDoc the class that the constructors belong to. + * @param header the header to write. + */ + public void writeHeader(ClassDoc classDoc, String header); + + /** + * Write the constructor header for the given constructor. + * + * @param constructor the constructor being documented. + * @param isFirst the flag to indicate whether or not the constructor is the + * first to be documented. + */ + public void writeConstructorHeader(ConstructorDoc constructor, boolean isFirst); + + /** + * Write the signature for the given constructor. + * + * @param constructor the constructor being documented. + */ + public void writeSignature(ConstructorDoc constructor); + + /** + * Write the deprecated output for the given constructor. + * + * @param constructor the constructor being documented. + */ + public void writeDeprecated(ConstructorDoc constructor); + + /** + * Write the comments for the given constructor. + * + * @param constructor the constructor being documented. + */ + public void writeComments(ConstructorDoc constructor); + + /** + * Write the tag output for the given constructor. + * + * @param constructor the constructor being documented. + */ + public void writeTags(ConstructorDoc constructor); + + /** + * Write the constructor footer. + */ + public void writeConstructorFooter(); + + /** + * Write the footer for the constructor documentation. + * + * @param classDoc the class that the constructors belong to. + */ + public void writeFooter(ClassDoc classDoc); + + /** + * Let the writer know whether a non public constructor was found. + * + * @param foundNonPubConstructor true if we found a non public constructor. + */ + public void setFoundNonPubConstructor(boolean foundNonPubConstructor); + + /** + * Close the writer. + */ + public void close() throws IOException; +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/EnumConstantWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/EnumConstantWriter.java new file mode 100644 index 00000000000..f851e06a26d --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/EnumConstantWriter.java @@ -0,0 +1,105 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit; + +import java.io.*; +import com.sun.javadoc.*; + +/** + * The interface for writing enum constant output. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ + +public interface EnumConstantWriter { + + /** + * Write the header for the enum constant documentation. + * + * @param classDoc the class that the enum constants belong to. + * @param header the header to write. + */ + public void writeHeader(ClassDoc classDoc, String header); + + /** + * Write the enum constant header for the given enum constant. + * + * @param enumConstant the enum constant being documented. + * @param isFirst the flag to indicate whether or not the enum constant is + * the first to be documented. + */ + public void writeEnumConstantHeader(FieldDoc enumConstant, boolean isFirst); + + /** + * Write the signature for the given enum constant. + * + * @param enumConstant the enum constant being documented. + */ + public void writeSignature(FieldDoc enumConstant); + + /** + * Write the deprecated output for the given enum constant. + * + * @param enumConstant the enum constant being documented. + */ + public void writeDeprecated(FieldDoc enumConstant); + + /** + * Write the comments for the given enum constant. + * + * @param enumConstant the enum constant being documented. + */ + public void writeComments(FieldDoc enumConstant); + + /** + * Write the tag output for the given enum constant. + * + * @param enumConstant the enum constant being documented. + */ + public void writeTags(FieldDoc enumConstant); + + /** + * Write the enum constant footer. + */ + public void writeEnumConstantFooter(); + + /** + * Write the footer for the enum constant documentation. + * + * @param classDoc the class that the enum constant belong to. + */ + public void writeFooter(ClassDoc classDoc); + + /** + * Close the writer. + */ + public void close() throws IOException; +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/FieldWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/FieldWriter.java new file mode 100644 index 00000000000..e1d09b68991 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/FieldWriter.java @@ -0,0 +1,105 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit; + +import java.io.*; +import com.sun.javadoc.*; + +/** + * The interface for writing field output. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ + +public interface FieldWriter { + + /** + * Write the header for the field documentation. + * + * @param classDoc the class that the fields belong to. + * @param header the header to write. + */ + public void writeHeader(ClassDoc classDoc, String header); + + /** + * Write the field header for the given field. + * + * @param field the field being documented. + * @param isFirst the flag to indicate whether or not the field is the + * first to be documented. + */ + public void writeFieldHeader(FieldDoc field, boolean isFirst); + + /** + * Write the signature for the given field. + * + * @param field the field being documented. + */ + public void writeSignature(FieldDoc field); + + /** + * Write the deprecated output for the given field. + * + * @param field the field being documented. + */ + public void writeDeprecated(FieldDoc field); + + /** + * Write the comments for the given field. + * + * @param field the field being documented. + */ + public void writeComments(FieldDoc field); + + /** + * Write the tag output for the given field. + * + * @param field the field being documented. + */ + public void writeTags(FieldDoc field); + + /** + * Write the field footer. + */ + public void writeFieldFooter(); + + /** + * Write the footer for the field documentation. + * + * @param classDoc the class that the fields belong to. + */ + public void writeFooter(ClassDoc classDoc); + + /** + * Close the writer. + */ + public void close() throws IOException; +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/MemberSummaryWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/MemberSummaryWriter.java new file mode 100644 index 00000000000..6a54783d72d --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/MemberSummaryWriter.java @@ -0,0 +1,99 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit; + +import java.io.*; +import com.sun.javadoc.*; + +/** + * The interface for writing member summary output. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ + +public interface MemberSummaryWriter { + + /** + * Write the member summary header for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeMemberSummaryHeader(ClassDoc classDoc); + + /** + * Write the member summary for the given class and member. + * + * @param classDoc the class the summary belongs to. + * @param member the member that I am summarizing. + * @param firstSentenceTags the tags for the sentence being documented. + * @param isFirst true if this is the first member in the list. + * @param isLast true if this the last member being documented. + */ + public void writeMemberSummary(ClassDoc classDoc, ProgramElementDoc member, + Tag[] firstSentenceTags, boolean isFirst, boolean isLast); + + /** + * Write the member summary footer for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeMemberSummaryFooter(ClassDoc classDoc); + + /** + * Write the inherited member summary header for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeInheritedMemberSummaryHeader(ClassDoc classDoc); + + /** + * Write the inherited member summary for the given class and member. + * + * @param classDoc the class the inherited member belongs to. + * @param member the inherited member that I am summarizing. + * @param isFirst true if this is the first member in the list. + * @param isLast true if this is the last member in the list. + */ + public void writeInheritedMemberSummary(ClassDoc classDoc, + ProgramElementDoc member, boolean isFirst, boolean isLast); + + /** + * Write the inherited member summary footer for the given class. + * + * @param classDoc the class the summary belongs to. + */ + public void writeInheritedMemberSummaryFooter(ClassDoc classDoc); + + /** + * Close the writer. + */ + public void close() throws IOException; +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/MethodWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/MethodWriter.java new file mode 100644 index 00000000000..fc39d76acec --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/MethodWriter.java @@ -0,0 +1,106 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit; + +import java.io.*; +import com.sun.javadoc.*; + +/** + * The interface for writing method output. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ + +public interface MethodWriter { + + /** + * Write the header for the method documentation. + * + * @param classDoc the class that the methods belong to. + * @param header the header to write. + */ + public void writeHeader(ClassDoc classDoc, String header); + + /** + * Write the method header for the given method. + * + * @param method the method being documented. + * @param isFirst the flag to indicate whether or not the method is the + * first to be documented. + */ + public void writeMethodHeader(MethodDoc method, boolean isFirst); + + /** + * Write the signature for the given method. + * + * @param method the method being documented. + */ + public void writeSignature(MethodDoc method); + + /** + * Write the deprecated output for the given method. + * + * @param method the method being documented. + */ + public void writeDeprecated(MethodDoc method); + + /** + * Write the comments for the given method. + * + * @param holder the holder type (not erasure) of the method. + * @param method the method being documented. + */ + public void writeComments(Type holder, MethodDoc method); + + /** + * Write the tag output for the given method. + * + * @param method the method being documented. + */ + public void writeTags(MethodDoc method); + + /** + * Write the method footer. + */ + public void writeMethodFooter(); + + /** + * Write the footer for the method documentation. + * + * @param classDoc the class that the methods belong to. + */ + public void writeFooter(ClassDoc classDoc); + + /** + * Close the writer. + */ + public void close() throws IOException; +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/NestedClassWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/NestedClassWriter.java new file mode 100644 index 00000000000..76a1c0672e3 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/NestedClassWriter.java @@ -0,0 +1,95 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit; + +import java.io.*; +import com.sun.javadoc.*; + +/** + * The interface for writing class output. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ + +public interface NestedClassWriter { + + /** + * Write the classes summary header for the given class. + * + * @param nestedClass the class the summary belongs to. + */ + public void writeNestedClassSummaryHeader(ClassDoc nestedClass); + + /** + * Write the class summary for the given class and class. + * + * @param classDoc the class the summary belongs to. + * @param nestedClass the nested class that I am summarizing. + */ + public void writeNestedClassSummary(ClassDoc classDoc, ClassDoc nestedClass); + + /** + * Write the classes summary footer for the given class. + * + * @param nestedClass the class the summary belongs to. + */ + public void writeNestedClassSummaryFooter(ClassDoc nestedClass); + + /** + * Write the inherited classes summary header for the given class. + * + * @param nestedClass the class the summary belongs to. + */ + public void writeInheritedNestedClassSummaryHeader(ClassDoc nestedClass); + + /** + * Write the inherited nested class summary for the given class and nested + * class. + * + * @param classDoc the class the inherited nested class belongs to. + * @param nestedClass the inherited nested class that I am summarizing. + * @param isFirst true if this is the first member in the list. + */ + public void writeInheritedNestedClassSummary(ClassDoc classDoc, + ClassDoc nestedClass, boolean isFirst); + + /** + * Write the inherited classes summary footer for the given class. + * + * @param nestedClass the class the summary belongs to. + */ + public void writeInheritedNestedClassSummaryFooter(ClassDoc nestedClass); + + /** + * Close the writer. + */ + public void close() throws IOException; +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/PackageSummaryWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/PackageSummaryWriter.java new file mode 100644 index 00000000000..eb86fbea2d9 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/PackageSummaryWriter.java @@ -0,0 +1,97 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit; + +import com.sun.javadoc.*; +import java.io.*; + +/** + * The interface for writing package summary output. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ + +public interface PackageSummaryWriter { + + /** + * Return the name of the output file. + * + * @return the name of the output file. + */ + public abstract String getOutputFileName(); + + /** + * Write the header for the package summary. + */ + public abstract void writeSummaryHeader(); + + /** + * Write the footer for the package summary. + */ + public abstract void writeSummaryFooter(); + + /** + * Write the table of classes in this package. + * + * @param classes the array of classes to document. + * @param label the label for this table. + */ + public abstract void writeClassesSummary(ClassDoc[] classes, String label); + + /** + * Write the header for the summary. + * + * @param heading Package name. + */ + public abstract void writePackageHeader(String heading); + + /** + * Print the package description from the "packages.html" file. + */ + public abstract void writePackageDescription(); + + /** + * Print the tag information from the "packages.html" file. + */ + public abstract void writePackageTags(); + + /** + * Write the footer for the summary. + * + */ + public abstract void writePackageFooter(); + + /** + * Close the writer. + */ + public abstract void close() throws IOException; + +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java new file mode 100644 index 00000000000..06fbb613365 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java @@ -0,0 +1,205 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit; + +import com.sun.javadoc.*; +import java.io.*; + +/** + * The interface for writing serialized form output. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ + +public interface SerializedFormWriter { + + /** + * Write the given header. + * + * @param header the header to write. + */ + public void writeHeader(String header); + + /** + * Write the given package header. + * + * @param packageName the package header to write. + */ + public void writePackageHeader(String packageName); + + /** + * Write the heading for the serializable class. + * + * @param classDoc the class being processed. + */ + public void writeClassHeader(ClassDoc classDoc); + + /** + * Write the serial UID info. + * + * @param header the header that will show up before the UID. + * @param serialUID the serial UID to print. + */ + public void writeSerialUIDInfo(String header, String serialUID); + + /** + * Return an instance of a SerialFieldWriter. + * + * @return an instance of a SerialFieldWriter. + */ + public SerialFieldWriter getSerialFieldWriter(ClassDoc classDoc); + + /** + * Return an instance of a SerialMethodWriter. + * + * @return an instance of a SerialMethodWriter. + */ + public SerialMethodWriter getSerialMethodWriter(ClassDoc classDoc); + + /** + * Close the writer. + */ + public abstract void close() throws IOException; + + /** + * Write the footer. + */ + public void writeFooter(); + + /** + * Write the serialized form for a given field. + */ + public interface SerialFieldWriter { + + /** + * Write the given heading. + * + * @param heading the heading to write. + */ + public void writeHeader(String heading); + + /** + * Write the deprecated information for this member. + * + * @param field the field to document. + */ + public void writeMemberDeprecatedInfo(FieldDoc field); + + /** + * Write the description text for this member. + * + * @param field the field to document. + */ + public void writeMemberDescription(FieldDoc field); + + /** + * Write the description text for this member represented by the tag. + * + * @param serialFieldTag the field to document (represented by tag). + */ + public void writeMemberDescription(SerialFieldTag serialFieldTag); + + /** + * Write the tag information for this member. + * + * @param field the field to document. + */ + public void writeMemberTags(FieldDoc field); + + /** + * Write the member header. + * + * @param fieldType the type of the field. + * @param fieldTypeStr the type of the field in string format. We will + * print this out if we can't link to the type. + * @param fieldDimensions the dimensions of the field. + * @param fieldName the name of the field. + */ + public void writeMemberHeader(ClassDoc fieldType, String fieldTypeStr, + String fieldDimensions, String fieldName); + + /** + * Write the footer. + * + * @param member the member to write the header for. + */ + public void writeMemberFooter(FieldDoc member); + } + + /** + * Write the serialized form for a given field. + */ + public interface SerialMethodWriter { + + /** + * Write the given heading. + * + * @param heading the heading to write. + */ + public void writeHeader(String heading); + + /** + * Write a warning that no serializable methods exist. + * + * @param msg the warning to print. + */ + public void writeNoCustomizationMsg(String msg); + + /** + * Write the header. + * + * @param member the member to write the header for. + */ + public void writeMemberHeader(MethodDoc member); + + /** + * Write the footer. + * + * @param member the member to write the header for. + */ + public void writeMemberFooter(MethodDoc member); + + /** + * Write the deprecated information for this member. + */ + public void writeDeprecatedMemberInfo(MethodDoc member); + + /** + * Write the description for this member. + */ + public void writeMemberDescription(MethodDoc member); + + /** + * Write the tag information for this member. + */ + public void writeMemberTags(MethodDoc member); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/WriterFactory.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/WriterFactory.java new file mode 100644 index 00000000000..a5d30c8e6cd --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/WriterFactory.java @@ -0,0 +1,198 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.javadoc.*; + +/** + * The interface for a factory creates writers. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.4 + */ + +public interface WriterFactory { + + /** + * Return the writer for the constant summary. + * + * @return the writer for the constant summary. Return null if this + * writer is not supported by the doclet. + */ + public abstract ConstantsSummaryWriter getConstantsSummaryWriter() + throws Exception; + + /** + * Return the writer for the package summary. + * + * @param packageDoc the package being documented. + * @param prevPkg the previous package that was documented. + * @param nextPkg the next package being documented. + * @return the writer for the package summary. Return null if this + * writer is not supported by the doclet. + */ + public abstract PackageSummaryWriter getPackageSummaryWriter(PackageDoc + packageDoc, PackageDoc prevPkg, PackageDoc nextPkg) + throws Exception; + + /** + * Return the writer for a class. + * + * @param classDoc the class being documented. + * @param prevClass the previous class that was documented. + * @param nextClass the next class being documented. + * @param classTree the class tree. + * @return the writer for the class. Return null if this + * writer is not supported by the doclet. + */ + public abstract ClassWriter getClassWriter(ClassDoc classDoc, + ClassDoc prevClass, ClassDoc nextClass, ClassTree classTree) + throws Exception; + + /** + * Return the writer for an annotation type. + * + * @param annotationType the type being documented. + * @param prevType the previous type that was documented. + * @param nextType the next type being documented. + * @return the writer for the annotation type. Return null if this + * writer is not supported by the doclet. + */ + public abstract AnnotationTypeWriter getAnnotationTypeWriter( + AnnotationTypeDoc annotationType, Type prevType, Type nextType) + throws Exception; + + /** + * Return the method writer for a given class. + * + * @param classWriter the writer for the class being documented. + * @return the method writer for the give class. Return null if this + * writer is not supported by the doclet. + */ + public abstract MethodWriter getMethodWriter(ClassWriter classWriter) + throws Exception; + + /** + * Return the annotation type optional member writer for a given annotation + * type. + * + * @param annotationTypeWriter the writer for the annotation type + * being documented. + * @return the member writer for the given annotation type. Return null if + * this writer is not supported by the doclet. + */ + public abstract AnnotationTypeOptionalMemberWriter + getAnnotationTypeOptionalMemberWriter( + AnnotationTypeWriter annotationTypeWriter) throws Exception; + + /** + * Return the annotation type required member writer for a given annotation type. + * + * @param annotationTypeWriter the writer for the annotation type + * being documented. + * @return the member writer for the given annotation type. Return null if + * this writer is not supported by the doclet. + */ + public abstract AnnotationTypeRequiredMemberWriter + getAnnotationTypeRequiredMemberWriter( + AnnotationTypeWriter annotationTypeWriter) throws Exception; + + /** + * Return the enum constant writer for a given class. + * + * @param classWriter the writer for the class being documented. + * @return the enum constant writer for the give class. Return null if this + * writer is not supported by the doclet. + */ + public abstract EnumConstantWriter getEnumConstantWriter( + ClassWriter classWriter) throws Exception; + + /** + * Return the field writer for a given class. + * + * @param classWriter the writer for the class being documented. + * @return the field writer for the give class. Return null if this + * writer is not supported by the doclet. + */ + public abstract FieldWriter getFieldWriter(ClassWriter classWriter) + throws Exception; + + /** + * Return the constructor writer for a given class. + * + * @param classWriter the writer for the class being documented. + * @return the method writer for the give class. Return null if this + * writer is not supported by the doclet. + */ + public abstract ConstructorWriter getConstructorWriter( + ClassWriter classWriter) + throws Exception; + + /** + * Return the specified member summary writer for a given class. + * + * @param classWriter the writer for the class being documented. + * @param memberType the {@link VisibleMemberMap} member type indicating + * the type of member summary that should be returned. + * @return the summary writer for the give class. Return null if this + * writer is not supported by the doclet. + * + * @see VisibleMemberMap + * @throws IllegalArgumentException if memberType is unknown. + */ + public abstract MemberSummaryWriter getMemberSummaryWriter( + ClassWriter classWriter, int memberType) + throws Exception; + + /** + * Return the specified member summary writer for a given annotation type. + * + * @param annotationTypeWriter the writer for the annotation type being + * documented. + * @param memberType the {@link VisibleMemberMap} member type indicating + * the type of member summary that should be returned. + * @return the summary writer for the give class. Return null if this + * writer is not supported by the doclet. + * + * @see VisibleMemberMap + * @throws IllegalArgumentException if memberType is unknown. + */ + public abstract MemberSummaryWriter getMemberSummaryWriter( + AnnotationTypeWriter annotationTypeWriter, int memberType) + throws Exception; + + /** + * Return the writer for the serialized form. + * + * @return the writer for the serialized form. + */ + public SerializedFormWriter getSerializedFormWriter() throws Exception; +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java new file mode 100644 index 00000000000..0776f408946 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractBuilder.java @@ -0,0 +1,144 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit.builders; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import java.io.*; +import java.lang.reflect.*; +import java.util.*; + +/** + * The superclass for all builders. A builder is a class that provides + * the structure and content of API documentation. A builder is completely + * doclet independent which means that any doclet can use builders to + * construct documentation, as long as it impelements the appropriate + * writer interfaces. For example, if a doclet wanted to use + * {@link ConstantsSummaryBuilder} to build a constant summary, all it has to + * do is implement the ConstantsSummaryWriter interface and pass it to the + * builder using a WriterFactory. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ + +public abstract class AbstractBuilder { + + /** + * The configuration used in this run of the doclet. + */ + protected Configuration configuration; + + /** + * Keep track of which packages we have seen for + * efficiency purposes. We don't want to copy the + * doc files multiple times for a single package. + */ + protected static Set containingPackagesSeen; + + /** + * True if we want to print debug output. + */ + protected static final boolean DEBUG = false; + + /** + * Construct a Builder. + * @param configuration the configuration used in this run + * of the doclet. + */ + public AbstractBuilder(Configuration configuration) { + this.configuration = configuration; + } + + /** + * Return the name of this builder. + * + * @return the name of the builder. + */ + public abstract String getName(); + + /** + * Build the documentation. + * + * @throws IOException there was a problem writing the output. + */ + public abstract void build() throws IOException; + + /** + * Build the documentation, as specified by the given XML elements. + * + * @param elements the XML elements that specify which components to + * document. + */ + protected void build(List elements) { + for (int i = 0; i < elements.size(); i++ ) { + Object element = elements.get(i); + String component = (String) + ((element instanceof String) ? + element : + ((List) element).get(0)); + try { + invokeMethod("build" + component, + element instanceof String ? + new Class[] {} : + new Class[] {List.class}, + element instanceof String ? + new Object[] {} : + new Object[] {((List) element).subList(1, + ((List) element).size())}); + } catch (NoSuchMethodException e) { + e.printStackTrace(); + configuration.root.printError("Unknown element: " + component); + throw new DocletAbortException(); + } catch (InvocationTargetException e) { + e.getCause().printStackTrace(); + } catch (Exception e) { + e.printStackTrace(); + configuration.root.printError("Exception " + + e.getClass().getName() + + " thrown while processing element: " + component); + throw new DocletAbortException(); + } + } + } + + /** + * Given the name and parameters, invoke the method in the builder. This + * method is required to invoke the appropriate build method as instructed + * by the builder XML file. + * + * @param methodName the name of the method that we would like to invoke. + * @param paramClasses the types for each parameter. + * @param params the parameters of the method. + */ + protected abstract void invokeMethod(String methodName, Class[] paramClasses, + Object[] params) + throws Exception; +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractMemberBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractMemberBuilder.java new file mode 100644 index 00000000000..f98a95c93d4 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AbstractMemberBuilder.java @@ -0,0 +1,84 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit.builders; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import java.util.*; + +/** + * The superclass for all member builders. Member builders are only executed + * within Class Builders. They essentially build sub-components. For example, + * method documentation is a sub-component of class documentation. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ +public abstract class AbstractMemberBuilder extends AbstractBuilder { + + /** + * Construct a SubBuilder. + * @param configuration the configuration used in this run + * of the doclet. + */ + public AbstractMemberBuilder(Configuration configuration) { + super(configuration); + } + + /** + * This method is not supported by sub-builders. + * + * @throws DocletAbortException this method will always throw a + * DocletAbortException because it is not supported. + */ + public void build() throws DocletAbortException { + //You may not call the build method in a subbuilder. + throw new DocletAbortException(); + } + + + /** + * Build the sub component if there is anything to document. + * + * @param elements {@inheritDoc} + */ + public void build(List elements) { + if (hasMembersToDocument()) { + super.build(elements); + } + } + + /** + * Return true if this subbuilder has anything to document. + * + * @return true if this subbuilder has anything to document. + */ + public abstract boolean hasMembersToDocument(); +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java new file mode 100644 index 00000000000..959428b938f --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java @@ -0,0 +1,237 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit.builders; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.javadoc.*; +import java.io.*; +import java.util.*; +import java.lang.reflect.*; + +/** + * Builds the summary for a given annotation type. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ +public class AnnotationTypeBuilder extends AbstractBuilder { + + /** + * The root element of the annotation type XML is {@value}. + */ + public static final String ROOT = "AnnotationTypeDoc"; + + /** + * The annotation type being documented. + */ + private AnnotationTypeDoc annotationTypeDoc; + + /** + * The doclet specific writer. + */ + private AnnotationTypeWriter writer; + + /** + * Construct a new ClassBuilder. + * + * @param configuration the current configuration of the + * doclet. + */ + private AnnotationTypeBuilder(Configuration configuration) { + super(configuration); + } + + /** + * Construct a new ClassBuilder. + * + * @param configuration the current configuration of the doclet. + * @param annotationTypeDoc the class being documented. + * @param writer the doclet specific writer. + */ + public static AnnotationTypeBuilder getInstance(Configuration configuration, + AnnotationTypeDoc annotationTypeDoc, AnnotationTypeWriter writer) + throws Exception { + AnnotationTypeBuilder builder = new AnnotationTypeBuilder(configuration); + builder.configuration = configuration; + builder.annotationTypeDoc = annotationTypeDoc; + builder.writer = writer; + if(containingPackagesSeen == null) { + containingPackagesSeen = new HashSet(); + } + return builder; + } + + /** + * {@inheritDoc} + */ + public void invokeMethod(String methodName, Class[] paramClasses, + Object[] params) + throws Exception { + if (DEBUG) { + configuration.root.printError("DEBUG: " + this.getClass().getName() + + "." + methodName); + } + Method method = this.getClass().getMethod(methodName, paramClasses); + method.invoke(this, params); + } + + /** + * {@inheritDoc} + */ + public void build() throws IOException { + build(LayoutParser.getInstance(configuration).parseXML(ROOT)); + } + + /** + * {@inheritDoc} + */ + public String getName() { + return ROOT; + } + + /** + * Handles the <AnnotationTypeDoc> tag. + * + * @param elements the XML elements that specify how to document a class. + */ + public void buildAnnotationTypeDoc(List elements) throws Exception { + build(elements); + writer.close(); + copyDocFiles(); + } + + + /** + * Copy the doc files for the current ClassDoc if necessary. + */ + private void copyDocFiles() { + PackageDoc containingPackage = annotationTypeDoc.containingPackage(); + if((configuration.packages == null || + Arrays.binarySearch(configuration.packages, + containingPackage) < 0) && + ! containingPackagesSeen.contains(containingPackage.name())){ + //Only copy doc files dir if the containing package is not + //documented AND if we have not documented a class from the same + //package already. Otherwise, we are making duplicate copies. + Util.copyDocFiles(configuration, + Util.getPackageSourcePath(configuration, + annotationTypeDoc.containingPackage()) + + DirectoryManager.getDirectoryPath( + annotationTypeDoc.containingPackage()) + + File.separator, DocletConstants.DOC_FILES_DIR_NAME, true); + containingPackagesSeen.add(containingPackage.name()); + } + } + + /** + * Build the header of the page. + */ + public void buildAnnotationTypeHeader() { + writer.writeHeader(configuration.getText("doclet.AnnotationType") + + " " + annotationTypeDoc.name()); + } + + /** + * If this class is deprecated, print the appropriate information. + */ + public void buildDeprecationInfo () { + writer.writeAnnotationTypeDeprecationInfo(); + } + + /** + * Build the signature of the current annotation type. + */ + public void buildAnnotationTypeSignature() { + StringBuffer modifiers = new StringBuffer( + annotationTypeDoc.modifiers() + " "); + writer.writeAnnotationTypeSignature( + Util.replaceText( + modifiers.toString(), "interface", "@interface")); + } + + /** + * Build the class description. + */ + public void buildAnnotationTypeDescription() { + writer.writeAnnotationTypeDescription(); + } + + /** + * Build the tag information for the current class. + */ + public void buildAnnotationTypeTagInfo() { + writer.writeAnnotationTypeTagInfo(); + } + + /** + * Build the contents of the page. + * + * @param elements the XML elements that specify how a member summary is + * documented. + */ + public void buildMemberSummary(List elements) throws Exception { + configuration.getBuilderFactory(). + getMemberSummaryBuilder(writer).build(elements); + writer.completeMemberSummaryBuild(); + } + + /** + * Build the annotation type optional member documentation. + * + * @param elements the XML elements that specify how a annotation type + * members are documented. + */ + public void buildAnnotationTypeOptionalMemberDetails(List elements) + throws Exception { + configuration.getBuilderFactory(). + getAnnotationTypeOptionalMemberBuilder(writer).build(elements); + } + + /** + * Build the annotation type required member documentation. + * + * @param elements the XML elements that specify how a annotation type + * members are documented. + */ + public void buildAnnotationTypeRequiredMemberDetails(List elements) + throws Exception { + configuration.getBuilderFactory(). + getAnnotationTypeRequiredMemberBuilder(writer).build(elements); + } + + + /** + * Build the footer of the page. + */ + public void buildAnnotationTypeFooter() { + writer.writeFooter(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java new file mode 100644 index 00000000000..747190897e6 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeOptionalMemberBuilder.java @@ -0,0 +1,136 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit.builders; + + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.javadoc.*; +import java.util.*; +import java.lang.reflect.*; + +/** + * Builds documentation for optional annotation type members. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ +public class AnnotationTypeOptionalMemberBuilder extends + AnnotationTypeRequiredMemberBuilder { + + + /** + * Construct a new AnnotationTypeMemberBuilder. + * + * @param configuration the current configuration of the + * doclet. + */ + private AnnotationTypeOptionalMemberBuilder(Configuration configuration) { + super(configuration); + } + + + /** + * Construct a new AnnotationTypeMemberBuilder. + * + * @param configuration the current configuration of the doclet. + * @param classDoc the class whoses members are being documented. + * @param writer the doclet specific writer. + */ + public static AnnotationTypeOptionalMemberBuilder getInstance( + Configuration configuration, ClassDoc classDoc, + AnnotationTypeOptionalMemberWriter writer) { + AnnotationTypeOptionalMemberBuilder builder = + new AnnotationTypeOptionalMemberBuilder(configuration); + builder.classDoc = classDoc; + builder.writer = writer; + builder.visibleMemberMap = new VisibleMemberMap(classDoc, + VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL, configuration.nodeprecated); + builder.members = new ArrayList( + builder.visibleMemberMap.getMembersFor(classDoc)); + if (configuration.getMemberComparator() != null) { + Collections.sort(builder.members, + configuration.getMemberComparator()); + } + return builder; + } + + /** + * {@inheritDoc} + */ + public String getName() { + return "AnnotationTypeOptionalMemberDetails"; + } + + /** + * Build the member documentation. + * + * @param elements the XML elements that specify how to construct this + * documentation. + */ + public void buildAnnotationTypeOptionalMember(List elements) { + if (writer == null) { + return; + } + for (currentMemberIndex = 0; currentMemberIndex < members.size(); + currentMemberIndex++) { + build(elements); + } + } + + /** + * {@inheritDoc} + */ + public void invokeMethod(String methodName, Class[] paramClasses, + Object[] params) + throws Exception { + if (DEBUG) { + configuration.root.printError("DEBUG: " + this.getClass().getName() + + "." + methodName); + } + Method method = this.getClass().getMethod(methodName, paramClasses); + method.invoke(this, params); + } + + /** + * Document the default value for this optional member. + */ + public void buildDefaultValueInfo() { + ((AnnotationTypeOptionalMemberWriter) writer).writeDefaultValueInfo( + (MemberDoc) members.get(currentMemberIndex)); + } + + /** + * {@inheritDoc} + */ + public AnnotationTypeRequiredMemberWriter getWriter() { + return writer; + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java new file mode 100644 index 00000000000..b92b8b42c5e --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java @@ -0,0 +1,245 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit.builders; + + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.javadoc.*; +import java.util.*; +import java.lang.reflect.*; + +/** + * Builds documentation for required annotation type members. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ +public class AnnotationTypeRequiredMemberBuilder extends AbstractMemberBuilder { + + /** + * The annotation type whose members are being documented. + */ + protected ClassDoc classDoc; + + /** + * The visible members for the given class. + */ + protected VisibleMemberMap visibleMemberMap; + + /** + * The writer to output the member documentation. + */ + protected AnnotationTypeRequiredMemberWriter writer; + + /** + * The list of members being documented. + */ + protected List members; + + /** + * The index of the current member that is being documented at this point + * in time. + */ + protected int currentMemberIndex; + + /** + * Construct a new AnnotationTypeRequiredMemberBuilder. + * + * @param configuration the current configuration of the + * doclet. + */ + protected AnnotationTypeRequiredMemberBuilder(Configuration configuration) { + super(configuration); + } + + + /** + * Construct a new AnnotationTypeMemberBuilder. + * + * @param configuration the current configuration of the doclet. + * @param classDoc the class whoses members are being documented. + * @param writer the doclet specific writer. + */ + public static AnnotationTypeRequiredMemberBuilder getInstance( + Configuration configuration, ClassDoc classDoc, + AnnotationTypeRequiredMemberWriter writer) { + AnnotationTypeRequiredMemberBuilder builder = + new AnnotationTypeRequiredMemberBuilder(configuration); + builder.classDoc = classDoc; + builder.writer = writer; + builder.visibleMemberMap = new VisibleMemberMap(classDoc, + VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED, configuration.nodeprecated); + builder.members = new ArrayList( + builder.visibleMemberMap.getMembersFor(classDoc)); + if (configuration.getMemberComparator() != null) { + Collections.sort(builder.members, + configuration.getMemberComparator()); + } + return builder; + } + + /** + * {@inheritDoc} + */ + public String getName() { + return "AnnotationTypeRequiredMemberDetails"; + } + + /** + * {@inheritDoc} + */ + public void invokeMethod(String methodName, Class[] paramClasses, + Object[] params) + throws Exception { + if (DEBUG) { + configuration.root.printError("DEBUG: " + this.getClass().getName() + + "." + methodName); + } + Method method = this.getClass().getMethod(methodName, paramClasses); + method.invoke(this, params); + } + + /** + * Returns a list of members that will be documented for the given class. + * This information can be used for doclet specific documentation + * generation. + * + * @param classDoc the {@link ClassDoc} we want to check. + * @return a list of members that will be documented. + */ + public List members(ClassDoc classDoc) { + return visibleMemberMap.getMembersFor(classDoc); + } + + /** + * Returns the visible member map for the members of this class. + * + * @return the visible member map for the members of this class. + */ + public VisibleMemberMap getVisibleMemberMap() { + return visibleMemberMap; + } + + /** + * summaryOrder.size() + */ + public boolean hasMembersToDocument() { + return members.size() > 0; + } + + /** + * Build the member documentation. + * + * @param elements the XML elements that specify how to construct this + * documentation. + */ + public void buildAnnotationTypeRequiredMember(List elements) { + if (writer == null) { + return; + } + for (currentMemberIndex = 0; currentMemberIndex < members.size(); + currentMemberIndex++) { + build(elements); + } + } + + /** + * Build the overall header. + */ + public void buildHeader() { + writer.writeHeader(classDoc, + configuration.getText("doclet.Annotation_Type_Member_Detail")); + } + + /** + * Build the header for the individual members. + */ + public void buildMemberHeader() { + writer.writeMemberHeader((MemberDoc) members.get( + currentMemberIndex), + currentMemberIndex == 0); + } + + /** + * Build the signature. + */ + public void buildSignature() { + writer.writeSignature((MemberDoc) members.get(currentMemberIndex)); + } + + /** + * Build the deprecation information. + */ + public void buildDeprecationInfo() { + writer.writeDeprecated((MemberDoc) members.get(currentMemberIndex)); + } + + /** + * Build the comments for the member. Do nothing if + * {@link Configuration#nocomment} is set to true. + */ + public void buildMemberComments() { + if(! configuration.nocomment){ + writer.writeComments((MemberDoc) members.get(currentMemberIndex)); + } + } + + /** + * Build the tag information. + */ + public void buildTagInfo() { + writer.writeTags((MemberDoc) members.get(currentMemberIndex)); + } + + /** + * Build the footer for the individual member. + */ + public void buildMemberFooter() { + writer.writeMemberFooter(); + } + + /** + * Build the overall footer. + */ + public void buildFooter() { + writer.writeFooter(classDoc); + } + + /** + * Return the annotation type required member writer for this builder. + * + * @return the annotation type required member constant writer for this + * builder. + */ + public AnnotationTypeRequiredMemberWriter getWriter() { + return writer; + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/BuilderFactory.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/BuilderFactory.java new file mode 100644 index 00000000000..fd4f057f0c8 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/BuilderFactory.java @@ -0,0 +1,235 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit.builders; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.javadoc.*; + +/** + * The factory for constructing builders. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.4 + */ + +public class BuilderFactory { + + /** + * The current configuration of the doclet. + */ + private Configuration configuration; + + /** + * The factory to retrieve the required writers from. + */ + private WriterFactory writerFactory; + + /** + * Construct a builder factory using the given configuration. + * @param configuration the configuration for the current doclet + * being executed. + */ + public BuilderFactory (Configuration configuration) { + this.configuration = configuration; + this.writerFactory = configuration.getWriterFactory(); + } + + /** + * Return the builder that builds the constant summary. + * @return the builder that builds the constant summary. + */ + public AbstractBuilder getConstantsSummaryBuider() throws Exception { + return ConstantsSummaryBuilder.getInstance(configuration, + writerFactory.getConstantsSummaryWriter()); + } + + /** + * Return the builder that builds the package summary. + * + * @param pkg the package being documented. + * @param prevPkg the previous package being documented. + * @param nextPkg the next package being documented. + * @return the builder that builds the constant summary. + */ + public AbstractBuilder getPackageSummaryBuilder(PackageDoc pkg, PackageDoc prevPkg, + PackageDoc nextPkg) throws Exception { + return PackageSummaryBuilder.getInstance(configuration, pkg, + writerFactory.getPackageSummaryWriter(pkg, prevPkg, nextPkg)); + } + + /** + * Return the builder for the class. + * + * @param classDoc the class being documented. + * @param prevClass the previous class that was documented. + * @param nextClass the next class being documented. + * @param classTree the class tree. + * @return the writer for the class. Return null if this + * writer is not supported by the doclet. + */ + public AbstractBuilder getClassBuilder(ClassDoc classDoc, + ClassDoc prevClass, ClassDoc nextClass, ClassTree classTree) + throws Exception { + return ClassBuilder.getInstance(configuration, classDoc, + writerFactory.getClassWriter(classDoc, prevClass, nextClass, + classTree)); + } + + /** + * Return the builder for the annotation type. + * + * @param annotationType the annotation type being documented. + * @param prevType the previous type that was documented. + * @param nextType the next type being documented. + * @return the writer for the annotation type. Return null if this + * writer is not supported by the doclet. + */ + public AbstractBuilder getAnnotationTypeBuilder( + AnnotationTypeDoc annotationType, + Type prevType, Type nextType) + throws Exception { + return AnnotationTypeBuilder.getInstance(configuration, annotationType, + writerFactory.getAnnotationTypeWriter(annotationType, prevType, + nextType)); + } + + /** + * Return an instance of the method builder for the given class. + * + * @return an instance of the method builder for the given class. + */ + public AbstractBuilder getMethodBuilder(ClassWriter classWriter) + throws Exception { + return MethodBuilder.getInstance(configuration, + classWriter.getClassDoc(), + writerFactory.getMethodWriter(classWriter)); + } + + /** + * Return an instance of the annotation type member builder for the given + * class. + * + * @return an instance of the annotation type memebr builder for the given + * annotation type. + */ + public AbstractBuilder getAnnotationTypeOptionalMemberBuilder( + AnnotationTypeWriter annotationTypeWriter) + throws Exception { + return AnnotationTypeOptionalMemberBuilder.getInstance(configuration, + annotationTypeWriter.getAnnotationTypeDoc(), + writerFactory.getAnnotationTypeOptionalMemberWriter( + annotationTypeWriter)); + } + + /** + * Return an instance of the annotation type member builder for the given + * class. + * + * @return an instance of the annotation type memebr builder for the given + * annotation type. + */ + public AbstractBuilder getAnnotationTypeRequiredMemberBuilder( + AnnotationTypeWriter annotationTypeWriter) + throws Exception { + return AnnotationTypeRequiredMemberBuilder.getInstance(configuration, + annotationTypeWriter.getAnnotationTypeDoc(), + writerFactory.getAnnotationTypeRequiredMemberWriter( + annotationTypeWriter)); + } + + /** + * Return an instance of the enum constants builder for the given class. + * + * @return an instance of the enum constants builder for the given class. + */ + public AbstractBuilder getEnumConstantsBuilder(ClassWriter classWriter) + throws Exception { + return EnumConstantBuilder.getInstance(configuration, classWriter.getClassDoc(), + writerFactory.getEnumConstantWriter(classWriter)); + } + + /** + * Return an instance of the field builder for the given class. + * + * @return an instance of the field builder for the given class. + */ + public AbstractBuilder getFieldBuilder(ClassWriter classWriter) + throws Exception { + return FieldBuilder.getInstance(configuration, classWriter.getClassDoc(), + writerFactory.getFieldWriter(classWriter)); + } + + /** + * Return an instance of the constructor builder for the given class. + * + * @return an instance of the constructor builder for the given class. + */ + public AbstractBuilder getConstructorBuilder(ClassWriter classWriter) + throws Exception { + return ConstructorBuilder.getInstance(configuration, + classWriter.getClassDoc(), writerFactory.getConstructorWriter( + classWriter)); + } + + /** + * Return an instance of the member summary builder for the given class. + * + * @return an instance of the member summary builder for the given class. + */ + public AbstractBuilder getMemberSummaryBuilder(ClassWriter classWriter) + throws Exception { + return MemberSummaryBuilder.getInstance(classWriter, configuration); + } + + /** + * Return an instance of the member summary builder for the given annotation + * type. + * + * @return an instance of the member summary builder for the given + * annotation type. + */ + public AbstractBuilder getMemberSummaryBuilder( + AnnotationTypeWriter annotationTypeWriter) + throws Exception { + return MemberSummaryBuilder.getInstance(annotationTypeWriter, + configuration); + } + + /** + * Return the builder that builds the serialized form. + * + * @return the builder that builds the serialized form. + */ + public AbstractBuilder getSerializedFormBuilder() + throws Exception { + return SerializedFormBuilder.getInstance(configuration); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java new file mode 100644 index 00000000000..e37f6426005 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java @@ -0,0 +1,350 @@ +/* + * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit.builders; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.javadoc.*; +import java.io.*; +import java.util.*; +import java.lang.reflect.*; + +/** + * Builds the summary for a given class. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ +public class ClassBuilder extends AbstractBuilder { + + /** + * The root element of the class XML is {@value}. + */ + public static final String ROOT = "ClassDoc"; + + /** + * The class being documented. + */ + private ClassDoc classDoc; + + /** + * The doclet specific writer. + */ + private ClassWriter writer; + + /** + * Keep track of whether or not this classdoc is an interface. + */ + private boolean isInterface = false; + + /** + * Keep track of whether or not this classdoc is an enum. + */ + private boolean isEnum = false; + + /** + * Construct a new ClassBuilder. + * + * @param configuration the current configuration of the + * doclet. + */ + private ClassBuilder(Configuration configuration) { + super(configuration); + } + + /** + * Construct a new ClassBuilder. + * + * @param configuration the current configuration of the doclet. + * @param classDoc the class being documented. + * @param writer the doclet specific writer. + */ + public static ClassBuilder getInstance(Configuration configuration, + ClassDoc classDoc, ClassWriter writer) + throws Exception { + ClassBuilder builder = new ClassBuilder(configuration); + builder.configuration = configuration; + builder.classDoc = classDoc; + builder.writer = writer; + if (classDoc.isInterface()) { + builder.isInterface = true; + } else if (classDoc.isEnum()) { + builder.isEnum = true; + Util.setEnumDocumentation(configuration, classDoc); + } + if(containingPackagesSeen == null) { + containingPackagesSeen = new HashSet(); + } + return builder; + } + + /** + * {@inheritDoc} + */ + public void invokeMethod(String methodName, Class[] paramClasses, + Object[] params) + throws Exception { + if (DEBUG) { + configuration.root.printError("DEBUG: " + this.getClass().getName() + + "." + methodName); + } + Method method = this.getClass().getMethod(methodName, paramClasses); + method.invoke(this, params); + } + + /** + * {@inheritDoc} + */ + public void build() throws IOException { + build(LayoutParser.getInstance(configuration).parseXML(ROOT)); + } + + /** + * {@inheritDoc} + */ + public String getName() { + return ROOT; + } + + /** + * Handles the <ClassDoc> tag. + * + * @param elements the XML elements that specify how to document a class. + */ + public void buildClassDoc(List elements) throws Exception { + build(elements); + writer.close(); + copyDocFiles(); + } + + + /** + * Copy the doc files for the current ClassDoc if necessary. + */ + private void copyDocFiles() { + PackageDoc containingPackage = classDoc.containingPackage(); + if((configuration.packages == null || + Arrays.binarySearch(configuration.packages, + containingPackage) < 0) && + ! containingPackagesSeen.contains(containingPackage.name())){ + //Only copy doc files dir if the containing package is not + //documented AND if we have not documented a class from the same + //package already. Otherwise, we are making duplicate copies. + Util.copyDocFiles(configuration, + Util.getPackageSourcePath(configuration, + classDoc.containingPackage()) + + DirectoryManager.getDirectoryPath(classDoc.containingPackage()) + + File.separator, DocletConstants.DOC_FILES_DIR_NAME, true); + containingPackagesSeen.add(containingPackage.name()); + } + } + + /** + * Build the header of the page. + */ + public void buildClassHeader() { + String key; + if (isInterface) { + key = "doclet.Interface"; + } else if (isEnum) { + key = "doclet.Enum"; + } else { + key = "doclet.Class"; + } + + writer.writeHeader(configuration.getText(key) + " " + classDoc.name()); + } + + /** + * Build the class tree documentation. + */ + public void buildClassTree() { + writer.writeClassTree(); + } + + /** + * If this is a class, list all interfaces + * implemented by this class. + */ + public void buildImplementedInterfacesInfo() { + writer.writeImplementedInterfacesInfo(); + } + + /** + * If this is an interface, list all super interfaces. + */ + public void buildSuperInterfacesInfo() { + writer.writeSuperInterfacesInfo(); + } + + /** + * List the parameters of this class. + */ + public void buildTypeParamInfo() { + writer.writeTypeParamInfo(); + } + + /** + * List all the classes extend this one. + */ + public void buildSubClassInfo() { + writer.writeSubClassInfo(); + } + + /** + * List all the interfaces that extend this one. + */ + public void buildSubInterfacesInfo() { + writer.writeSubInterfacesInfo(); + } + + /** + * If this is an interface, list all classes that implement this interface. + */ + public void buildInterfaceUsageInfo () { + writer.writeInterfaceUsageInfo(); + } + + /** + * If this is an inner class or interface, list the enclosing class or + * interface. + */ + public void buildNestedClassInfo () { + writer.writeNestedClassInfo(); + } + + /** + * If this class is deprecated, print the appropriate information. + */ + public void buildDeprecationInfo () { + writer.writeClassDeprecationInfo(); + } + + /** + * Build the signature of the current class. + */ + public void buildClassSignature() { + StringBuffer modifiers = new StringBuffer(classDoc.modifiers() + " "); + if (isEnum) { + modifiers.append("enum "); + int index; + if ((index = modifiers.indexOf("abstract")) >= 0) { + modifiers.delete(index, index + (new String("abstract")).length()); + modifiers = new StringBuffer( + Util.replaceText(modifiers.toString(), " ", " ")); + } + if ((index = modifiers.indexOf("final")) >= 0) { + modifiers.delete(index, index + (new String("final")).length()); + modifiers = new StringBuffer( + Util.replaceText(modifiers.toString(), " ", " ")); + } + //} else if (classDoc.isAnnotationType()) { + //modifiers.append("@interface "); + } else if (! isInterface) { + modifiers.append("class "); + } + writer.writeClassSignature(modifiers.toString()); + } + + /** + * Build the class description. + */ + public void buildClassDescription() { + writer.writeClassDescription(); + } + + /** + * Build the tag information for the current class. + */ + public void buildClassTagInfo() { + writer.writeClassTagInfo(); + } + + /** + * Build the contents of the page. + * + * @param elements the XML elements that specify how a member summary is + * documented. + */ + public void buildMemberSummary(List elements) throws Exception { + configuration.getBuilderFactory(). + getMemberSummaryBuilder(writer).build(elements); + writer.completeMemberSummaryBuild(); + } + + /** + * Build the enum constants documentation. + * + * @param elements the XML elements that specify how a enum constants are + * documented. + */ + public void buildEnumConstantsDetails(List elements) throws Exception { + configuration.getBuilderFactory(). + getEnumConstantsBuilder(writer).build(elements); + } + + /** + * Build the field documentation. + * + * @param elements the XML elements that specify how a field is documented. + */ + public void buildFieldDetails(List elements) throws Exception { + configuration.getBuilderFactory(). + getFieldBuilder(writer).build(elements); + } + + /** + * Build the constructor documentation. + * + * @param elements the XML elements that specify how to document a + * constructor. + */ + public void buildConstructorDetails(List elements) throws Exception { + configuration.getBuilderFactory(). + getConstructorBuilder(writer).build(elements); + } + + /** + * Build the method documentation. + * + * @param elements the XML elements that specify how a method is documented. + */ + public void buildMethodDetails(List elements) throws Exception { + configuration.getBuilderFactory(). + getMethodBuilder(writer).build(elements); + } + + /** + * Build the footer of the page. + */ + public void buildClassFooter() { + writer.writeFooter(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java new file mode 100644 index 00000000000..746c44013d4 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java @@ -0,0 +1,414 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit.builders; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.javadoc.*; +import java.io.*; +import java.util.*; +import java.lang.reflect.*; + +/** + * Builds the Constants Summary Page. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ +public class ConstantsSummaryBuilder extends AbstractBuilder { + + /** + * The root element of the constant summary XML is {@value}. + */ + public static final String ROOT = "ConstantSummary"; + + /** + * The maximum number of package directories shown in the constant + * value index. + */ + public static final int MAX_CONSTANT_VALUE_INDEX_LENGTH = 2; + + /** + * The writer used to write the results. + */ + protected ConstantsSummaryWriter writer; + + /** + * The set of ClassDocs that have constant fields. + */ + protected Set classDocsWithConstFields; + + /** + * The set of printed package headers. + */ + protected Set printedPackageHeaders; + + /** + * The current package being documented. + */ + private PackageDoc currentPackage; + + /** + * The current class being documented. + */ + private ClassDoc currentClass; + + /** + * Construct a new ConstantsSummaryBuilder. + * + * @param configuration the current configuration of the + * doclet. + */ + private ConstantsSummaryBuilder(Configuration configuration) { + super(configuration); + } + + /** + * Construct a ConstantsSummaryBuilder. + * + * @param configuration the configuration used in this run + * of the doclet. + * @param writer the writer for the summary. + */ + public static ConstantsSummaryBuilder getInstance( + Configuration configuration, ConstantsSummaryWriter writer) { + ConstantsSummaryBuilder builder = new ConstantsSummaryBuilder( + configuration); + builder.writer = writer; + builder.classDocsWithConstFields = new HashSet(); + return builder; + } + + /** + * {@inheritDoc} + */ + public void invokeMethod(String methodName, Class[] paramClasses, + Object[] params) + throws Exception { + if (DEBUG) { + configuration.root.printError("DEBUG: " + this.getClass().getName() + + "." + methodName); + } + Method method = this.getClass().getMethod(methodName, paramClasses); + method.invoke(this, params); + } + + /** + * {@inheritDoc} + */ + public void build() throws IOException { + if (writer == null) { + //Doclet does not support this output. + return; + } + build(LayoutParser.getInstance(configuration).parseXML(ROOT)); + } + + /** + * {@inheritDoc} + */ + public String getName() { + return ROOT; + } + + /** + * Build the constant summary. + * + * @param elements the list of elements describing constant summary + * documentation. + */ + public void buildConstantSummary(List elements) throws Exception { + build(elements); + writer.close(); + } + + /** + * Build the header. + */ + public void buildHeader() { + writer.writeHeader(); + } + + /** + * Build the footer. + */ + public void buildFooter() { + writer.writeFooter(); + } + + /** + * Build the table of contents. + */ + public void buildContents() { + writer.writeContentsHeader(); + PackageDoc[] packages = configuration.packages; + printedPackageHeaders = new HashSet(); + for (int i = 0; i < packages.length; i++) { + if (hasConstantField(packages[i]) && ! hasPrintedPackageIndex(packages[i].name())) { + writer.writeLinkToPackageContent(packages[i], + parsePackageName(packages[i].name()), + printedPackageHeaders); + } + } + writer.writeContentsFooter(); + } + + /** + * Build the summary for each documented package. + * + * @param elements the XML elements that represent the components + * of documentation for each package. + */ + public void buildConstantSummaries(List elements) { + PackageDoc[] packages = configuration.packages; + printedPackageHeaders = new HashSet(); + for (int i = 0; i < packages.length; i++) { + if (hasConstantField(packages[i])) { + currentPackage = packages[i]; + //Build the documentation for the current package. + build(elements); + } + } + } + + /** + * Build the summary for the current package. + * + * @param elements the list of XML elements that make up package + * documentation. + */ + public void buildPackageConstantSummary(List elements) { + build(elements); + } + + /** + * Build the summary for the current class. + * + * @param elements the list of XML elements that make up the class + * constant summary. + */ + public void buildClassConstantSummary(List elements) { + ClassDoc[] classes = currentPackage.name().length() > 0 ? + currentPackage.allClasses() : + configuration.classDocCatalog.allClasses( + DocletConstants.DEFAULT_PACKAGE_NAME); + Arrays.sort(classes); + for (int i = 0; i < classes.length; i++) { + if (! classDocsWithConstFields.contains(classes[i]) || + ! classes[i].isIncluded()) { + continue; + } + currentClass = classes[i]; + //Build the documentation for the current class. + build(elements); + } + } + + /** + * Build the header for the given class. + */ + public void buildPackageHeader() { + String parsedPackageName = parsePackageName(currentPackage.name()); + if (! printedPackageHeaders.contains(parsedPackageName)) { + writer.writePackageName(currentPackage, + parsePackageName(currentPackage.name())); + printedPackageHeaders.add(parsedPackageName); + } + } + + /** + * Build the header for the given class. + */ + public void buildClassHeader() { + writer.writeConstantMembersHeader(currentClass); + } + + /** + * Print summary of constant members in the + * class. + */ + public void buildConstantMembers() { + new ConstantFieldBuilder(currentClass).buildMembersSummary(); + } + + /** + * Build the footer for the given class. + */ + public void buildClassFooter() { + writer.writeConstantMembersFooter(currentClass); + } + + /** + * Return true if the given package has constant fields to document. + * + * @param pkg the package being checked. + * @return true if the given package has constant fields to document. + */ + private boolean hasConstantField(PackageDoc pkg) { + ClassDoc[] classes; + if (pkg.name().length() > 0) { + classes = pkg.allClasses(); + } else { + classes = configuration.classDocCatalog.allClasses( + DocletConstants.DEFAULT_PACKAGE_NAME); + } + boolean found = false; + for (int j = 0; j < classes.length; j++){ + if (classes[j].isIncluded() && hasConstantField(classes[j])) { + found = true; + } + } + return found; + } + + /** + * Return true if the given class has constant fields to document. + * + * @param classDoc the class being checked. + * @return true if the given package has constant fields to document. + */ + private boolean hasConstantField (ClassDoc classDoc) { + VisibleMemberMap visibleMemberMapFields = new VisibleMemberMap(classDoc, + VisibleMemberMap.FIELDS, configuration.nodeprecated); + List fields = visibleMemberMapFields.getLeafClassMembers(configuration); + for (Iterator iter = fields.iterator(); iter.hasNext(); ) { + FieldDoc field = (FieldDoc) iter.next(); + if (field.constantValueExpression() != null) { + classDocsWithConstFields.add(classDoc); + return true; + } + } + return false; + } + + /** + * Return true if the given package name has been printed. Also + * return true if the root of this package has been printed. + * + * @param pkgname the name of the package to check. + */ + private boolean hasPrintedPackageIndex(String pkgname) { + String[] list = (String[])printedPackageHeaders.toArray(new String[] {}); + for (int i = 0; i < list.length; i++) { + if (pkgname.startsWith(list[i])) { + return true; + } + } + return false; + } + + /** + * Print the table of constants. + * + * @author Jamie Ho + * @since 1.4 + */ + private class ConstantFieldBuilder { + + /** + * The map used to get the visible variables. + */ + protected VisibleMemberMap visibleMemberMapFields = null; + + /** + * The map used to get the visible variables. + */ + protected VisibleMemberMap visibleMemberMapEnumConst = null; + + /** + * The classdoc that we are examining constants for. + */ + protected ClassDoc classdoc; + + /** + * Construct a ConstantFieldSubWriter. + * @param classdoc the classdoc that we are examining constants for. + */ + public ConstantFieldBuilder(ClassDoc classdoc) { + this.classdoc = classdoc; + visibleMemberMapFields = new VisibleMemberMap(classdoc, + VisibleMemberMap.FIELDS, configuration.nodeprecated); + visibleMemberMapEnumConst = new VisibleMemberMap(classdoc, + VisibleMemberMap.ENUM_CONSTANTS, configuration.nodeprecated); + } + + /** + * Builds the table of constants for a given class. + */ + protected void buildMembersSummary() { + List members = new ArrayList(members()); + if (members.size() > 0) { + Collections.sort(members); + writer.writeConstantMembers(classdoc, members); + } + } + + /** + * Return the list of visible constant fields for the given classdoc. + * @param cd the classdoc to examine. + * @return the list of visible constant fields for the given classdoc. + */ + protected List members() { + List l = visibleMemberMapFields.getLeafClassMembers(configuration); + l.addAll(visibleMemberMapEnumConst.getLeafClassMembers(configuration)); + Iterator iter; + + if(l != null){ + iter = l.iterator(); + } else { + return null; + } + List inclList = new LinkedList(); + FieldDoc member; + while(iter.hasNext()){ + member = (FieldDoc)iter.next(); + if(member.constantValue() != null){ + inclList.add(member); + } + } + return inclList; + } + } + + /** + * Parse the package name. We only want to display package name up to + * 2 levels. + */ + private String parsePackageName(String pkgname) { + int index = -1; + for (int j = 0; j < MAX_CONSTANT_VALUE_INDEX_LENGTH; j++) { + index = pkgname.indexOf(".", index + 1); + } + if (index != -1) { + pkgname = pkgname.substring(0, index); + } + return pkgname; + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java new file mode 100644 index 00000000000..8e4dc812e7c --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstructorBuilder.java @@ -0,0 +1,256 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit.builders; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.javadoc.*; +import java.lang.reflect.*; +import java.util.*; + +/** + * Builds documentation for a constructor. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ +public class ConstructorBuilder extends AbstractMemberBuilder { + + /** + * The name of this builder. + */ + public static final String NAME = "ConstructorDetails"; + + /** + * The index of the current field that is being documented at this point + * in time. + */ + private int currentMethodIndex; + + /** + * The class whose constructors are being documented. + */ + private ClassDoc classDoc; + + /** + * The visible constructors for the given class. + */ + private VisibleMemberMap visibleMemberMap; + + /** + * The writer to output the constructor documentation. + */ + private ConstructorWriter writer; + + /** + * The constructors being documented. + */ + private List constructors; + + /** + * Construct a new ConstructorBuilder. + * + * @param configuration the current configuration of the + * doclet. + */ + private ConstructorBuilder(Configuration configuration) { + super(configuration); + } + + /** + * Construct a new ConstructorBuilder. + * + * @param configuration the current configuration of the doclet. + * @param classDoc the class whoses members are being documented. + * @param writer the doclet specific writer. + */ + public static ConstructorBuilder getInstance( + Configuration configuration, + ClassDoc classDoc, + ConstructorWriter writer) { + ConstructorBuilder builder = new ConstructorBuilder(configuration); + builder.classDoc = classDoc; + builder.writer = writer; + builder.visibleMemberMap = + new VisibleMemberMap( + classDoc, + VisibleMemberMap.CONSTRUCTORS, + configuration.nodeprecated); + builder.constructors = + new ArrayList(builder.visibleMemberMap.getMembersFor(classDoc)); + for (int i = 0; i < builder.constructors.size(); i++) { + if (((ProgramElementDoc) (builder.constructors.get(i))) + .isProtected() + || ((ProgramElementDoc) (builder.constructors.get(i))) + .isPrivate()) { + writer.setFoundNonPubConstructor(true); + } + } + if (configuration.getMemberComparator() != null) { + Collections.sort( + builder.constructors, + configuration.getMemberComparator()); + } + return builder; + } + + /** + * {@inheritDoc} + */ + public String getName() { + return NAME; + } + + /** + * {@inheritDoc} + */ + public boolean hasMembersToDocument() { + return constructors.size() > 0; + } + + /** + * {@inheritDoc} + */ + public void invokeMethod( + String methodName, + Class[] paramClasses, + Object[] params) + throws Exception { + if (DEBUG) { + configuration.root.printError( + "DEBUG: " + this.getClass().getName() + "." + methodName); + } + Method method = this.getClass().getMethod(methodName, paramClasses); + method.invoke(this, params); + } + + /** + * Returns a list of constructors that will be documented for the given class. + * This information can be used for doclet specific documentation + * generation. + * + * @return a list of constructors that will be documented. + */ + public List members(ClassDoc classDoc) { + return visibleMemberMap.getMembersFor(classDoc); + } + + /** + * Return the constructor writer for this builder. + * + * @return the constructor writer for this builder. + */ + public ConstructorWriter getWriter() { + return writer; + } + + /** + * Build the constructor documentation. + * + * @param elements the XML elements that specify how to construct this + * documentation. + */ + public void buildConstructorDoc(List elements) { + if (writer == null) { + return; + } + for (currentMethodIndex = 0; + currentMethodIndex < constructors.size(); + currentMethodIndex++) { + build(elements); + } + } + + /** + * Build the overall header. + */ + public void buildHeader() { + writer.writeHeader( + classDoc, + configuration.getText("doclet.Constructor_Detail")); + } + + /** + * Build the header for the individual constructor. + */ + public void buildConstructorHeader() { + writer.writeConstructorHeader( + (ConstructorDoc) constructors.get(currentMethodIndex), + currentMethodIndex == 0); + } + + /** + * Build the signature. + */ + public void buildSignature() { + writer.writeSignature( + (ConstructorDoc) constructors.get(currentMethodIndex)); + } + + /** + * Build the deprecation information. + */ + public void buildDeprecationInfo() { + writer.writeDeprecated( + (ConstructorDoc) constructors.get(currentMethodIndex)); + } + + /** + * Build the comments for the constructor. Do nothing if + * {@link Configuration#nocomment} is set to true. + */ + public void buildConstructorComments() { + if (!configuration.nocomment) { + writer.writeComments( + (ConstructorDoc) constructors.get(currentMethodIndex)); + } + } + + /** + * Build the tag information. + */ + public void buildTagInfo() { + writer.writeTags((ConstructorDoc) constructors.get(currentMethodIndex)); + } + + /** + * Build the footer for the individual constructor. + */ + public void buildConstructorFooter() { + writer.writeConstructorFooter(); + } + + /** + * Build the overall footer. + */ + public void buildFooter() { + writer.writeFooter(classDoc); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java new file mode 100644 index 00000000000..bfba89bed92 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/EnumConstantBuilder.java @@ -0,0 +1,254 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit.builders; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.javadoc.*; +import java.util.*; +import java.lang.reflect.*; + +/** + * Builds documentation for a enum constants. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ +public class EnumConstantBuilder extends AbstractMemberBuilder { + + /** + * The class whose enum constants are being documented. + */ + private ClassDoc classDoc; + + /** + * The visible enum constantss for the given class. + */ + private VisibleMemberMap visibleMemberMap; + + /** + * The writer to output the enum constants documentation. + */ + private EnumConstantWriter writer; + + /** + * The list of enum constants being documented. + */ + private List enumConstants; + + /** + * The index of the current enum constant that is being documented at this point + * in time. + */ + private int currentEnumConstantsIndex; + + /** + * Construct a new EnumConstantsBuilder. + * + * @param configuration the current configuration of the + * doclet. + */ + private EnumConstantBuilder(Configuration configuration) { + super(configuration); + } + + /** + * Construct a new EnumConstantsBuilder. + * + * @param configuration the current configuration of the doclet. + * @param classDoc the class whoses members are being documented. + * @param writer the doclet specific writer. + */ + public static EnumConstantBuilder getInstance( + Configuration configuration, + ClassDoc classDoc, + EnumConstantWriter writer) { + EnumConstantBuilder builder = new EnumConstantBuilder(configuration); + builder.classDoc = classDoc; + builder.writer = writer; + builder.visibleMemberMap = + new VisibleMemberMap( + classDoc, + VisibleMemberMap.ENUM_CONSTANTS, + configuration.nodeprecated); + builder.enumConstants = + new ArrayList(builder.visibleMemberMap.getMembersFor(classDoc)); + if (configuration.getMemberComparator() != null) { + Collections.sort( + builder.enumConstants, + configuration.getMemberComparator()); + } + return builder; + } + + /** + * {@inheritDoc} + */ + public String getName() { + return "EnumConstantDetails"; + } + + /** + * {@inheritDoc} + */ + public void invokeMethod( + String methodName, + Class[] paramClasses, + Object[] params) + throws Exception { + if (DEBUG) { + configuration.root.printError( + "DEBUG: " + this.getClass().getName() + "." + methodName); + } + Method method = this.getClass().getMethod(methodName, paramClasses); + method.invoke(this, params); + } + + /** + * Returns a list of enum constants that will be documented for the given class. + * This information can be used for doclet specific documentation + * generation. + * + * @param classDoc the {@link ClassDoc} we want to check. + * @return a list of enum constants that will be documented. + */ + public List members(ClassDoc classDoc) { + return visibleMemberMap.getMembersFor(classDoc); + } + + /** + * Returns the visible member map for the enum constants of this class. + * + * @return the visible member map for the enum constants of this class. + */ + public VisibleMemberMap getVisibleMemberMap() { + return visibleMemberMap; + } + + /** + * summaryOrder.size() + */ + public boolean hasMembersToDocument() { + return enumConstants.size() > 0; + } + + /** + * Build the enum constant documentation. + * + * @param elements the XML elements that specify how to construct this + * documentation. + */ + public void buildEnumConstant(List elements) { + if (writer == null) { + return; + } + for (currentEnumConstantsIndex = 0; + currentEnumConstantsIndex < enumConstants.size(); + currentEnumConstantsIndex++) { + build(elements); + } + } + + /** + * Build the overall header. + */ + public void buildHeader() { + writer.writeHeader( + classDoc, + configuration.getText("doclet.Enum_Constant_Detail")); + } + + /** + * Build the header for the individual enum constants. + */ + public void buildEnumConstantHeader() { + writer.writeEnumConstantHeader( + (FieldDoc) enumConstants.get(currentEnumConstantsIndex), + currentEnumConstantsIndex == 0); + } + + /** + * Build the signature. + */ + public void buildSignature() { + writer.writeSignature( + (FieldDoc) enumConstants.get(currentEnumConstantsIndex)); + } + + /** + * Build the deprecation information. + */ + public void buildDeprecationInfo() { + writer.writeDeprecated( + (FieldDoc) enumConstants.get(currentEnumConstantsIndex)); + } + + /** + * Build the comments for the enum constant. Do nothing if + * {@link Configuration#nocomment} is set to true. + */ + public void buildEnumConstantComments() { + if (!configuration.nocomment) { + writer.writeComments( + (FieldDoc) enumConstants.get(currentEnumConstantsIndex)); + } + } + + /** + * Build the tag information. + */ + public void buildTagInfo() { + writer.writeTags( + (FieldDoc) enumConstants.get(currentEnumConstantsIndex)); + } + + /** + * Build the footer for the individual enum constants. + */ + public void buildEnumConstantFooter() { + writer.writeEnumConstantFooter(); + } + + /** + * Build the overall footer. + */ + public void buildFooter() { + writer.writeFooter(classDoc); + } + + /** + * Return the enum constant writer for this builder. + * + * @return the enum constant writer for this builder. + */ + public EnumConstantWriter getWriter() { + return writer; + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java new file mode 100644 index 00000000000..87b4a02d7ff --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/FieldBuilder.java @@ -0,0 +1,251 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit.builders; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.javadoc.*; +import java.util.*; +import java.lang.reflect.*; + +/** + * Builds documentation for a field. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ +public class FieldBuilder extends AbstractMemberBuilder { + + /** + * The class whose fields are being documented. + */ + private ClassDoc classDoc; + + /** + * The visible fields for the given class. + */ + private VisibleMemberMap visibleMemberMap; + + /** + * The writer to output the field documentation. + */ + private FieldWriter writer; + + /** + * The list of fields being documented. + */ + private List fields; + + /** + * The index of the current field that is being documented at this point + * in time. + */ + private int currentFieldIndex; + + /** + * Construct a new FieldBuilder. + * + * @param configuration the current configuration of the + * doclet. + */ + private FieldBuilder(Configuration configuration) { + super(configuration); + } + + /** + * Construct a new FieldBuilder. + * + * @param configuration the current configuration of the doclet. + * @param classDoc the class whoses members are being documented. + * @param writer the doclet specific writer. + */ + public static FieldBuilder getInstance( + Configuration configuration, + ClassDoc classDoc, + FieldWriter writer) { + FieldBuilder builder = new FieldBuilder(configuration); + builder.classDoc = classDoc; + builder.writer = writer; + builder.visibleMemberMap = + new VisibleMemberMap( + classDoc, + VisibleMemberMap.FIELDS, + configuration.nodeprecated); + builder.fields = + new ArrayList(builder.visibleMemberMap.getLeafClassMembers( + configuration)); + if (configuration.getMemberComparator() != null) { + Collections.sort( + builder.fields, + configuration.getMemberComparator()); + } + return builder; + } + + /** + * {@inheritDoc} + */ + public String getName() { + return "FieldDetails"; + } + + /** + * {@inheritDoc} + */ + public void invokeMethod( + String methodName, + Class[] paramClasses, + Object[] params) + throws Exception { + if (DEBUG) { + configuration.root.printError( + "DEBUG: " + this.getClass().getName() + "." + methodName); + } + Method method = this.getClass().getMethod(methodName, paramClasses); + method.invoke(this, params); + } + + /** + * Returns a list of fields that will be documented for the given class. + * This information can be used for doclet specific documentation + * generation. + * + * @param classDoc the {@link ClassDoc} we want to check. + * @return a list of fields that will be documented. + */ + public List members(ClassDoc classDoc) { + return visibleMemberMap.getMembersFor(classDoc); + } + + /** + * Returns the visible member map for the fields of this class. + * + * @return the visible member map for the fields of this class. + */ + public VisibleMemberMap getVisibleMemberMap() { + return visibleMemberMap; + } + + /** + * summaryOrder.size() + */ + public boolean hasMembersToDocument() { + return fields.size() > 0; + } + + /** + * Build the field documentation. + * + * @param elements the XML elements that specify how to construct this + * documentation. + */ + public void buildFieldDoc(List elements) { + if (writer == null) { + return; + } + for (currentFieldIndex = 0; + currentFieldIndex < fields.size(); + currentFieldIndex++) { + build(elements); + } + } + + /** + * Build the overall header. + */ + public void buildHeader() { + writer.writeHeader( + classDoc, + configuration.getText("doclet.Field_Detail")); + } + + /** + * Build the header for the individual field. + */ + public void buildFieldHeader() { + writer.writeFieldHeader( + (FieldDoc) fields.get(currentFieldIndex), + currentFieldIndex == 0); + } + + /** + * Build the signature. + */ + public void buildSignature() { + writer.writeSignature((FieldDoc) fields.get(currentFieldIndex)); + } + + /** + * Build the deprecation information. + */ + public void buildDeprecationInfo() { + writer.writeDeprecated((FieldDoc) fields.get(currentFieldIndex)); + } + + /** + * Build the comments for the field. Do nothing if + * {@link Configuration#nocomment} is set to true. + */ + public void buildFieldComments() { + if (!configuration.nocomment) { + writer.writeComments((FieldDoc) fields.get(currentFieldIndex)); + } + } + + /** + * Build the tag information. + */ + public void buildTagInfo() { + writer.writeTags((FieldDoc) fields.get(currentFieldIndex)); + } + + /** + * Build the footer for the individual field. + */ + public void buildFieldFooter() { + writer.writeFieldFooter(); + } + + /** + * Build the overall footer. + */ + public void buildFooter() { + writer.writeFooter(classDoc); + } + + /** + * Return the field writer for this builder. + * + * @return the field writer for this builder. + */ + public FieldWriter getWriter() { + return writer; + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java new file mode 100644 index 00000000000..43f208302f6 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/LayoutParser.java @@ -0,0 +1,139 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ +package com.sun.tools.doclets.internal.toolkit.builders; + +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.tools.doclets.internal.toolkit.util.*; +import java.io.*; +import java.util.*; +import org.xml.sax.*; +import org.xml.sax.helpers.DefaultHandler; +import javax.xml.parsers.*; + +/** + * Parse the XML that specified the order of operation for the builders. This + * Parser uses SAX parsing. + * + * @author Jamie Ho + * @since 1.5 + * @see SAXParser + */ +public class LayoutParser extends DefaultHandler { + + /** + * The map of XML elements that have been parsed. + */ + private Map xmlElementsMap; + + private Configuration configuration; + private static LayoutParser instance; + private String currentRoot; + private boolean isParsing; + + /** + * This class is a singleton. + */ + private LayoutParser(Configuration configuration) { + xmlElementsMap = new HashMap(); + this.configuration = configuration; + } + + /** + * Return an instance of the BuilderXML. + * + * @param configuration the current configuration of the doclet. + * @return an instance of the BuilderXML. + */ + public static LayoutParser getInstance(Configuration configuration) { + if (instance == null) { + instance = new LayoutParser(configuration); + } + return instance; + } + + /** + * Parse the XML specifying the layout of the documentation. + * + * @return List the list of XML elements parsed. + */ + public List parseXML(String root) { + if (xmlElementsMap.containsKey(root)) { + return (List) xmlElementsMap.get(root); + } + try { + List xmlElements = new ArrayList(); + xmlElementsMap.put(root, xmlElements); + currentRoot = root; + isParsing = false; + SAXParserFactory factory = SAXParserFactory.newInstance(); + SAXParser saxParser = factory.newSAXParser(); + InputStream in = configuration.getBuilderXML(); + saxParser.parse(in, this); + return xmlElements; + } catch (Throwable t) { + t.printStackTrace(); + throw new DocletAbortException(); + } + } + + /** + * {@inheritDoc} + */ + public void startElement(String namespaceURI, String sName, String qName, + Attributes attrs) + throws SAXException { + if (isParsing || qName.equals(currentRoot)) { + isParsing = true; + List xmlElements = (List) xmlElementsMap.get(currentRoot); + xmlElements.add(qName); + } + } + + /** + * {@inheritDoc} + */ + public void endElement(String namespaceURI, String sName, String qName) + throws SAXException { + if (! isParsing) { + isParsing = false; + return; + } + List xmlElements = (List) xmlElementsMap.get(currentRoot); + if (xmlElements.get(xmlElements.size()-1).equals(qName)) { + return; + } else { + List subElements = new ArrayList(); + int targetIndex = xmlElements.indexOf(qName); + int size = xmlElements.size(); + for (int i = targetIndex; i < size; i++) { + subElements.add(xmlElements.get(targetIndex)); + xmlElements.remove(targetIndex); + } + //Save the sub elements as a list. + xmlElements.add(subElements); + } + isParsing = ! qName.equals(currentRoot); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java new file mode 100644 index 00000000000..86c8d9a5d9b --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java @@ -0,0 +1,369 @@ +/* + * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit.builders; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.javadoc.*; +import java.util.*; +import java.lang.reflect.*; + +/** + * Builds the member summary. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ +public class MemberSummaryBuilder extends AbstractMemberBuilder { + + /** + * The XML root for this builder. + */ + public static final String NAME = "MemberSummary"; + + /** + * The visible members for the given class. + */ + private VisibleMemberMap[] visibleMemberMaps; + + /** + * The member summary writers for the given class. + */ + private MemberSummaryWriter[] memberSummaryWriters; + + /** + * The type being documented. + */ + private ClassDoc classDoc; + + private MemberSummaryBuilder(Configuration configuration) { + super(configuration); + } + + /** + * Construct a new MemberSummaryBuilder. + * + * @param classWriter the writer for the class whose members are being + * summarized. + * @param configuration the current configuration of the doclet. + */ + public static MemberSummaryBuilder getInstance( + ClassWriter classWriter, Configuration configuration) + throws Exception { + MemberSummaryBuilder builder = new MemberSummaryBuilder(configuration); + builder.classDoc = classWriter.getClassDoc(); + builder.init(classWriter); + return builder; + } + + /** + * Construct a new MemberSummaryBuilder. + * + * @param annotationTypeWriter the writer for the class whose members are + * being summarized. + * @param configuration the current configuration of the doclet. + */ + public static MemberSummaryBuilder getInstance( + AnnotationTypeWriter annotationTypeWriter, Configuration configuration) + throws Exception { + MemberSummaryBuilder builder = new MemberSummaryBuilder(configuration); + builder.classDoc = annotationTypeWriter.getAnnotationTypeDoc(); + builder.init(annotationTypeWriter); + return builder; + } + + private void init(Object writer) throws Exception { + visibleMemberMaps = + new VisibleMemberMap[VisibleMemberMap.NUM_MEMBER_TYPES]; + for (int i = 0; i < VisibleMemberMap.NUM_MEMBER_TYPES; i++) { + visibleMemberMaps[i] = + new VisibleMemberMap( + classDoc, + i, + configuration.nodeprecated); + } + memberSummaryWriters = + new MemberSummaryWriter[VisibleMemberMap.NUM_MEMBER_TYPES]; + for (int i = 0; i < VisibleMemberMap.NUM_MEMBER_TYPES; i++) { + if (classDoc.isAnnotationType()) { + memberSummaryWriters[i] = + visibleMemberMaps[i].noVisibleMembers()? + null : + configuration.getWriterFactory().getMemberSummaryWriter( + (AnnotationTypeWriter) writer, i); + } else { + memberSummaryWriters[i] = + visibleMemberMaps[i].noVisibleMembers()? + null : + configuration.getWriterFactory().getMemberSummaryWriter( + (ClassWriter) writer, i); + } + } + + } + + /** + * {@inheritDoc} + */ + public String getName() { + return NAME; + } + + /** + * Return the specified visible member map. + * + * @param type the type of visible member map to return. + * @return the specified visible member map. + * @throws ArrayIndexOutOfBoundsException when the type is invalid. + * @see VisibleMemberMap + */ + public VisibleMemberMap getVisibleMemberMap(int type) { + return visibleMemberMaps[type]; + } + + /** + * Return the specified member summary writer. + * + * @param type the type of member summary writer to return. + * @return the specified member summary writer. + * @throws ArrayIndexOutOfBoundsException when the type is invalid. + * @see VisibleMemberMap + */ + public MemberSummaryWriter getMemberSummaryWriter(int type) { + return memberSummaryWriters[type]; + } + + /** + * Returns a list of methods that will be documented for the given class. + * This information can be used for doclet specific documentation + * generation. + * + * @param classDoc the {@link ClassDoc} we want to check. + * @param type the type of members to return. + * @return a list of methods that will be documented. + * @see VisibleMemberMap + */ + public List members(int type) { + return visibleMemberMaps[type].getLeafClassMembers(configuration); + } + + /** + * {@inheritDoc} + */ + public void invokeMethod( + String methodName, + Class[] paramClasses, + Object[] params) + throws Exception { + if (DEBUG) { + configuration.root.printError( + "DEBUG: " + this.getClass().getName() + "." + methodName); + } + Method method = this.getClass().getMethod(methodName, paramClasses); + method.invoke(this, params); + } + + /** + * Return true it there are any members to summarize. + * + * @return true if there are any members to summarize. + */ + public boolean hasMembersToDocument() { + if (classDoc instanceof AnnotationTypeDoc) { + return ((AnnotationTypeDoc) classDoc).elements().length > 0; + } + for (int i = 0; i < VisibleMemberMap.NUM_MEMBER_TYPES; i++) { + VisibleMemberMap members = visibleMemberMaps[i]; + if (!members.noVisibleMembers()) { + return true; + } + } + return false; + } + + /** + * Build the summary for the enum constants. + */ + public void buildEnumConstantsSummary() { + buildSummary( + memberSummaryWriters[VisibleMemberMap.ENUM_CONSTANTS], + visibleMemberMaps[VisibleMemberMap.ENUM_CONSTANTS]); + } + + /** + * Build the summary for the optional members. + */ + public void buildAnnotationTypeOptionalMemberSummary() { + buildSummary( + memberSummaryWriters[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL], + visibleMemberMaps[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_OPTIONAL]); + } + + /** + * Build the summary for the optional members. + */ + public void buildAnnotationTypeRequiredMemberSummary() { + buildSummary( + memberSummaryWriters[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED], + visibleMemberMaps[VisibleMemberMap.ANNOTATION_TYPE_MEMBER_REQUIRED]); + } + + /** + * Build the summary for the fields. + */ + public void buildFieldsSummary() { + buildSummary( + memberSummaryWriters[VisibleMemberMap.FIELDS], + visibleMemberMaps[VisibleMemberMap.FIELDS]); + } + + /** + * Build the inherited summary for the fields. + */ + public void buildFieldsInheritedSummary() { + buildInheritedSummary( + memberSummaryWriters[VisibleMemberMap.FIELDS], + visibleMemberMaps[VisibleMemberMap.FIELDS]); + } + + /** + * Build the summary for the nested classes. + */ + public void buildNestedClassesSummary() { + buildSummary( + memberSummaryWriters[VisibleMemberMap.INNERCLASSES], + visibleMemberMaps[VisibleMemberMap.INNERCLASSES]); + } + + /** + * Build the inherited summary for the nested classes. + */ + public void buildNestedClassesInheritedSummary() { + buildInheritedSummary( + memberSummaryWriters[VisibleMemberMap.INNERCLASSES], + visibleMemberMaps[VisibleMemberMap.INNERCLASSES]); + } + + /** + * Build the method summary. + */ + public void buildMethodsSummary() { + buildSummary( + memberSummaryWriters[VisibleMemberMap.METHODS], + visibleMemberMaps[VisibleMemberMap.METHODS]); + } + + /** + * Build the inherited method summary. + */ + public void buildMethodsInheritedSummary() { + buildInheritedSummary( + memberSummaryWriters[VisibleMemberMap.METHODS], + visibleMemberMaps[VisibleMemberMap.METHODS]); + } + + /** + * Build the constructor summary. + */ + public void buildConstructorsSummary() { + buildSummary( + memberSummaryWriters[VisibleMemberMap.CONSTRUCTORS], + visibleMemberMaps[VisibleMemberMap.CONSTRUCTORS]); + } + + /** + * Build the member summary for the given members. + * + * @param writer the summary writer to write the output. + * @param visibleMemberMap the given members to summarize. + */ + private void buildSummary(MemberSummaryWriter writer, + VisibleMemberMap visibleMemberMap) { + List members = new ArrayList(visibleMemberMap.getLeafClassMembers( + configuration)); + if (members.size() > 0) { + Collections.sort(members); + writer.writeMemberSummaryHeader(classDoc); + for (int i = 0; i < members.size(); i++) { + ProgramElementDoc member = (ProgramElementDoc) members.get(i); + Tag[] firstSentenceTags = member.firstSentenceTags(); + if (member instanceof MethodDoc && firstSentenceTags.length == 0) { + //Inherit comments from overriden or implemented method if + //necessary. + DocFinder.Output inheritedDoc = + DocFinder.search(new DocFinder.Input((MethodDoc) member)); + if (inheritedDoc.holder != null && + inheritedDoc.holder.firstSentenceTags().length > 0) { + firstSentenceTags = inheritedDoc.holder.firstSentenceTags(); + } + } + writer.writeMemberSummary(classDoc, member, firstSentenceTags, + i == 0, i == members.size() - 1); + } + writer.writeMemberSummaryFooter(classDoc); + } + } + + /** + * Build the inherited member summary for the given methods. + * + * @param writer the writer for this member summary. + * @param visibleMemberMap the map for the members to document. + */ + private void buildInheritedSummary(MemberSummaryWriter writer, + VisibleMemberMap visibleMemberMap) { + for (Iterator iter = visibleMemberMap.getVisibleClassesList().iterator(); + iter.hasNext();) { + ClassDoc inhclass = (ClassDoc) (iter.next()); + if (! (inhclass.isPublic() || + Util.isLinkable(inhclass, configuration))) { + continue; + } + if (inhclass == classDoc) { + continue; + } + List inhmembers = visibleMemberMap.getMembersFor(inhclass); + if (inhmembers.size() > 0) { + Collections.sort(inhmembers); + writer.writeInheritedMemberSummaryHeader(inhclass); + for (int j = 0; j < inhmembers.size(); ++j) { + writer.writeInheritedMemberSummary( + inhclass.isPackagePrivate() && + ! Util.isLinkable(inhclass, configuration) ? + classDoc : inhclass, + (ProgramElementDoc) inhmembers.get(j), + j == 0, + j == inhmembers.size() - 1); + } + writer.writeInheritedMemberSummaryFooter(inhclass); + } + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java new file mode 100644 index 00000000000..1f00adc275f --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MethodBuilder.java @@ -0,0 +1,257 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit.builders; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.javadoc.*; +import java.util.*; +import java.lang.reflect.*; +/** + * Builds documentation for a method. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ +public class MethodBuilder extends AbstractMemberBuilder { + + /** + * The index of the current field that is being documented at this point + * in time. + */ + private int currentMethodIndex; + + /** + * The class whose methods are being documented. + */ + private ClassDoc classDoc; + + /** + * The visible methods for the given class. + */ + private VisibleMemberMap visibleMemberMap; + + /** + * The writer to output the method documentation. + */ + private MethodWriter writer; + + /** + * The methods being documented. + */ + private List methods; + + private MethodBuilder(Configuration configuration) { + super(configuration); + } + + /** + * Construct a new MethodBuilder. + * + * @param configuration the current configuration of the doclet. + * @param classDoc the class whoses members are being documented. + * @param writer the doclet specific writer. + * + * @return an instance of a MethodBuilder. + */ + public static MethodBuilder getInstance( + Configuration configuration, + ClassDoc classDoc, + MethodWriter writer) { + MethodBuilder builder = new MethodBuilder(configuration); + builder.classDoc = classDoc; + builder.writer = writer; + builder.visibleMemberMap = + new VisibleMemberMap( + classDoc, + VisibleMemberMap.METHODS, + configuration.nodeprecated); + builder.methods = + new ArrayList(builder.visibleMemberMap.getLeafClassMembers( + configuration)); + if (configuration.getMemberComparator() != null) { + Collections.sort( + builder.methods, + configuration.getMemberComparator()); + } + return builder; + } + + /** + * {@inheritDoc} + */ + public String getName() { + return "MethodDetails"; + } + + /** + * {@inheritDoc} + */ + public void invokeMethod( + String methodName, + Class[] paramClasses, + Object[] params) + throws Exception { + if (DEBUG) { + configuration.root.printError( + "DEBUG: " + this.getClass().getName() + "." + methodName); + } + Method method = this.getClass().getMethod(methodName, paramClasses); + method.invoke(this, params); + } + + /** + * Returns a list of methods that will be documented for the given class. + * This information can be used for doclet specific documentation + * generation. + * + * @param classDoc the {@link ClassDoc} we want to check. + * @return a list of methods that will be documented. + */ + public List members(ClassDoc classDoc) { + return visibleMemberMap.getMembersFor(classDoc); + } + + /** + * Returns the visible member map for the methods of this class. + * + * @return the visible member map for the methods of this class. + */ + public VisibleMemberMap getVisibleMemberMap() { + return visibleMemberMap; + } + + /** + * {@inheritDoc} + */ + public boolean hasMembersToDocument() { + return methods.size() > 0; + } + + /** + * Build the method documentation. + */ + public void buildMethodDoc(List elements) { + if (writer == null) { + return; + } + for (currentMethodIndex = 0; + currentMethodIndex < methods.size(); + currentMethodIndex++) { + build(elements); + } + } + + /** + * Build the overall header. + */ + public void buildHeader() { + writer.writeHeader( + classDoc, + configuration.getText("doclet.Method_Detail")); + } + + /** + * Build the header for the individual method. + */ + public void buildMethodHeader() { + writer.writeMethodHeader( + (MethodDoc) methods.get(currentMethodIndex), + currentMethodIndex == 0); + } + + /** + * Build the signature. + */ + public void buildSignature() { + writer.writeSignature((MethodDoc) methods.get(currentMethodIndex)); + } + + /** + * Build the deprecation information. + */ + public void buildDeprecationInfo() { + writer.writeDeprecated((MethodDoc) methods.get(currentMethodIndex)); + } + + /** + * Build the comments for the method. Do nothing if + * {@link Configuration#nocomment} is set to true. If this method + */ + public void buildMethodComments() { + if (!configuration.nocomment) { + MethodDoc method = (MethodDoc) methods.get(currentMethodIndex); + + if (method.inlineTags().length == 0) { + DocFinder.Output docs = DocFinder.search( + new DocFinder.Input(method)); + method = docs.inlineTags != null && docs.inlineTags.length > 0 ? + (MethodDoc) docs.holder : method; + + } + //NOTE: When we fix the bug where ClassDoc.interfaceTypes() does + // not pass all implemented interfaces, holder will be the + // interface type. For now, it is really the erasure. + writer.writeComments(method.containingClass(), method); + } + } + + + + /** + * Build the tag information. + */ + public void buildTagInfo() { + writer.writeTags((MethodDoc) methods.get(currentMethodIndex)); + } + + /** + * Build the footer of the method. + */ + public void buildMethodFooter() { + writer.writeMethodFooter(); + } + + /** + * Build the overall footer. + */ + public void buildFooter() { + writer.writeFooter(classDoc); + } + + /** + * Return the method writer for this builder. + * + * @return the method writer for this builder. + */ + public MethodWriter getWriter() { + return writer; + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java new file mode 100644 index 00000000000..262f0a3f86e --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java @@ -0,0 +1,285 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit.builders; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.javadoc.*; +import java.io.*; +import java.util.*; +import java.lang.reflect.*; + +/** + * Builds the summary for a given package. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ +public class PackageSummaryBuilder extends AbstractBuilder { + + /** + * The root element of the package summary XML is {@value}. + */ + public static final String ROOT = "PackageDoc"; + + /** + * The package being documented. + */ + private PackageDoc packageDoc; + + /** + * The doclet specific writer that will output the result. + */ + private PackageSummaryWriter packageWriter; + + private PackageSummaryBuilder(Configuration configuration) { + super(configuration); + } + + /** + * Construct a new PackageSummaryBuilder. + * @param configuration the current configuration of the doclet. + * @param pkg the package being documented. + * @param packageWriter the doclet specific writer that will output the + * result. + * + * @return an instance of a PackageSummaryBuilder. + */ + public static PackageSummaryBuilder getInstance( + Configuration configuration, + PackageDoc pkg, + PackageSummaryWriter packageWriter) { + PackageSummaryBuilder builder = + new PackageSummaryBuilder(configuration); + builder.packageDoc = pkg; + builder.packageWriter = packageWriter; + return builder; + } + + /** + * {@inheritDoc} + */ + public void invokeMethod( + String methodName, + Class[] paramClasses, + Object[] params) + throws Exception { + if (DEBUG) { + configuration.root.printError( + "DEBUG: " + this.getClass().getName() + "." + methodName); + } + Method method = this.getClass().getMethod(methodName, paramClasses); + method.invoke(this, params); + } + + /** + * Build the package summary. + */ + public void build() throws IOException { + if (packageWriter == null) { + //Doclet does not support this output. + return; + } + build(LayoutParser.getInstance(configuration).parseXML(ROOT)); + } + + /** + * {@inheritDoc} + */ + public String getName() { + return ROOT; + } + + /** + * Build the package documentation. + */ + public void buildPackageDoc(List elements) throws Exception { + build(elements); + packageWriter.close(); + Util.copyDocFiles( + configuration, + Util.getPackageSourcePath(configuration, packageDoc), + DirectoryManager.getDirectoryPath(packageDoc) + + File.separator + + DocletConstants.DOC_FILES_DIR_NAME, + true); + } + + /** + * Build the header of the summary. + */ + public void buildPackageHeader() { + packageWriter.writePackageHeader(Util.getPackageName(packageDoc)); + } + + /** + * Build the description of the summary. + */ + public void buildPackageDescription() { + if (configuration.nocomment) { + return; + } + packageWriter.writePackageDescription(); + } + + /** + * Build the tags of the summary. + */ + public void buildPackageTags() { + if (configuration.nocomment) { + return; + } + packageWriter.writePackageTags(); + } + + /** + * Build the package summary. + */ + public void buildSummary(List elements) { + build(elements); + } + + /** + * Build the overall header. + */ + public void buildSummaryHeader() { + packageWriter.writeSummaryHeader(); + } + + /** + * Build the overall footer. + */ + public void buildSummaryFooter() { + packageWriter.writeSummaryFooter(); + } + + /** + * Build the summary for the classes in this package. + */ + public void buildClassSummary() { + ClassDoc[] classes = + packageDoc.isIncluded() + ? packageDoc.ordinaryClasses() + : configuration.classDocCatalog.ordinaryClasses( + Util.getPackageName(packageDoc)); + if (classes.length > 0) { + packageWriter.writeClassesSummary( + classes, + configuration.getText("doclet.Class_Summary")); + } + } + + /** + * Build the summary for the interfaces in this package. + */ + public void buildInterfaceSummary() { + ClassDoc[] interfaces = + packageDoc.isIncluded() + ? packageDoc.interfaces() + : configuration.classDocCatalog.interfaces( + Util.getPackageName(packageDoc)); + if (interfaces.length > 0) { + packageWriter.writeClassesSummary( + interfaces, + configuration.getText("doclet.Interface_Summary")); + } + } + + /** + * Build the summary for the enums in this package. + */ + public void buildAnnotationTypeSummary() { + ClassDoc[] annotationTypes = + packageDoc.isIncluded() + ? packageDoc.annotationTypes() + : configuration.classDocCatalog.annotationTypes( + Util.getPackageName(packageDoc)); + if (annotationTypes.length > 0) { + packageWriter.writeClassesSummary( + annotationTypes, + configuration.getText("doclet.Annotation_Types_Summary")); + } + } + + /** + * Build the summary for the enums in this package. + */ + public void buildEnumSummary() { + ClassDoc[] enums = + packageDoc.isIncluded() + ? packageDoc.enums() + : configuration.classDocCatalog.enums( + Util.getPackageName(packageDoc)); + if (enums.length > 0) { + packageWriter.writeClassesSummary( + enums, + configuration.getText("doclet.Enum_Summary")); + } + } + + /** + * Build the summary for the exceptions in this package. + */ + public void buildExceptionSummary() { + ClassDoc[] exceptions = + packageDoc.isIncluded() + ? packageDoc.exceptions() + : configuration.classDocCatalog.exceptions( + Util.getPackageName(packageDoc)); + if (exceptions.length > 0) { + packageWriter.writeClassesSummary( + exceptions, + configuration.getText("doclet.Exception_Summary")); + } + } + + /** + * Build the summary for the errors in this package. + */ + public void buildErrorSummary() { + ClassDoc[] errors = + packageDoc.isIncluded() + ? packageDoc.errors() + : configuration.classDocCatalog.errors( + Util.getPackageName(packageDoc)); + if (errors.length > 0) { + packageWriter.writeClassesSummary( + errors, + configuration.getText("doclet.Error_Summary")); + } + } + + /** + * Build the footer of the summary. + */ + public void buildPackageFooter() { + packageWriter.writePackageFooter(); + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java new file mode 100644 index 00000000000..a7c9822a043 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java @@ -0,0 +1,504 @@ +/* + * Copyright 2003 Sun Microsystems, Inc. All Rights Reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. Sun designates this + * particular file as subject to the "Classpath" exception as provided + * by Sun in the LICENSE file that accompanied this code. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, + * CA 95054 USA or visit www.sun.com if you need additional information or + * have any questions. + */ + +package com.sun.tools.doclets.internal.toolkit.builders; + +import com.sun.tools.doclets.internal.toolkit.util.*; +import com.sun.tools.doclets.internal.toolkit.*; +import com.sun.javadoc.*; +import java.io.*; +import java.lang.reflect.*; +import java.util.*; + +/** + * Builds the serialized form. + * + * This code is not part of an API. + * It is implementation that is subject to change. + * Do not use it as an API + * + * @author Jamie Ho + * @since 1.5 + */ +public class SerializedFormBuilder extends AbstractBuilder { + + /** + * The root element of the serialized form XML is {@value}. + */ + public static final String NAME = "SerializedForm"; + + /** + * The writer for this builder. + */ + private SerializedFormWriter writer; + + /** + * The writer for serializable fields. + */ + private SerializedFormWriter.SerialFieldWriter fieldWriter; + + /** + * The writer for serializable method documentation. + */ + private SerializedFormWriter.SerialMethodWriter methodWriter; + + /** + * The header for the serial version UID. Save the string + * here instead of the properties file because we do not want + * this string to be localized. + */ + private static final String SERIAL_VERSION_UID_HEADER = "serialVersionUID:"; + + /** + * The current package being documented. + */ + private PackageDoc currentPackage; + + /** + * The current class being documented. + */ + private ClassDoc currentClass; + + /** + * The current member being documented. + */ + protected MemberDoc currentMember; + + private SerializedFormBuilder(Configuration configuration) { + super(configuration); + } + + /** + * Construct a new SerializedFormBuilder. + * @param configuration the current configuration of the doclet. + */ + public static SerializedFormBuilder getInstance(Configuration configuration) { + SerializedFormBuilder builder = new SerializedFormBuilder(configuration); + return builder; + } + + /** + * Build the serialized form. + */ + public void build() throws IOException { + if (! serialClassFoundToDocument(configuration.root.classes())) { + //Nothing to document. + return; + } + try { + writer = configuration.getWriterFactory().getSerializedFormWriter(); + if (writer == null) { + //Doclet does not support this output. + return; + } + } catch (Exception e) { + throw new DocletAbortException(); + } + build(LayoutParser.getInstance(configuration).parseXML(NAME)); + writer.close(); + } + + /** + * {@inheritDoc} + */ + public String getName() { + return NAME; + } + + /** + * Build the serialized form. + */ + public void buildSerializedForm(List elements) throws Exception { + build(elements); + writer.close(); + } + + /** + * {@inheritDoc} + */ + public void invokeMethod(String methodName, Class[] paramClasses, + Object[] params) + throws Exception { + if (DEBUG) { + configuration.root.printError("DEBUG: " + this.getClass().getName() + + "." + methodName); + } + Method method = this.getClass().getMethod(methodName, paramClasses); + method.invoke(this, params); + } + + /** + * Build the header. + */ + public void buildHeader() { + writer.writeHeader(configuration.getText("doclet.Serialized_Form")); + } + + /** + * Build the contents. + */ + public void buildSerializedFormSummaries(List elements) { + PackageDoc[] packages = configuration.packages; + for (int i = 0; i < packages.length; i++) { + currentPackage = packages[i]; + build(elements); + } + } + + /** + * Build the package serialized for for the current package being processed. + */ + public void buildPackageSerializedForm(List elements) { + String foo = currentPackage.name(); + ClassDoc[] classes = currentPackage.allClasses(false); + if (classes == null || classes.length == 0) { + return; + } + if (!serialInclude(currentPackage)) { + return; + } + if (!serialClassFoundToDocument(classes)) { + return; + } + build(elements); + } + + public void buildPackageHeader() { + writer.writePackageHeader(Util.getPackageName(currentPackage)); + } + + public void buildClassSerializedForm(List elements) { + ClassDoc[] classes = currentPackage.allClasses(false); + Arrays.sort(classes); + for (int j = 0; j < classes.length; j++) { + currentClass = classes[j]; + fieldWriter = writer.getSerialFieldWriter(currentClass); + methodWriter = writer.getSerialMethodWriter(currentClass); + if(currentClass.isClass() && currentClass.isSerializable()) { + if(!serialClassInclude(currentClass)) { + continue; + } + build(elements); + } + } + } + + public void buildClassHeader() { + writer.writeClassHeader(currentClass); + } + + /** + * Build the serial UID information for the given class. + */ + public void buildSerialUIDInfo() { + FieldDoc[] fields = currentClass.fields(false); + for (int i = 0; i < fields.length; i++) { + if (fields[i].name().equals("serialVersionUID") && + fields[i].constantValueExpression() != null) { + writer.writeSerialUIDInfo(SERIAL_VERSION_UID_HEADER, + fields[i].constantValueExpression()); + return; + } + } + } + + /** + * Build the footer. + */ + public void buildFooter() { + writer.writeFooter(); + } + + /** + * Return true if the given Doc should be included + * in the serialized form. + * + * @param doc the Doc object to check for serializability. + */ + public static boolean serialInclude(Doc doc) { + if (doc == null) { + return false; + } + return doc.isClass() ? + serialClassInclude((ClassDoc)doc) : + serialDocInclude(doc); + } + + /** + * Return true if the given ClassDoc should be included + * in the serialized form. + * + * @param cd the ClassDoc object to check for serializability. + */ + private static boolean serialClassInclude(ClassDoc cd) { + if (cd.isEnum()) { + return false; + } + try { + cd.superclassType(); + } catch (NullPointerException e) { + //Workaround for null pointer bug in ClassDoc.superclassType(). + return false; + } + if (cd.isSerializable()) { + if (cd.tags("serial").length > 0) { + return serialDocInclude(cd); + } else if (cd.isPublic() || cd.isProtected()) { + return true; + } else { + return false; + } + } + return false; + } + + /** + * Return true if the given Doc should be included + * in the serialized form. + * + * @param doc the Doc object to check for serializability. + */ + private static boolean serialDocInclude(Doc doc) { + if (doc.isEnum()) { + return false; + } + Tag[] serial = doc.tags("serial"); + if (serial.length > 0) { + String serialtext = serial[0].text().toLowerCase(); + if (serialtext.indexOf("exclude") >= 0) { + return false; + } else if (serialtext.indexOf("include") >= 0) { + return true; + } + } + return true; + } + + /** + * Return true if any of the given classes have a @serialinclude tag. + * + * @param classes the classes to check. + * @return true if any of the given classes have a @serialinclude tag. + */ + private boolean serialClassFoundToDocument(ClassDoc[] classes) { + for (int i = 0; i < classes.length; i++) { + if (serialClassInclude(classes[i])) { + return true; + } + } + return false; + } + + /** + * Build the method header. + */ + public void buildMethodHeader() { + if (currentClass.serializationMethods().length > 0) { + methodWriter.writeHeader( + configuration.getText("doclet.Serialized_Form_methods")); + if (currentClass.isSerializable() && !currentClass.isExternalizable()) { + if (currentClass.serializationMethods().length == 0) { + methodWriter.writeNoCustomizationMsg( + configuration.getText( + "doclet.Serializable_no_customization")); + } + } + } + } + + /** + * Build the method sub header. + */ + public void buildMethodSubHeader() { + methodWriter.writeMemberHeader((MethodDoc) currentMember); + } + + /** + * Build the deprecated method description. + */ + public void buildDeprecatedMethodInfo() { + methodWriter.writeDeprecatedMemberInfo((MethodDoc) currentMember); + } + + /** + * Build method tags. + */ + public void buildMethodDescription() { + methodWriter.writeMemberDescription((MethodDoc) currentMember); + } + + /** + * Build the method tags. + */ + public void buildMethodTags() { + methodWriter.writeMemberTags((MethodDoc) currentMember); + MethodDoc method = (MethodDoc)currentMember; + if (method.name().compareTo("writeExternal") == 0 + && method.tags("serialData").length == 0) { + if (configuration.serialwarn) { + configuration.getDocletSpecificMsg().warning( + currentMember.position(), "doclet.MissingSerialDataTag", + method.containingClass().qualifiedName(), method.name()); + } + } + } + + /** + * build the information for the method. + */ + public void buildMethodInfo(List elements) { + if(configuration.nocomment){ + return; + } + build(elements); + } + + /** + * Build the method footer. + */ + public void buildMethodFooter() { + methodWriter.writeMemberFooter((MethodDoc) currentMember); + } + + /** + * Build the field header. + */ + public void buildFieldHeader() { + if (currentClass.serializableFields().length > 0) { + buildFieldSerializationOverview(currentClass); + fieldWriter.writeHeader(configuration.getText( + "doclet.Serialized_Form_fields")); + } + } + + /** + * If possible, build the serialization overview for the given + * class. + * + * @param classDoc the class to print the overview for. + */ + public void buildFieldSerializationOverview(ClassDoc classDoc) { + if (classDoc.definesSerializableFields()) { + FieldDoc serialPersistentField = + (FieldDoc)((Util.asList(classDoc.serializableFields()).get(0))); + String comment = serialPersistentField.commentText(); + if (comment.length() > 0) { + fieldWriter.writeHeader( + configuration.getText("doclet.Serialized_Form_class")); + if (!configuration.nocomment) { + fieldWriter.writeMemberDeprecatedInfo(serialPersistentField); + fieldWriter.writeMemberDescription(serialPersistentField); + fieldWriter.writeMemberTags(serialPersistentField); + fieldWriter.writeMemberFooter(serialPersistentField); + } + } + } + } + + /** + * Build the field sub header. + */ + public void buildFieldSubHeader() { + if (! currentClass.definesSerializableFields() ){ + FieldDoc field = (FieldDoc) currentMember; + fieldWriter.writeMemberHeader(field.type().asClassDoc(), + field.type().typeName(), field.type().dimension(), field.name()); + } + } + + /** + * Build the field information. + */ + public void buildFieldInfo() { + if(configuration.nocomment){ + return; + } + FieldDoc field = (FieldDoc)currentMember; + ClassDoc cd = field.containingClass(); + if (cd.definesSerializableFields()) { + // Process Serializable Fields specified as array of + // ObjectStreamFields. Print a member for each serialField tag. + // (There should be one serialField tag per ObjectStreamField + // element.) + SerialFieldTag[] tags = field.serialFieldTags(); + Arrays.sort(tags); + for (int i = 0; i < tags.length; i++) { + fieldWriter.writeMemberHeader(tags[i].fieldTypeDoc(), + tags[i].fieldType(), "", tags[i].fieldName()); + fieldWriter.writeMemberDescription(tags[i]); + + } + } else { + + // Process default Serializable field. + if ((field.tags("serial").length == 0) && ! field.isSynthetic() + && configuration.serialwarn) { + configuration.message.warning(field.position(), + "doclet.MissingSerialTag", cd.qualifiedName(), + field.name()); + } + fieldWriter.writeMemberDeprecatedInfo(field); + fieldWriter.writeMemberDescription(field); + fieldWriter.writeMemberTags(field); + } + } + + /** + * Build the field footer. + */ + public void buildFieldFooter() { + if (! currentClass.definesSerializableFields()) { + fieldWriter.writeMemberFooter((FieldDoc) currentMember); + } + } + + /** + * Build the summaries for the methods that belong to the given + * class. + */ + public void buildSerializableMethods(List elements) { + MemberDoc[] members = currentClass.serializationMethods(); + if (members.length > 0) { + for (int i = 0; i < members.length; i++) { + currentMember = members[i]; + build(elements); + } + } + } + + /** + * Build the summaries for the fields that belong to the given + * class. + */ + public void buildSerializableFields(List elements) { + MemberDoc[] members = currentClass.serializableFields(); + if (members.length > 0) { + for (int i = 0; i < members.length; i++) { + currentMember = members[i]; + build(elements); + } + } + } +} diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/package.html b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/package.html new file mode 100644 index 00000000000..5afbd19b8db --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/builders/package.html @@ -0,0 +1,43 @@ + + + + +com.sun.tools.doclets.internal.toolkit.builders package + + + This doclet-independent package has a set of classes and + interfaces that are the building blocks for doclets. They + define the basic structure of doclets and make doclet + writing much easier because they provide the content generation + code to be shared among different doclets. Builders only provide + the structure and content of API documentation. + They will not provide any style markup. +

    + This code is not part of an API. + It is implementation that is subject to change. + Do not use it as an API. + + diff --git a/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/package.html b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/package.html new file mode 100644 index 00000000000..96141e8efe2 --- /dev/null +++ b/langtools/src/share/classes/com/sun/tools/doclets/internal/toolkit/package.html @@ -0,0 +1,55 @@ + + + + +com.sun.tools.doclets.internal.toolkit package + + + + Contains the base classes that make up a doclet. Doclets that reuse + the functionality provided by the toolkit should have the following + characteristics: +