Skip to content

Commit d6a6ae2

Browse files
author
Caitlin Bales (MSFT)
authored
Merge pull request #124 from microsoftgraph/javadoc-cleanup
Javadoc cleanup
2 parents 7942a87 + de3a7f2 commit d6a6ae2

File tree

59 files changed

+434
-347
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

59 files changed

+434
-347
lines changed

Templates/Java/BaseJavaModel.template.tt

Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -386,6 +386,15 @@
386386
}
387387
return "Void";
388388
}
389+
390+
public string MethodParametersJavadocSignature(OdcmMethod method) {
391+
var parameterSignatureBuilder = new StringBuilder();
392+
foreach (var p in method.Parameters)
393+
{
394+
parameterSignatureBuilder.AppendFormat("\r\n * @param {0} the {0}", ParamName(p));
395+
}
396+
return parameterSignatureBuilder.ToString();
397+
}
389398

390399
public string MethodParametersSignature(OdcmMethod method) {
391400
var parameterSignatureBuilder = new StringBuilder();
@@ -660,7 +669,7 @@ public {1} {2}{3}{4} {{";
660669
property.Name,
661670
propertyType,
662671
property.Name.SanitizePropertyName(property).ToLowerFirstChar(),
663-
property.LongDescription);
672+
ReplaceInvalidCharacters(property.LongDescription));
664673
}
665674
return sb.ToString();
666675
}
@@ -684,7 +693,7 @@ public {1} {2}{3}{4} {{";
684693
sb.AppendFormat(
685694
format,
686695
ParamName(p).SplitCamelCase(),
687-
p.LongDescription,
696+
ReplaceInvalidCharacters(p.LongDescription),
688697
ParamName(p),
689698
ParamType(p),
690699
ParamName(p).SanitizePropertyName(p).ToLowerFirstChar()
@@ -707,6 +716,7 @@ public {1} {2}{3}{4} {{";
707716

708717
/**
709718
* Gets the raw representation of this class
719+
*
710720
* @return the raw representation of this class
711721
*/
712722
public JsonObject getRawObject() {
@@ -715,17 +725,18 @@ public {1} {2}{3}{4} {{";
715725

716726
/**
717727
* Gets serializer
728+
*
718729
* @return the serializer
719730
*/
720731
protected ISerializer getSerializer() {
721732
return serializer;
722733
}
723734

724735
/**
725-
* Sets the raw json object
736+
* Sets the raw JSON object
726737
*
727-
* @param serializer The serializer
728-
* @param json The json object to set this object to
738+
* @param serializer the serializer
739+
* @param json the JSON object to set this object to
729740
*/
730741
public void setRawObject(final ISerializer serializer, final JsonObject json) {
731742
this.serializer = serializer;
@@ -825,4 +836,15 @@ public {1} {2}{3}{4} {{";
825836
//Specifying a return type of "void" throws an error
826837
return string.Empty;
827838
}
839+
840+
/**
841+
* Replaces invalid Javadoc characters with HTML
842+
*/
843+
public string ReplaceInvalidCharacters(string inputString)
844+
{
845+
if (inputString != null) {
846+
return inputString.Replace("<", "&lt;").Replace(">", "&gt;").Replace("&", "&amp;");
847+
}
848+
return null;
849+
}
828850
#>

Templates/Java/models_generated/IBaseClient.java.tt

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -15,17 +15,17 @@ foreach (var prop in model.EntityContainer.Properties)
1515
#>
1616

1717
/**
18-
* Gets the collection of <#=propertyName#> objects.
18+
* Gets the collection of <#=propertyName#> objects
1919
*
20-
* @return The request builder for the collection of <#=propertyName#> objects
20+
* @return the request builder for the collection of <#=propertyName#> objects
2121
*/
2222
<#=ITypeCollectionRequestBuilder(prop)#> <#=prop.Name#>();
2323

2424
/**
25-
* Gets a single <#=propertyName#>.
25+
* Gets a single <#=propertyName#>
2626
*
27-
* @param id The id of the <#=propertyName#> to retrieve.
28-
* @return The request builder for the <#=propertyName#> object
27+
* @param id the id of the <#=propertyName#> to retrieve
28+
* @return the request builder for the <#=propertyName#> object
2929
*/
3030
<#=ITypeRequestBuilder(prop)#> <#=prop.Name#>(final String id);
3131
<#
@@ -35,9 +35,9 @@ foreach (var prop in model.EntityContainer.Properties)
3535
#>
3636

3737
/**
38-
* Gets <#=TypeRequestBuilder(c)#>.
38+
* Gets the <#=TypeRequestBuilder(c)#>
3939
*
40-
* @return the <#=prop.Projection.Type.GetTypeString()#>.
40+
* @return the <#=prop.Projection.Type.GetTypeString()#>
4141
*/
4242
<#=ITypeRequestBuilder(prop)#> <#=prop.Name#>();
4343
<#

Templates/Java/requests_extensions/Client.java.tt

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ import <#=host.CurrentModel.NamespaceName()#>.logger.*;
2828

2929
/**
3030
* Sets the serializer
31-
* @param serializer The serializer
31+
* @param serializer the serializer
3232
* @return the instance of this builder
3333
*/
3434
public Builder serializer(final ISerializer serializer) {
@@ -38,7 +38,7 @@ import <#=host.CurrentModel.NamespaceName()#>.logger.*;
3838

3939
/**
4040
* Sets the httpProvider
41-
* @param httpProvider The httpProvider
41+
* @param httpProvider the httpProvider
4242
* @return the instance of this builder
4343
*/
4444
public Builder httpProvider(final IHttpProvider httpProvider) {
@@ -48,7 +48,7 @@ import <#=host.CurrentModel.NamespaceName()#>.logger.*;
4848

4949
/**
5050
* Sets the authentication provider
51-
* @param authenticationProvider The authentication provider
51+
* @param authenticationProvider the authentication provider
5252
* @return the instance of this builder
5353
*/
5454
public Builder authenticationProvider(final IAuthenticationProvider authenticationProvider) {
@@ -58,7 +58,7 @@ import <#=host.CurrentModel.NamespaceName()#>.logger.*;
5858

5959
/**
6060
* Sets the executors
61-
* @param executors The executors
61+
* @param executors the executors
6262
* @return the instance of this builder
6363
*/
6464
public Builder executors(final IExecutors executors) {
@@ -68,7 +68,7 @@ import <#=host.CurrentModel.NamespaceName()#>.logger.*;
6868

6969
/**
7070
* Sets the logger
71-
* @param logger The logger
71+
* @param logger the logger
7272
* @return the instance of this builder
7373
*/
7474
public Builder logger(final ILogger logger) {
@@ -78,7 +78,7 @@ import <#=host.CurrentModel.NamespaceName()#>.logger.*;
7878

7979
/**
8080
* Set this builder based on the client configuration
81-
* @param clientConfig The client configuration
81+
* @param clientConfig the client configuration
8282
* @return the instance of this builder
8383
*/
8484
public Builder fromConfig(final IClientConfig clientConfig) {

Templates/Java/requests_extensions/EntityCollectionPage.java.tt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
/**
1111
* A collection page for <#=ClassTypeName(c)#>.
1212
*
13-
* @param response The serialized <#=BaseTypeCollectionResponse(c)#> from the service
14-
* @param builder The request builder for the next collection page
13+
* @param response the serialized <#=BaseTypeCollectionResponse(c)#> from the service
14+
* @param builder the request builder for the next collection page
1515
*/
1616
public <#=TypeCollectionPage(c)#>(final <#=BaseTypeCollectionResponse(c)#> response, final <#=ITypeCollectionRequestBuilder(c)#> builder) {
1717
super(response, builder);

Templates/Java/requests_extensions/EntityCollectionReferenceRequest.java.tt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
/**
1212
* The request for this collection of <#=ClassTypeName(c)#>
1313
*
14-
* @param requestUrl The request url
15-
* @param client The service client
16-
* @param options The options for this request
14+
* @param requestUrl the request URL
15+
* @param client the service client
16+
* @param options the options for this request
1717
*/
1818
public <#=TypeCollectionReferenceRequest(c)#>(final String requestUrl, final <#=IBaseClientType()#> client, final java.util.List<? extends Option> options) {
1919
super(requestUrl, client, options);

Templates/Java/requests_extensions/EntityCollectionReferenceRequestBuilder.java.tt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
/**
1212
* The request builder for this collection of <#=ClassTypeName(c)#>
1313
*
14-
* @param requestUrl The request url
15-
* @param client The service client
16-
* @param requestOptions The options for this request
14+
* @param requestUrl the request URL
15+
* @param client the service client
16+
* @param requestOptions the options for this request
1717
*/
1818
public <#=TypeCollectionReferenceRequestBuilder(c)#>(final String requestUrl, final <#=IBaseClientType()#> client, final java.util.List<? extends Option> requestOptions) {
1919
super(requestUrl, client, requestOptions);

Templates/Java/requests_extensions/EntityCollectionRequest.java.tt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
/**
1212
* The request for this collection of <#=ClassTypeName(c)#>
1313
*
14-
* @param requestUrl The request url
15-
* @param client The service client
16-
* @param requestOptions The options for this request
14+
* @param requestUrl the request URL
15+
* @param client the service client
16+
* @param requestOptions the options for this request
1717
*/
1818
public <#=TypeCollectionRequest(c)#>(final String requestUrl, final <#=IBaseClientType()#> client, final java.util.List<? extends Option> requestOptions) {
1919
super(requestUrl, client, requestOptions);

Templates/Java/requests_extensions/EntityCollectionRequestBuilder.java.tt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
/**
1212
* The request builder for this collection of <#=ClassTypeName(c)#>
1313
*
14-
* @param requestUrl The request url
15-
* @param client The service client
16-
* @param requestOptions The options for this request
14+
* @param requestUrl the request URL
15+
* @param client the service client
16+
* @param requestOptions the options for this request
1717
*/
1818
public <#=TypeCollectionRequestBuilder(c)#>(final String requestUrl, final <#=IBaseClientType()#> client, final java.util.List<? extends Option> requestOptions) {
1919
super(requestUrl, client, requestOptions);

Templates/Java/requests_extensions/EntityCollectionWithReferencesPage.java.tt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,8 +10,8 @@
1010
/**
1111
* A collection page for <#=ClassTypeName(c)#>.
1212
*
13-
* @param response The serialized <#=BaseTypeCollectionResponse(c)#> from the service
14-
* @param builder The request builder for the next collection page
13+
* @param response the serialized <#=BaseTypeCollectionResponse(c)#> from the service
14+
* @param builder the request builder for the next collection page
1515
*/
1616
public <#=TypeCollectionWithReferencesPage(c)#>(final <#=BaseTypeCollectionResponse(c)#> response, final <#=ITypeCollectionWithReferencesRequestBuilder(c)#> builder) {
1717
super(response, builder);

Templates/Java/requests_extensions/EntityCollectionWithReferencesRequest.java.tt

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,9 +11,9 @@
1111
/**
1212
* The request for this collection of <#=ClassTypeName(c)#>
1313
*
14-
* @param requestUrl The request url
15-
* @param client The service client
16-
* @param requestOptions The options for this request
14+
* @param requestUrl the request URL
15+
* @param client the service client
16+
* @param requestOptions the options for this request
1717
*/
1818
public <#=TypeCollectionWithReferencesRequest(c)#>(final String requestUrl, final <#=IBaseClientType()#> client, final java.util.List<? extends Option> requestOptions) {
1919
super(requestUrl, client, requestOptions);

0 commit comments

Comments
 (0)