Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Merge pull request #1528 from maacl/patch-1
Fix annotation collections for clojure
- Loading branch information
Showing
3 changed files
with
69 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
(<span class="hljs-name"><span class="hljs-builtin-name">import</span></span> [java.lang.annotation Retention RetentionPolicy Target ElementType] | ||
[javax.xml.ws WebServiceRef WebServiceRefs]) | ||
|
||
(<span class="hljs-name">definterface</span> Foo (<span class="hljs-name">foo</span> [])) | ||
|
||
<span class="hljs-comment">;; annotation on type</span> | ||
(<span class="hljs-name"><span class="hljs-builtin-name">deftype</span></span> <span class="hljs-comment">^{Deprecated true | ||
Retention RetentionPolicy/RUNTIME | ||
javax.annotation.processing.SupportedOptions [<span class="hljs-string">"foo"</span> <span class="hljs-string">"bar"</span> <span class="hljs-string">"baz"</span>] | ||
javax.xml.ws.soap.Addressing {<span class="hljs-symbol">:enabled</span> <span class="hljs-literal">false</span> <span class="hljs-symbol">:required</span> <span class="hljs-literal">true</span>} | ||
WebServiceRefs [(<span class="hljs-name">WebServiceRef</span> {<span class="hljs-symbol">:name</span> <span class="hljs-string">"fred"</span> <span class="hljs-symbol">:type</span> String}) | ||
(<span class="hljs-name">WebServiceRef</span> {<span class="hljs-symbol">:name</span> <span class="hljs-string">"ethel"</span> <span class="hljs-symbol">:mappedName</span> <span class="hljs-string">"lucy"</span>})]}</span> | ||
Bar [<span class="hljs-comment">^int</span> a | ||
<span class="hljs-comment">;; on field</span> | ||
<span class="hljs-comment">^{:tag int | ||
Deprecated true | ||
Retention RetentionPolicy/RUNTIME | ||
javax.annotation.processing.SupportedOptions [<span class="hljs-string">"foo"</span> <span class="hljs-string">"bar"</span> <span class="hljs-string">"baz"</span>] | ||
javax.xml.ws.soap.Addressing {<span class="hljs-symbol">:enabled</span> <span class="hljs-literal">false</span> <span class="hljs-symbol">:required</span> <span class="hljs-literal">true</span>} | ||
WebServiceRefs [(<span class="hljs-name">WebServiceRef</span> {<span class="hljs-symbol">:name</span> <span class="hljs-string">"fred"</span> <span class="hljs-symbol">:type</span> String}) | ||
(<span class="hljs-name">WebServiceRef</span> {<span class="hljs-symbol">:name</span> <span class="hljs-string">"ethel"</span> <span class="hljs-symbol">:mappedName</span> <span class="hljs-string">"lucy"</span>})]}</span> | ||
b] | ||
<span class="hljs-comment">;; on method</span> | ||
Foo (<span class="hljs-comment">^{Deprecated true | ||
Retention RetentionPolicy/RUNTIME | ||
javax.annotation.processing.SupportedOptions [<span class="hljs-string">"foo"</span> <span class="hljs-string">"bar"</span> <span class="hljs-string">"baz"</span>] | ||
javax.xml.ws.soap.Addressing {<span class="hljs-symbol">:enabled</span> <span class="hljs-literal">false</span> <span class="hljs-symbol">:required</span> <span class="hljs-literal">true</span>} | ||
WebServiceRefs [(<span class="hljs-name">WebServiceRef</span> {<span class="hljs-symbol">:name</span> <span class="hljs-string">"fred"</span> <span class="hljs-symbol">:type</span> String}) | ||
(<span class="hljs-name">WebServiceRef</span> {<span class="hljs-symbol">:name</span> <span class="hljs-string">"ethel"</span> <span class="hljs-symbol">:mappedName</span> <span class="hljs-string">"lucy"</span>})]}</span> | ||
foo [this] <span class="hljs-number">42</span>)) | ||
|
||
(<span class="hljs-name"><span class="hljs-builtin-name">seq</span></span> (<span class="hljs-name">.getAnnotations</span> Bar)) | ||
(<span class="hljs-name"><span class="hljs-builtin-name">seq</span></span> (<span class="hljs-name">.getAnnotations</span> (<span class="hljs-name">.getField</span> Bar <span class="hljs-string">"b"</span>))) | ||
(<span class="hljs-name"><span class="hljs-builtin-name">seq</span></span> (<span class="hljs-name">.getAnnotations</span> (<span class="hljs-name">.getMethod</span> Bar <span class="hljs-string">"foo"</span> <span class="hljs-literal">nil</span>))) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
(import [java.lang.annotation Retention RetentionPolicy Target ElementType] | ||
[javax.xml.ws WebServiceRef WebServiceRefs]) | ||
|
||
(definterface Foo (foo [])) | ||
|
||
;; annotation on type | ||
(deftype ^{Deprecated true | ||
Retention RetentionPolicy/RUNTIME | ||
javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"] | ||
javax.xml.ws.soap.Addressing {:enabled false :required true} | ||
WebServiceRefs [(WebServiceRef {:name "fred" :type String}) | ||
(WebServiceRef {:name "ethel" :mappedName "lucy"})]} | ||
Bar [^int a | ||
;; on field | ||
^{:tag int | ||
Deprecated true | ||
Retention RetentionPolicy/RUNTIME | ||
javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"] | ||
javax.xml.ws.soap.Addressing {:enabled false :required true} | ||
WebServiceRefs [(WebServiceRef {:name "fred" :type String}) | ||
(WebServiceRef {:name "ethel" :mappedName "lucy"})]} | ||
b] | ||
;; on method | ||
Foo (^{Deprecated true | ||
Retention RetentionPolicy/RUNTIME | ||
javax.annotation.processing.SupportedOptions ["foo" "bar" "baz"] | ||
javax.xml.ws.soap.Addressing {:enabled false :required true} | ||
WebServiceRefs [(WebServiceRef {:name "fred" :type String}) | ||
(WebServiceRef {:name "ethel" :mappedName "lucy"})]} | ||
foo [this] 42)) | ||
|
||
(seq (.getAnnotations Bar)) | ||
(seq (.getAnnotations (.getField Bar "b"))) | ||
(seq (.getAnnotations (.getMethod Bar "foo" nil))) |