-
Notifications
You must be signed in to change notification settings - Fork 183
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Support for client core libraries (#7955)
Improving APIView to support non-Azure libraries, in particular the new generic core
- Loading branch information
1 parent
e99e474
commit bca1ac5
Showing
36 changed files
with
656 additions
and
218 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
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
54 changes: 54 additions & 0 deletions
54
...main/java/com/azure/tools/apiview/processor/analysers/models/AnnotationRendererModel.java
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,54 @@ | ||
package com.azure.tools.apiview.processor.analysers.models; | ||
|
||
import com.github.javaparser.ast.expr.AnnotationExpr; | ||
import com.github.javaparser.ast.nodeTypes.NodeWithAnnotations; | ||
|
||
public class AnnotationRendererModel { | ||
private final AnnotationExpr annotation; | ||
|
||
private final NodeWithAnnotations<?> annotationParent; | ||
|
||
private final AnnotationRule rule; | ||
|
||
private final boolean showProperties; | ||
|
||
private final boolean addNewline; | ||
|
||
public AnnotationRendererModel(AnnotationExpr annotation, | ||
NodeWithAnnotations<?> nodeWithAnnotations, | ||
AnnotationRule rule, | ||
boolean showAnnotationProperties, | ||
boolean addNewline) { | ||
this.annotation = annotation; | ||
this.annotationParent = nodeWithAnnotations; | ||
this.rule = rule; | ||
|
||
// we override the showAnnotationProperties flag if the annotation rule specifies it | ||
this.showProperties = rule == null ? showAnnotationProperties : rule.isShowProperties().orElse(showAnnotationProperties); | ||
this.addNewline = rule == null ? addNewline : rule.isShowOnNewline().orElse(addNewline); | ||
} | ||
|
||
public boolean isAddNewline() { | ||
return addNewline; | ||
} | ||
|
||
public boolean isShowProperties() { | ||
return showProperties; | ||
} | ||
|
||
public AnnotationExpr getAnnotation() { | ||
return annotation; | ||
} | ||
|
||
public NodeWithAnnotations<?> getAnnotationParent() { | ||
return annotationParent; | ||
} | ||
|
||
public boolean isHidden() { | ||
return rule != null && rule.isHidden().orElse(false); | ||
} | ||
|
||
public boolean isCondensed() { | ||
return rule != null && rule.isCondensed().orElse(false); | ||
} | ||
} |
50 changes: 50 additions & 0 deletions
50
...ssor/src/main/java/com/azure/tools/apiview/processor/analysers/models/AnnotationRule.java
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,50 @@ | ||
package com.azure.tools.apiview.processor.analysers.models; | ||
|
||
import java.util.Optional; | ||
|
||
public class AnnotationRule { | ||
|
||
private Optional<Boolean> hideAnnotation = Optional.empty(); | ||
|
||
private Optional<Boolean> showProperties = Optional.empty(); | ||
|
||
private Optional<Boolean> showOnNewline = Optional.empty(); | ||
|
||
private Optional<Boolean> condensed = Optional.empty(); | ||
|
||
public AnnotationRule setHidden(boolean hidden) { | ||
this.hideAnnotation = Optional.of(hidden); | ||
return this; | ||
} | ||
|
||
public Optional<Boolean> isHidden() { | ||
return hideAnnotation; | ||
} | ||
|
||
public AnnotationRule setShowProperties(boolean showProperties) { | ||
this.showProperties = Optional.of(showProperties); | ||
return this; | ||
} | ||
|
||
public Optional<Boolean> isShowProperties() { | ||
return showProperties; | ||
} | ||
|
||
public AnnotationRule setShowOnNewline(boolean showOnNewline) { | ||
this.showOnNewline = Optional.of(showOnNewline); | ||
return this; | ||
} | ||
|
||
public Optional<Boolean> isShowOnNewline() { | ||
return showOnNewline; | ||
} | ||
|
||
public AnnotationRule setCondensed(boolean condensed) { | ||
this.condensed = Optional.of(condensed); | ||
return this; | ||
} | ||
|
||
public Optional<Boolean> isCondensed() { | ||
return condensed; | ||
} | ||
} |
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
Oops, something went wrong.