-
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.
- Loading branch information
Showing
40 changed files
with
704 additions
and
221 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
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); | ||
} | ||
} |
Oops, something went wrong.