forked from bjmashibing/java
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathPackage.html
More file actions
1026 lines (1006 loc) · 51.1 KB
/
Package.html
File metadata and controls
1026 lines (1006 loc) · 51.1 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
<!DOCTYPE HTML>
<!-- NewPage -->
<html lang="en">
<head>
<!-- Generated by javadoc -->
<title>Package (Java SE 12 & JDK 12 )</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="keywords" content="java.lang.Package class">
<meta name="keywords" content="getName()">
<meta name="keywords" content="getSpecificationTitle()">
<meta name="keywords" content="getSpecificationVersion()">
<meta name="keywords" content="getSpecificationVendor()">
<meta name="keywords" content="getImplementationTitle()">
<meta name="keywords" content="getImplementationVersion()">
<meta name="keywords" content="getImplementationVendor()">
<meta name="keywords" content="isSealed()">
<meta name="keywords" content="isCompatibleWith()">
<meta name="keywords" content="getPackage()">
<meta name="keywords" content="getPackages()">
<meta name="keywords" content="hashCode()">
<meta name="keywords" content="toString()">
<meta name="keywords" content="getAnnotation()">
<meta name="keywords" content="isAnnotationPresent()">
<meta name="keywords" content="getAnnotationsByType()">
<meta name="keywords" content="getAnnotations()">
<meta name="keywords" content="getDeclaredAnnotation()">
<meta name="keywords" content="getDeclaredAnnotationsByType()">
<meta name="keywords" content="getDeclaredAnnotations()">
<link rel="stylesheet" type="text/css" href="../../../stylesheet.css" title="Style">
<link rel="stylesheet" type="text/css" href="../../../jquery/jquery-ui.css" title="Style">
<script type="text/javascript" src="../../../script.js"></script>
<script type="text/javascript" src="../../../jquery/jszip/dist/jszip.min.js"></script>
<script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils.min.js"></script>
<!--[if IE]>
<script type="text/javascript" src="../../../jquery/jszip-utils/dist/jszip-utils-ie.min.js"></script>
<![endif]-->
<script type="text/javascript" src="../../../jquery/jquery-3.3.1.js"></script>
<script type="text/javascript" src="../../../jquery/jquery-migrate-3.0.1.js"></script>
<script type="text/javascript" src="../../../jquery/jquery-ui.js"></script>
</head>
<body>
<script type="text/javascript"><!--
try {
if (location.href.indexOf('is-external=true') == -1) {
parent.document.title="Package (Java SE 12 & JDK 12 )";
}
}
catch(err) {
}
//-->
var data = {"i0":10,"i1":10,"i2":10,"i3":10,"i4":10,"i5":10,"i6":10,"i7":10,"i8":10,"i9":10,"i10":41,"i11":9,"i12":10,"i13":10,"i14":10,"i15":10,"i16":10,"i17":10,"i18":10,"i19":10,"i20":10};
var tabs = {65535:["t0","All Methods"],1:["t1","Static Methods"],2:["t2","Instance Methods"],8:["t4","Concrete Methods"],32:["t6","Deprecated Methods"]};
var altColor = "altColor";
var rowColor = "rowColor";
var tableTab = "tableTab";
var activeTableTab = "activeTableTab";
var pathtoroot = "../../../";
var useModuleDirectories = true;
loadScripts(document, 'script');</script>
<noscript>
<div>JavaScript is disabled on your browser.</div>
</noscript>
<header role="banner">
<nav role="navigation">
<div class="fixedNav">
<!-- ========= START OF TOP NAVBAR ======= -->
<div class="topNav"><a id="navbar.top">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.top" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.top.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../index.html">Overview</a></li>
<li><a href="../../module-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Package.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><div style="margin-top: 14px;"><strong>Java SE 12 & JDK 12</strong> </div></div>
</div>
<div class="subNav">
<div>
<ul class="subNavList">
<li>Summary: </li>
<li>Nested | </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.summary">Method</a></li>
</ul>
<ul class="subNavList">
<li>Detail: </li>
<li>Field | </li>
<li>Constr | </li>
<li><a href="#method.detail">Method</a></li>
</ul>
</div>
<ul class="navListSearch">
<li><label for="search">SEARCH:</label>
<input type="text" id="search" value="search" disabled="disabled">
<input type="reset" id="reset" value="reset" disabled="disabled">
</li>
</ul>
</div>
<a id="skip.navbar.top">
<!-- -->
</a>
<!-- ========= END OF TOP NAVBAR ========= -->
</div>
<div class="navPadding"> </div>
<script type="text/javascript"><!--
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
//-->
</script>
</nav>
</header>
<!-- ======== START OF CLASS DATA ======== -->
<main role="main">
<div class="header">
<div class="subTitle"><span class="moduleLabelInType">Module</span> <a href="../../module-summary.html">java.base</a></div>
<div class="subTitle"><span class="packageLabelInType">Package</span> <a href="package-summary.html">java.lang</a></div>
<h2 title="Class Package" class="title">Class Package</h2>
</div>
<div class="contentContainer">
<ul class="inheritance">
<li><a href="Object.html" title="class in java.lang">java.lang.Object</a></li>
<li>
<ul class="inheritance">
<li>java.lang.Package</li>
</ul>
</li>
</ul>
<div class="description">
<ul class="blockList">
<li class="blockList">
<dl>
<dt>All Implemented Interfaces:</dt>
<dd><code><a href="reflect/AnnotatedElement.html" title="interface in java.lang.reflect">AnnotatedElement</a></code></dd>
</dl>
<hr>
<pre>public class <span class="typeNameLabel">Package</span>
extends <a href="Object.html" title="class in java.lang">Object</a>
implements <a href="reflect/AnnotatedElement.html" title="interface in java.lang.reflect">AnnotatedElement</a></pre>
<div class="block">Represents metadata about a run-time package associated with a class loader.
Metadata includes annotations, versioning, and sealing.
<p>
Annotations for the run-time package are read from <code>package-info.class</code>
at the same code source as classes in the run-time package.
<p>
The set of classes that make up the run-time package may implement a
particular specification. The specification title, version, and vendor
(indicating the owner/maintainer of the specification) can be provided
when the <code>Package</code> is defined. An application can ask if the
<code>Package</code> is compatible with a particular specification version
by using the <a href="#isCompatibleWith(java.lang.String)"><code>Package.isCompatibleWith(String)</code></a>
method. In addition, information about the actual classes that make up the
run-time package can be provided when the Package is defined.
This information consists of an implementation title, version, and vendor
(indicating the supplier of the classes).
<p>
A <code>Package</code> may be explicitly defined with
the <a href="ClassLoader.html#definePackage(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.net.URL)"><code>ClassLoader.definePackage(String, String, String, String,
String, String, String, URL)</code></a> method.
The caller supplies the specification and implementation titles, versions, and
vendors. The caller also indicates whether the package is
<a href="../util/jar/Attributes.Name.html#SEALED">sealed</a>.
If a <code>Package</code> is not explicitly defined for a run-time package when
a class in that run-time package is defined, then a <code>Package</code> is
automatically defined by the class's defining class loader, as follows.
<p>
A <code>Package</code> automatically defined for classes in a named module has
the following properties:
<ul>
<li>The name of the package is derived from the <a href="Class.html#getName()">binary names</a>
of the classes. Since classes in a named module must be in a named package,
the derived name is never empty.</li>
<li>The package is sealed with the <a href="module/ModuleReference.html#location()">module location</a> as the code source, if known.</li>
<li>The specification and implementation titles, versions, and vendors
are unspecified.</li>
<li>Any annotations on the package are read from <code>package-info.class</code>
as specified above.</li>
</ul>
<p>
A <code>Package</code> automatically defined for classes in an unnamed module
has the following properties:
<ul>
<li>The name of the package is either <code>""</code> (for classes in an unnamed package)
or derived from the <a href="Class.html#getName()">binary names</a> of the classes
(for classes in a named package).</li>
<li>The package is not sealed.</li>
<li>The specification and implementation titles, versions, and vendors
are unspecified.</li>
<li>Any annotations on the package are read from <code>package-info.class</code>
as specified above.</li>
</ul>
<p>
A <code>Package</code> can be obtained with the <a href="#getPackage(java.lang.String)"><code>Package.getPackage(String)</code></a> and <a href="ClassLoader.html#getDefinedPackage(java.lang.String)"><code>ClassLoader.getDefinedPackage(String)</code></a> methods.
Every <code>Package</code> defined by a class loader can be obtained
with the <a href="#getPackages()"><code>Package.getPackages()</code></a> and
<a href="ClassLoader.html#getDefinedPackages()"><code>ClassLoader.getDefinedPackages()</code></a> methods.</div>
<dl>
<dt><span class="simpleTagLabel">Implementation Note:</span></dt>
<dd>The <a href="ClassLoader.html#builtinLoaders">builtin class loaders</a>
do not explicitly define <code>Package</code> objects for packages in
<em>named modules</em>. Instead those packages are automatically defined
and have no specification and implementation versioning information.</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.2</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="../../../../specs/jar/jar.html#package-sealing">
The JAR File Specification: Package Sealing</a>,
<a href="ClassLoader.html#definePackage(java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.lang.String,java.net.URL)"><code>ClassLoader.definePackage(String, String, String, String, String, String, String, URL)</code></a></dd>
<dt><span class="simpleTagLabel">See <cite>The Java™ Virtual Machine Specification</cite>:</span></dt>
<dd>5.3 Run-time package</dd>
</dl>
</li>
</ul>
</div>
<div class="summary">
<ul class="blockList">
<li class="blockList">
<!-- ========== METHOD SUMMARY =========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.summary">
<!-- -->
</a>
<h3>Method Summary</h3>
<div class="memberSummary">
<div role="tablist" aria-orientation="horizontal"><button role="tab" aria-selected="true" aria-controls="memberSummary_tabpanel" tabindex="0" onkeydown="switchTab(event)" id="t0" class="activeTableTab">All Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t1" class="tableTab" onclick="show(1);">Static Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t2" class="tableTab" onclick="show(2);">Instance Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t4" class="tableTab" onclick="show(8);">Concrete Methods</button><button role="tab" aria-selected="false" aria-controls="memberSummary_tabpanel" tabindex="-1" onkeydown="switchTab(event)" id="t6" class="tableTab" onclick="show(32);">Deprecated Methods</button></div>
<div id="memberSummary_tabpanel" role="tabpanel">
<table aria-labelledby="t0">
<tr>
<th class="colFirst" scope="col">Modifier and Type</th>
<th class="colSecond" scope="col">Method</th>
<th class="colLast" scope="col">Description</th>
</tr>
<tbody>
<tr class="altColor" id="i0">
<td class="colFirst"><code><A extends <a href="annotation/Annotation.html" title="interface in java.lang.annotation">Annotation</a>><br>A</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAnnotation(java.lang.Class)">getAnnotation</a></span>​(<a href="Class.html" title="class in java.lang">Class</a><A> annotationClass)</code></th>
<td class="colLast">
<div class="block">Returns this element's annotation for the specified type if
such an annotation is <em>present</em>, else null.</div>
</td>
</tr>
<tr class="rowColor" id="i1">
<td class="colFirst"><code><a href="annotation/Annotation.html" title="interface in java.lang.annotation">Annotation</a>[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAnnotations()">getAnnotations</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns annotations that are <em>present</em> on this element.</div>
</td>
</tr>
<tr class="altColor" id="i2">
<td class="colFirst"><code><A extends <a href="annotation/Annotation.html" title="interface in java.lang.annotation">Annotation</a>><br>A[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getAnnotationsByType(java.lang.Class)">getAnnotationsByType</a></span>​(<a href="Class.html" title="class in java.lang">Class</a><A> annotationClass)</code></th>
<td class="colLast">
<div class="block">Returns annotations that are <em>associated</em> with this element.</div>
</td>
</tr>
<tr class="rowColor" id="i3">
<td class="colFirst"><code><A extends <a href="annotation/Annotation.html" title="interface in java.lang.annotation">Annotation</a>><br>A</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDeclaredAnnotation(java.lang.Class)">getDeclaredAnnotation</a></span>​(<a href="Class.html" title="class in java.lang">Class</a><A> annotationClass)</code></th>
<td class="colLast">
<div class="block">Returns this element's annotation for the specified type if
such an annotation is <em>directly present</em>, else null.</div>
</td>
</tr>
<tr class="altColor" id="i4">
<td class="colFirst"><code><a href="annotation/Annotation.html" title="interface in java.lang.annotation">Annotation</a>[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDeclaredAnnotations()">getDeclaredAnnotations</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns annotations that are <em>directly present</em> on this element.</div>
</td>
</tr>
<tr class="rowColor" id="i5">
<td class="colFirst"><code><A extends <a href="annotation/Annotation.html" title="interface in java.lang.annotation">Annotation</a>><br>A[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getDeclaredAnnotationsByType(java.lang.Class)">getDeclaredAnnotationsByType</a></span>​(<a href="Class.html" title="class in java.lang">Class</a><A> annotationClass)</code></th>
<td class="colLast">
<div class="block">Returns this element's annotation(s) for the specified type if
such annotations are either <em>directly present</em> or
<em>indirectly present</em>.</div>
</td>
</tr>
<tr class="altColor" id="i6">
<td class="colFirst"><code><a href="String.html" title="class in java.lang">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getImplementationTitle()">getImplementationTitle</a></span>()</code></th>
<td class="colLast">
<div class="block">Return the title of this package.</div>
</td>
</tr>
<tr class="rowColor" id="i7">
<td class="colFirst"><code><a href="String.html" title="class in java.lang">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getImplementationVendor()">getImplementationVendor</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the vendor that implemented this package, <code>null</code>
is returned if it is not known.</div>
</td>
</tr>
<tr class="altColor" id="i8">
<td class="colFirst"><code><a href="String.html" title="class in java.lang">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getImplementationVersion()">getImplementationVersion</a></span>()</code></th>
<td class="colLast">
<div class="block">Return the version of this implementation.</div>
</td>
</tr>
<tr class="rowColor" id="i9">
<td class="colFirst"><code><a href="String.html" title="class in java.lang">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getName()">getName</a></span>()</code></th>
<td class="colLast">
<div class="block">Return the name of this package.</div>
</td>
</tr>
<tr class="altColor" id="i10">
<td class="colFirst"><code>static <a href="Package.html" title="class in java.lang">Package</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPackage(java.lang.String)">getPackage</a></span>​(<a href="String.html" title="class in java.lang">String</a> name)</code></th>
<td class="colLast">
<div class="block"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">If multiple class loaders delegate to each other and define classes
with the same package name, and one such loader relies on the lookup
behavior of <code>getPackage</code> to return a <code>Package</code> from
a parent loader, then the properties exposed by the <code>Package</code>
may not be as expected in the rest of the program.</div>
</div>
</td>
</tr>
<tr class="rowColor" id="i11">
<td class="colFirst"><code>static <a href="Package.html" title="class in java.lang">Package</a>[]</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getPackages()">getPackages</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns all of the <code>Package</code>s defined by the caller's class loader
and its ancestors.</div>
</td>
</tr>
<tr class="altColor" id="i12">
<td class="colFirst"><code><a href="String.html" title="class in java.lang">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSpecificationTitle()">getSpecificationTitle</a></span>()</code></th>
<td class="colLast">
<div class="block">Return the title of the specification that this package implements.</div>
</td>
</tr>
<tr class="rowColor" id="i13">
<td class="colFirst"><code><a href="String.html" title="class in java.lang">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSpecificationVendor()">getSpecificationVendor</a></span>()</code></th>
<td class="colLast">
<div class="block">Return the name of the organization, vendor,
or company that owns and maintains the specification
of the classes that implement this package.</div>
</td>
</tr>
<tr class="altColor" id="i14">
<td class="colFirst"><code><a href="String.html" title="class in java.lang">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#getSpecificationVersion()">getSpecificationVersion</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the version number of the specification
that this package implements.</div>
</td>
</tr>
<tr class="rowColor" id="i15">
<td class="colFirst"><code>int</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#hashCode()">hashCode</a></span>()</code></th>
<td class="colLast">
<div class="block">Return the hash code computed from the package name.</div>
</td>
</tr>
<tr class="altColor" id="i16">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isAnnotationPresent(java.lang.Class)">isAnnotationPresent</a></span>​(<a href="Class.html" title="class in java.lang">Class</a><? extends <a href="annotation/Annotation.html" title="interface in java.lang.annotation">Annotation</a>> annotationClass)</code></th>
<td class="colLast">
<div class="block">Returns true if an annotation for the specified type
is <em>present</em> on this element, else false.</div>
</td>
</tr>
<tr class="rowColor" id="i17">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isCompatibleWith(java.lang.String)">isCompatibleWith</a></span>​(<a href="String.html" title="class in java.lang">String</a> desired)</code></th>
<td class="colLast">
<div class="block">Compare this package's specification version with a
desired version.</div>
</td>
</tr>
<tr class="altColor" id="i18">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isSealed()">isSealed</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns true if this package is sealed.</div>
</td>
</tr>
<tr class="rowColor" id="i19">
<td class="colFirst"><code>boolean</code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#isSealed(java.net.URL)">isSealed</a></span>​(<a href="../net/URL.html" title="class in java.net">URL</a> url)</code></th>
<td class="colLast">
<div class="block">Returns true if this package is sealed with respect to the specified
code source <code>url</code>.</div>
</td>
</tr>
<tr class="altColor" id="i20">
<td class="colFirst"><code><a href="String.html" title="class in java.lang">String</a></code></td>
<th class="colSecond" scope="row"><code><span class="memberNameLink"><a href="#toString()">toString</a></span>()</code></th>
<td class="colLast">
<div class="block">Returns the string representation of this Package.</div>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<ul class="blockList">
<li class="blockList"><a id="methods.inherited.from.class.java.lang.Object">
<!-- -->
</a>
<h3>Methods declared in class java.lang.<a href="Object.html" title="class in java.lang">Object</a></h3>
<code><a href="Object.html#clone()">clone</a>, <a href="Object.html#equals(java.lang.Object)">equals</a>, <a href="Object.html#finalize()">finalize</a>, <a href="Object.html#getClass()">getClass</a>, <a href="Object.html#notify()">notify</a>, <a href="Object.html#notifyAll()">notifyAll</a>, <a href="Object.html#wait()">wait</a>, <a href="Object.html#wait(long)">wait</a>, <a href="Object.html#wait(long,int)">wait</a></code></li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
<div class="details">
<ul class="blockList">
<li class="blockList">
<!-- ============ METHOD DETAIL ========== -->
<section role="region">
<ul class="blockList">
<li class="blockList"><a id="method.detail">
<!-- -->
</a>
<h3>Method Detail</h3>
<a id="getName()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getName</h4>
<pre class="methodSignature">public <a href="String.html" title="class in java.lang">String</a> getName()</pre>
<div class="block">Return the name of this package.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The fully-qualified name of this package as defined in section 6.5.3 of
<cite>The Java™ Language Specification</cite>,
for example, <code>java.lang</code></dd>
</dl>
</li>
</ul>
<a id="getSpecificationTitle()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSpecificationTitle</h4>
<pre class="methodSignature">public <a href="String.html" title="class in java.lang">String</a> getSpecificationTitle()</pre>
<div class="block">Return the title of the specification that this package implements.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the specification title, <code>null</code> is returned if it is not known.</dd>
</dl>
</li>
</ul>
<a id="getSpecificationVersion()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSpecificationVersion</h4>
<pre class="methodSignature">public <a href="String.html" title="class in java.lang">String</a> getSpecificationVersion()</pre>
<div class="block">Returns the version number of the specification
that this package implements.
This version string must be a sequence of non-negative decimal
integers separated by "."'s and may have leading zeros.
When version strings are compared the most significant
numbers are compared.
<p>Specification version numbers use a syntax that consists of non-negative
decimal integers separated by periods ".", for example "2.0" or
"1.2.3.4.5.6.7". This allows an extensible number to be used to represent
major, minor, micro, etc. versions. The version specification is described
by the following formal grammar:
<blockquote>
<dl>
<dt><i>SpecificationVersion:</i>
<dd><i>Digits RefinedVersion<sub>opt</sub></i>
<dt><i>RefinedVersion:</i>
<dd><code>.</code> <i>Digits</i>
<dd><code>.</code> <i>Digits RefinedVersion</i>
<dt><i>Digits:</i>
<dd><i>Digit</i>
<dd><i>Digits</i>
<dt><i>Digit:</i>
<dd>any character for which <a href="Character.html#isDigit(char)"><code>Character.isDigit(char)</code></a> returns <code>true</code>,
e.g. 0, 1, 2, ...
</dl>
</blockquote></div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the specification version, <code>null</code> is returned if it is not known.</dd>
</dl>
</li>
</ul>
<a id="getSpecificationVendor()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getSpecificationVendor</h4>
<pre class="methodSignature">public <a href="String.html" title="class in java.lang">String</a> getSpecificationVendor()</pre>
<div class="block">Return the name of the organization, vendor,
or company that owns and maintains the specification
of the classes that implement this package.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the specification vendor, <code>null</code> is returned if it is not known.</dd>
</dl>
</li>
</ul>
<a id="getImplementationTitle()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getImplementationTitle</h4>
<pre class="methodSignature">public <a href="String.html" title="class in java.lang">String</a> getImplementationTitle()</pre>
<div class="block">Return the title of this package.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the title of the implementation, <code>null</code> is returned if it is not known.</dd>
</dl>
</li>
</ul>
<a id="getImplementationVersion()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getImplementationVersion</h4>
<pre class="methodSignature">public <a href="String.html" title="class in java.lang">String</a> getImplementationVersion()</pre>
<div class="block">Return the version of this implementation. It consists of any string
assigned by the vendor of this implementation and does
not have any particular syntax specified or expected by the Java
runtime. It may be compared for equality with other
package version strings used for this implementation
by this vendor for this package.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the version of the implementation, <code>null</code> is returned if it is not known.</dd>
</dl>
</li>
</ul>
<a id="getImplementationVendor()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getImplementationVendor</h4>
<pre class="methodSignature">public <a href="String.html" title="class in java.lang">String</a> getImplementationVendor()</pre>
<div class="block">Returns the vendor that implemented this package, <code>null</code>
is returned if it is not known.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the vendor that implemented this package, <code>null</code>
is returned if it is not known.</dd>
</dl>
</li>
</ul>
<a id="isSealed()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSealed</h4>
<pre class="methodSignature">public boolean isSealed()</pre>
<div class="block">Returns true if this package is sealed.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if the package is sealed, false otherwise</dd>
</dl>
</li>
</ul>
<a id="isSealed(java.net.URL)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isSealed</h4>
<pre class="methodSignature">public boolean isSealed​(<a href="../net/URL.html" title="class in java.net">URL</a> url)</pre>
<div class="block">Returns true if this package is sealed with respect to the specified
code source <code>url</code>.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>url</code> - the code source URL</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if this package is sealed with respect to the given <code>url</code></dd>
</dl>
</li>
</ul>
<a id="isCompatibleWith(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isCompatibleWith</h4>
<pre class="methodSignature">public boolean isCompatibleWith​(<a href="String.html" title="class in java.lang">String</a> desired)
throws <a href="NumberFormatException.html" title="class in java.lang">NumberFormatException</a></pre>
<div class="block">Compare this package's specification version with a
desired version. It returns true if
this packages specification version number is greater than or equal
to the desired version number. <p>
Version numbers are compared by sequentially comparing corresponding
components of the desired and specification strings.
Each component is converted as a decimal integer and the values
compared.
If the specification value is greater than the desired
value true is returned. If the value is less false is returned.
If the values are equal the period is skipped and the next pair of
components is compared.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>desired</code> - the version string of the desired version.</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if this package's version number is greater
than or equal to the desired version number</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="NumberFormatException.html" title="class in java.lang">NumberFormatException</a></code> - if the current version is not known or
the desired or current version is not of the correct dotted form.</dd>
</dl>
</li>
</ul>
<a id="getPackage(java.lang.String)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPackage</h4>
<pre class="methodSignature"><a href="Deprecated.html" title="annotation in java.lang">@Deprecated</a>(<a href="Deprecated.html#since()">since</a>="9")
public static <a href="Package.html" title="class in java.lang">Package</a> getPackage​(<a href="String.html" title="class in java.lang">String</a> name)</pre>
<div class="deprecationBlock"><span class="deprecatedLabel">Deprecated.</span>
<div class="deprecationComment">If multiple class loaders delegate to each other and define classes
with the same package name, and one such loader relies on the lookup
behavior of <code>getPackage</code> to return a <code>Package</code> from
a parent loader, then the properties exposed by the <code>Package</code>
may not be as expected in the rest of the program.
For example, the <code>Package</code> will only expose annotations from the
<code>package-info.class</code> file defined by the parent loader, even if
annotations exist in a <code>package-info.class</code> file defined by
a child loader. A more robust approach is to use the
<a href="ClassLoader.html#getDefinedPackage(java.lang.String)"><code>ClassLoader.getDefinedPackage(java.lang.String)</code></a> method which returns
a <code>Package</code> for the specified class loader.</div>
</div>
<div class="block">Finds a package by name in the caller's class loader and its
ancestors.
<p>
If the caller's class loader defines a <code>Package</code> of the given name,
the <code>Package</code> is returned. Otherwise, the ancestors of the
caller's class loader are searched recursively (parent by parent)
for a <code>Package</code> of the given name.
<p>
Calling this method is equivalent to calling <a href="ClassLoader.html#getPackage(java.lang.String)"><code>ClassLoader.getPackage(java.lang.String)</code></a>
on a <code>ClassLoader</code> instance which is the caller's class loader.</div>
<dl>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>name</code> - A package name, such as "<code>java.lang</code>".</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The <code>Package</code> of the given name defined by the caller's
class loader or its ancestors, or <code>null</code> if not found.</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if <code>name</code> is <code>null</code>.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="ClassLoader.html#getDefinedPackage(java.lang.String)"><code>ClassLoader.getDefinedPackage(java.lang.String)</code></a></dd>
</dl>
</li>
</ul>
<a id="getPackages()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getPackages</h4>
<pre class="methodSignature">public static <a href="Package.html" title="class in java.lang">Package</a>[] getPackages()</pre>
<div class="block">Returns all of the <code>Package</code>s defined by the caller's class loader
and its ancestors. The returned array may contain more than one
<code>Package</code> object of the same package name, each defined by
a different class loader in the class loader hierarchy.
<p>
Calling this method is equivalent to calling <a href="ClassLoader.html#getPackages()"><code>ClassLoader.getPackages()</code></a>
on a <code>ClassLoader</code> instance which is the caller's class loader.</div>
<dl>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>The array of <code>Package</code> objects defined by this
class loader and its ancestors</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="ClassLoader.html#getDefinedPackages()"><code>ClassLoader.getDefinedPackages()</code></a></dd>
</dl>
</li>
</ul>
<a id="hashCode()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>hashCode</h4>
<pre class="methodSignature">public int hashCode()</pre>
<div class="block">Return the hash code computed from the package name.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="Object.html#hashCode()">hashCode</a></code> in class <code><a href="Object.html" title="class in java.lang">Object</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the hash code computed from the package name.</dd>
<dt><span class="seeLabel">See Also:</span></dt>
<dd><a href="Object.html#equals(java.lang.Object)"><code>Object.equals(java.lang.Object)</code></a>,
<a href="System.html#identityHashCode(java.lang.Object)"><code>System.identityHashCode(java.lang.Object)</code></a></dd>
</dl>
</li>
</ul>
<a id="toString()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>toString</h4>
<pre class="methodSignature">public <a href="String.html" title="class in java.lang">String</a> toString()</pre>
<div class="block">Returns the string representation of this Package.
Its value is the string "package " and the package name.
If the package title is defined it is appended.
If the package version is defined it is appended.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Overrides:</span></dt>
<dd><code><a href="Object.html#toString()">toString</a></code> in class <code><a href="Object.html" title="class in java.lang">Object</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>the string representation of the package.</dd>
</dl>
</li>
</ul>
<a id="getAnnotation(java.lang.Class)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAnnotation</h4>
<pre class="methodSignature">public <A extends <a href="annotation/Annotation.html" title="interface in java.lang.annotation">Annotation</a>> A getAnnotation​(<a href="Class.html" title="class in java.lang">Class</a><A> annotationClass)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="reflect/AnnotatedElement.html#getAnnotation(java.lang.Class)">AnnotatedElement</a></code></span></div>
<div class="block">Returns this element's annotation for the specified type if
such an annotation is <em>present</em>, else null.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="reflect/AnnotatedElement.html#getAnnotation(java.lang.Class)">getAnnotation</a></code> in interface <code><a href="reflect/AnnotatedElement.html" title="interface in java.lang.reflect">AnnotatedElement</a></code></dd>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>A</code> - the type of the annotation to query for and return if present</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>annotationClass</code> - the Class object corresponding to the
annotation type</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this element's annotation for the specified annotation type if
present on this element, else null</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the given annotation class is null</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.5</dd>
</dl>
</li>
</ul>
<a id="isAnnotationPresent(java.lang.Class)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>isAnnotationPresent</h4>
<pre class="methodSignature">public boolean isAnnotationPresent​(<a href="Class.html" title="class in java.lang">Class</a><? extends <a href="annotation/Annotation.html" title="interface in java.lang.annotation">Annotation</a>> annotationClass)</pre>
<div class="block">Returns true if an annotation for the specified type
is <em>present</em> on this element, else false. This method
is designed primarily for convenient access to marker annotations.
<p>The truth value returned by this method is equivalent to:
<code>getAnnotation(annotationClass) != null</code>
<p>The body of the default method is specified to be the code
above.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="reflect/AnnotatedElement.html#isAnnotationPresent(java.lang.Class)">isAnnotationPresent</a></code> in interface <code><a href="reflect/AnnotatedElement.html" title="interface in java.lang.reflect">AnnotatedElement</a></code></dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>annotationClass</code> - the Class object corresponding to the
annotation type</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>true if an annotation for the specified annotation
type is present on this element, else false</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the given annotation class is null</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.5</dd>
</dl>
</li>
</ul>
<a id="getAnnotationsByType(java.lang.Class)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAnnotationsByType</h4>
<pre class="methodSignature">public <A extends <a href="annotation/Annotation.html" title="interface in java.lang.annotation">Annotation</a>> A[] getAnnotationsByType​(<a href="Class.html" title="class in java.lang">Class</a><A> annotationClass)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="reflect/AnnotatedElement.html#getAnnotationsByType(java.lang.Class)">AnnotatedElement</a></code></span></div>
<div class="block">Returns annotations that are <em>associated</em> with this element.
If there are no annotations <em>associated</em> with this element, the return
value is an array of length 0.
The difference between this method and <a href="reflect/AnnotatedElement.html#getAnnotation(java.lang.Class)"><code>AnnotatedElement.getAnnotation(Class)</code></a>
is that this method detects if its argument is a <em>repeatable
annotation type</em> (JLS 9.6), and if so, attempts to find one or
more annotations of that type by "looking through" a container
annotation.
The caller of this method is free to modify the returned array; it will
have no effect on the arrays returned to other callers.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="reflect/AnnotatedElement.html#getAnnotationsByType(java.lang.Class)">getAnnotationsByType</a></code> in interface <code><a href="reflect/AnnotatedElement.html" title="interface in java.lang.reflect">AnnotatedElement</a></code></dd>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>A</code> - the type of the annotation to query for and return if present</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>annotationClass</code> - the Class object corresponding to the
annotation type</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>all this element's annotations for the specified annotation type if
associated with this element, else an array of length zero</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the given annotation class is null</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.8</dd>
</dl>
</li>
</ul>
<a id="getAnnotations()">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getAnnotations</h4>
<pre class="methodSignature">public <a href="annotation/Annotation.html" title="interface in java.lang.annotation">Annotation</a>[] getAnnotations()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="reflect/AnnotatedElement.html#getAnnotations()">AnnotatedElement</a></code></span></div>
<div class="block">Returns annotations that are <em>present</em> on this element.
If there are no annotations <em>present</em> on this element, the return
value is an array of length 0.
The caller of this method is free to modify the returned array; it will
have no effect on the arrays returned to other callers.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="reflect/AnnotatedElement.html#getAnnotations()">getAnnotations</a></code> in interface <code><a href="reflect/AnnotatedElement.html" title="interface in java.lang.reflect">AnnotatedElement</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>annotations present on this element</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.5</dd>
</dl>
</li>
</ul>
<a id="getDeclaredAnnotation(java.lang.Class)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDeclaredAnnotation</h4>
<pre class="methodSignature">public <A extends <a href="annotation/Annotation.html" title="interface in java.lang.annotation">Annotation</a>> A getDeclaredAnnotation​(<a href="Class.html" title="class in java.lang">Class</a><A> annotationClass)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="reflect/AnnotatedElement.html#getDeclaredAnnotation(java.lang.Class)">AnnotatedElement</a></code></span></div>
<div class="block">Returns this element's annotation for the specified type if
such an annotation is <em>directly present</em>, else null.
This method ignores inherited annotations. (Returns null if no
annotations are directly present on this element.)</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="reflect/AnnotatedElement.html#getDeclaredAnnotation(java.lang.Class)">getDeclaredAnnotation</a></code> in interface <code><a href="reflect/AnnotatedElement.html" title="interface in java.lang.reflect">AnnotatedElement</a></code></dd>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>A</code> - the type of the annotation to query for and return if directly present</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>annotationClass</code> - the Class object corresponding to the
annotation type</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>this element's annotation for the specified annotation type if
directly present on this element, else null</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the given annotation class is null</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.8</dd>
</dl>
</li>
</ul>
<a id="getDeclaredAnnotationsByType(java.lang.Class)">
<!-- -->
</a>
<ul class="blockList">
<li class="blockList">
<h4>getDeclaredAnnotationsByType</h4>
<pre class="methodSignature">public <A extends <a href="annotation/Annotation.html" title="interface in java.lang.annotation">Annotation</a>> A[] getDeclaredAnnotationsByType​(<a href="Class.html" title="class in java.lang">Class</a><A> annotationClass)</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="reflect/AnnotatedElement.html#getDeclaredAnnotationsByType(java.lang.Class)">AnnotatedElement</a></code></span></div>
<div class="block">Returns this element's annotation(s) for the specified type if
such annotations are either <em>directly present</em> or
<em>indirectly present</em>. This method ignores inherited
annotations.
If there are no specified annotations directly or indirectly
present on this element, the return value is an array of length
0.
The difference between this method and <a href="reflect/AnnotatedElement.html#getDeclaredAnnotation(java.lang.Class)"><code>AnnotatedElement.getDeclaredAnnotation(Class)</code></a> is that this method detects if its
argument is a <em>repeatable annotation type</em> (JLS 9.6), and if so,
attempts to find one or more annotations of that type by "looking
through" a container annotation if one is present.
The caller of this method is free to modify the returned array; it will
have no effect on the arrays returned to other callers.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="reflect/AnnotatedElement.html#getDeclaredAnnotationsByType(java.lang.Class)">getDeclaredAnnotationsByType</a></code> in interface <code><a href="reflect/AnnotatedElement.html" title="interface in java.lang.reflect">AnnotatedElement</a></code></dd>
<dt><span class="paramLabel">Type Parameters:</span></dt>
<dd><code>A</code> - the type of the annotation to query for and return
if directly or indirectly present</dd>
<dt><span class="paramLabel">Parameters:</span></dt>
<dd><code>annotationClass</code> - the Class object corresponding to the
annotation type</dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>all this element's annotations for the specified annotation type if
directly or indirectly present on this element, else an array of length zero</dd>
<dt><span class="throwsLabel">Throws:</span></dt>
<dd><code><a href="NullPointerException.html" title="class in java.lang">NullPointerException</a></code> - if the given annotation class is null</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.8</dd>
</dl>
</li>
</ul>
<a id="getDeclaredAnnotations()">
<!-- -->
</a>
<ul class="blockListLast">
<li class="blockList">
<h4>getDeclaredAnnotations</h4>
<pre class="methodSignature">public <a href="annotation/Annotation.html" title="interface in java.lang.annotation">Annotation</a>[] getDeclaredAnnotations()</pre>
<div class="block"><span class="descfrmTypeLabel">Description copied from interface: <code><a href="reflect/AnnotatedElement.html#getDeclaredAnnotations()">AnnotatedElement</a></code></span></div>
<div class="block">Returns annotations that are <em>directly present</em> on this element.
This method ignores inherited annotations.
If there are no annotations <em>directly present</em> on this element,
the return value is an array of length 0.
The caller of this method is free to modify the returned array; it will
have no effect on the arrays returned to other callers.</div>
<dl>
<dt><span class="overrideSpecifyLabel">Specified by:</span></dt>
<dd><code><a href="reflect/AnnotatedElement.html#getDeclaredAnnotations()">getDeclaredAnnotations</a></code> in interface <code><a href="reflect/AnnotatedElement.html" title="interface in java.lang.reflect">AnnotatedElement</a></code></dd>
<dt><span class="returnLabel">Returns:</span></dt>
<dd>annotations directly present on this element</dd>
<dt><span class="simpleTagLabel">Since:</span></dt>
<dd>1.5</dd>
</dl>
</li>
</ul>
</li>
</ul>
</section>
</li>
</ul>
</div>
</div>
</main>
<!-- ========= END OF CLASS DATA ========= -->
<footer role="contentinfo">
<nav role="navigation">
<!-- ======= START OF BOTTOM NAVBAR ====== -->
<div class="bottomNav"><a id="navbar.bottom">
<!-- -->
</a>
<div class="skipNav"><a href="#skip.navbar.bottom" title="Skip navigation links">Skip navigation links</a></div>
<a id="navbar.bottom.firstrow">
<!-- -->
</a>
<ul class="navList" title="Navigation">
<li><a href="../../../index.html">Overview</a></li>
<li><a href="../../module-summary.html">Module</a></li>
<li><a href="package-summary.html">Package</a></li>
<li class="navBarCell1Rev">Class</li>
<li><a href="class-use/Package.html">Use</a></li>
<li><a href="package-tree.html">Tree</a></li>
<li><a href="../../../deprecated-list.html">Deprecated</a></li>
<li><a href="../../../index-files/index-1.html">Index</a></li>
<li><a href="../../../help-doc.html">Help</a></li>
</ul>
<div class="aboutLanguage"><div style="margin-top: 14px;"><strong>Java SE 12 & JDK 12</strong> </div></div>
</div>