Skip to content

Commit 1c57d60

Browse files
authored
disallow {@code} in javadoc (#2191)
* disallow {@code} in Javadoc * cleanup * resolve * rollback * replace @code * replace @code * cleanup
1 parent f37e1e5 commit 1c57d60

File tree

16 files changed

+74
-92
lines changed

16 files changed

+74
-92
lines changed

annot/src/main/java/com/predic8/membrane/annot/model/doc/Doc.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,6 +113,10 @@ private void handle(String key, String value) {
113113
return;
114114
}
115115

116+
if (value.contains("{@code")) {
117+
processingEnv.getMessager().printMessage(Kind.ERROR, "@code not allowed!", e);
118+
}
119+
116120
keys.add(key);
117121
entries.add(new Entry(key, value));
118122
}

core/src/main/java/com/predic8/membrane/core/config/security/Store.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public String getType() {
8585
}
8686

8787
/**
88-
* @description Keystore type (e.g., {@code PKCS12}, {@code JKS}).
88+
* @description Keystore type (e.g., <code>PKCS12</code>, <code>JKS</code>).
8989
*/
9090
@MCAttribute
9191
public void setType(String type) {

core/src/main/java/com/predic8/membrane/core/interceptor/Outcome.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
package com.predic8.membrane.core.interceptor;
1515

1616
/**
17-
* Also see {@link InterceptorFlowController}.
17+
* Also see {@link FlowController}.
1818
*/
1919
public enum Outcome {
2020

core/src/main/java/com/predic8/membrane/core/interceptor/apikey/ApiKeysInterceptor.java

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -151,8 +151,8 @@ public Optional<LocationNameValue> getKey(Exchange exc) {
151151
}
152152

153153
/**
154-
* @description Controls whether API key validation is enforced. If set to {@code false}, the interceptor still extracts
155-
* keys and loads scopes so they remain available for downstream checks (e.g., via {@code hasScope("...")}), but requests
154+
* @description Controls whether API key validation is enforced. If set to <code>false</code>, the interceptor still extracts
155+
* keys and loads scopes so they remain available for downstream checks (e.g., via <code>hasScope("...")</code>), but requests
156156
* without a valid key are allowed to pass.
157157
* @default true
158158
* @example false
@@ -173,12 +173,11 @@ public boolean isRequired() {
173173
* <p>
174174
* Example:
175175
* </p>
176-
* <pre><code>
177-
* &lt;apiKey&gt;
178-
* &lt;!-- store elements; order does not matter --&gt;
179-
* &lt;yourFileStore src="classpath:keys.txt"/&gt;
180-
* &lt;yourXmlStore ref="sharedKeysBean"/&gt;
181-
* &lt;/apiKey&gt;</code></pre>
176+
* <pre><code><apiKey>
177+
* <!-- store elements; order does not matter -->
178+
* <yourFileStore src="classpath:keys.txt"/>
179+
* <yourXmlStore ref="sharedKeysBean"/>;
180+
* </apiKey></code></pre>
182181
*/
183182
@MCChildElement(allowForeign = true)
184183
public void setStores(List<ApiKeyStore> stores) {
@@ -192,7 +191,7 @@ public List<ApiKeyStore> getStores() {
192191
/**
193192
* @description Configures how and where API keys are extracted from requests (e.g., HTTP header or URL query parameter).
194193
* Provide one or more extractor elements. If omitted, a header extractor using <code>X-Api-Key</code> is used.
195-
* @default &lt;headerExtractor /&gt; (header name <code>X-Api-Key</code>)
194+
* @default <headerExtractor /> (header name <code>X-Api-Key</code>)
196195
* <p>
197196
* Examples:
198197
* </p>

core/src/main/java/com/predic8/membrane/core/interceptor/apikey/extractors/ApiKeyExpressionExtractor.java

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -30,19 +30,17 @@
3030
/**
3131
* @description Extracts an API key by evaluating an expression on the incoming request.
3232
* The result (a string) is treated as the API key. The expression is evaluated in the configured language
33-
* (default: {@code SPEL}) during the request flow.
33+
* (default: <code>SPEL</code>) during the request flow.
3434
* <p>
35-
* Typical usage inside {@code &lt;apiKey&gt;}:
35+
* Typical usage inside <code>&lt;apiKey&gt;</code>:
3636
* </p>
37-
* <pre>
38-
* &lt;apiKey&gt;
39-
* &lt;expressionExtractor
37+
* <pre><code><apiKey>
38+
* <expressionExtractor
4039
* language="SPEL"
41-
* expression="request.headers['X-Api-Key']"/&gt;
42-
* &lt;/apiKey&gt;
43-
* </pre>
40+
* expression="request.headers['X-Api-Key']"/>
41+
* </apiKey></code></pre>
4442
* <p>
45-
* If the expression evaluates to {@code null} or an empty string, no key is extracted.
43+
* If the expression evaluates to <code>null</code> or an empty string, no key is extracted.
4644
* </p>
4745
* @topic 3. Security and Validation
4846
*/
@@ -88,11 +86,8 @@ public String getExpression() {
8886
* <p>
8987
* Examples (SPEL):
9088
* </p>
91-
* <pre>
92-
* expression="request.headers['X-Api-Key']"
93-
*
94-
* expression="request.query['api_key']"
95-
* </pre>
89+
* <pre><code>expression="request.headers['X-Api-Key']"
90+
* expression="request.query['api_key']"</code></pre>
9691
*/
9792
@MCAttribute
9893
public void setExpression(String expression) {

core/src/main/java/com/predic8/membrane/core/interceptor/apikey/extractors/ApiKeyHeaderExtractor.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -23,18 +23,16 @@
2323

2424
/**
2525
* @description Extracts an API key from a specific HTTP request header. By default, the header name
26-
* is {@code X-Api-Key}. If the header is present, its first value is returned as the API key.
26+
* is <code>X-Api-Key</code>. If the header is present, its first value is returned as the API key.
2727
* <p>
28-
* Example usage inside {@code &lt;apiKey&gt;}:
28+
* Example usage inside <code>&lt;apiKey&gt;</code>:
2929
* </p>
30-
* <pre>
31-
* &lt;apiKey&gt;
32-
* &lt;headerExtractor /&gt; <!-- default: X-Api-Key -->
30+
* <pre><code><apiKey>
31+
* <headerExtractor /> <!-- default: X-Api-Key -->
3332
*
34-
* &lt;!-- custom header name --&gt;
35-
* &lt;headerExtractor name="Authorization"/&gt;
36-
* &lt;/apiKey&gt;
37-
* </pre>
33+
* <!-- custom header name -->
34+
* <headerExtractor name="Authorization"/>
35+
* </apiKey></code></pre>
3836
* @topic 3. Security and Validation
3937
*/
4038
@MCElement(name="headerExtractor", topLevel = false)

core/src/main/java/com/predic8/membrane/core/interceptor/apikey/extractors/ApiKeyQueryParamExtractor.java

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -28,19 +28,17 @@
2828

2929
/**
3030
* @description Extracts an API key from a URL query parameter. By default, the parameter name
31-
* is {@code api-key}. If the parameter is present in the request URI, its value is returned as the API key.
31+
* is <code>api-key</code>. If the parameter is present in the request URI, its value is returned as the API key.
3232
* Parameter name matching is case-insensitive.
3333
* <p>
34-
* Example usage inside {@code &lt;apiKey&gt;}:
34+
* Example usage inside <code>&lt;apiKey&gt;</code>:
3535
* </p>
36-
* <pre>
37-
* &lt;apiKey&gt;
38-
* &lt;queryParamExtractor /&gt; <!-- default: api-key -->
36+
* <pre><code><apiKey>
37+
* <queryParamExtractor /> <!-- default: api-key -->
3938
*
40-
* &lt;!-- custom parameter name --&gt;
41-
* &lt;queryParamExtractor name="api_key"/&gt;
42-
* &lt;/apiKey&gt;
43-
* </pre>
39+
* <!-- custom parameter name -->
40+
* <queryParamExtractor name="api_key"/>
41+
* </apiKey></code></pre>
4442
* @topic 3. Security and Validation
4543
*/
4644
@MCElement(name="queryParamExtractor", topLevel = false)

core/src/main/java/com/predic8/membrane/core/interceptor/apikey/stores/ApiKeyFileStore.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@
3232
* @description Loads API keys and optional scopes from a text file. Each non-empty line must contain a key.
3333
* <ul>
3434
* <li>Blank lines are ignored.</li>
35-
* <li>A hash sign ({@code #}) starts a comment (line or end-of-line).</li>
35+
* <li>A hash sign (<code> #</code>) starts a comment (line or end-of-line).</li>
3636
* <li>Scopes can follow the key, separated by a colon. Multiple scopes are comma-separated.</li>
3737
* </ul>
3838
* <p>

core/src/main/java/com/predic8/membrane/core/interceptor/apikey/stores/JDBCApiKeyStore.java

Lines changed: 9 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -34,19 +34,17 @@
3434
* </ul>
3535
* <p>
3636
* By default, the store will attempt to create the required tables at startup if they do not exist
37-
* (controlled by {@code autoCreate}).
37+
* (controlled by <code>autoCreate</code>).
3838
* </p>
3939
* <p>
4040
* Example configuration:
4141
* </p>
42-
* <pre>
43-
* &lt;apiKey&gt;
44-
* &lt;databaseApiKeyStore autoCreate="true"&gt;
45-
* &lt;keyTable name="api_keys"/&gt;
46-
* &lt;scopeTable name="api_scopes"/&gt;
47-
* &lt;/databaseApiKeyStore&gt;
48-
* &lt;/apiKey&gt;
49-
* </pre>
42+
* <pre><code><apiKey>
43+
* <databaseApiKeyStore autoCreate="true">
44+
* <keyTable name="api_keys"/>
45+
* <scopeTable name="api_scopes"/>
46+
* </databaseApiKeyStore>
47+
* </apiKey></code></pre>
5048
* @topic 3. Security and Validation
5149
*/
5250
@MCElement(name = "databaseApiKeyStore")
@@ -149,15 +147,15 @@ private boolean tableExists(Connection connection, String tableName) throws SQLE
149147
}
150148

151149
/**
152-
* @description The table containing API keys. Each row must define a unique {@code apikey}.
150+
* @description The table containing API keys. Each row must define a unique <code>apikey</code>.
153151
*/
154152
@MCChildElement(order = 0)
155153
public void setKeyTable(KeyTable keyTable) {
156154
this.keyTable = keyTable;
157155
}
158156

159157
/**
160-
* @description The table mapping API keys to scopes. Each row links one {@code apikey} to one {@code scope}.
158+
* @description The table mapping API keys to scopes. Each row links one <code>apikey</code> to one <code>scope</code>.
161159
*/
162160
@MCChildElement(order = 1)
163161
public void setScopeTable(ScopeTable scopeTable) {

core/src/main/java/com/predic8/membrane/core/interceptor/apikey/stores/MongoDBApiKeyStore.java

Lines changed: 6 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@
2626

2727
/**
2828
* @description Uses a MongoDB collection as a store for API keys and their scopes.
29-
* Each document in the collection must use the API key as its {@code _id}
30-
* and may define an array field {@code scopes} listing the allowed scopes.
29+
* Each document in the collection must use the API key as its <code>_id}</code>
30+
* and may define an array field <code>scopes</code> listing the allowed scopes.
3131
* <p>
3232
* Example MongoDB document:
3333
* </p>
@@ -40,14 +40,12 @@
4040
* <p>
4141
* Configuration example:
4242
* </p>
43-
* <pre>
44-
* &lt;apiKey&gt;
45-
* &lt;mongoDBApiKeyStore
43+
* <pre><code><apiKey>
44+
* <mongoDBApiKeyStore
4645
* connection="mongodb://localhost:27017"
4746
* database="security"
48-
* collection="apikeys"/&gt;
49-
* &lt;/apiKey&gt;
50-
* </pre>
47+
* collection="apikeys"/>
48+
* </apiKey></code></pre>
5149
* @topic 3. Security and Validation
5250
*/
5351
@MCElement(name = "mongoDBApiKeyStore")

0 commit comments

Comments
 (0)