-
Notifications
You must be signed in to change notification settings - Fork 1.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: adds an additional printer column annotation
closes: #3069 Signed-off-by: Steve Hawkins <[email protected]>
- Loading branch information
Showing
7 changed files
with
148 additions
and
11 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
74 changes: 74 additions & 0 deletions
74
...nnotations/src/main/java/io/fabric8/crd/generator/annotation/AdditionalPrinterColumn.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,74 @@ | ||
/* | ||
* Copyright (C) 2015 Red Hat, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.fabric8.crd.generator.annotation; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Repeatable; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* Defines an additional printer column. Must be placed at the root of the custom resource. | ||
*/ | ||
@Repeatable(AdditionalPrinterColumns.class) | ||
@Target({ ElementType.TYPE }) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface AdditionalPrinterColumn { | ||
|
||
/** | ||
* The name of the column. | ||
* An empty column name implies the use of the last path element | ||
* | ||
* @return the column name, or empty string if the last path element should be used. | ||
*/ | ||
String name() default ""; | ||
|
||
/** | ||
* The printer column format. | ||
* | ||
* @return the format or empty string if no format is specified. | ||
*/ | ||
String format() default ""; | ||
|
||
/** | ||
* The printer column priority. | ||
* | ||
* @return the priority or 0 if no priority is specified. | ||
*/ | ||
int priority() default 0; | ||
|
||
/** | ||
* The JSON Path to the field | ||
* | ||
* @return | ||
*/ | ||
String path(); | ||
|
||
/** | ||
* The type of the printer column | ||
* | ||
* @return the type | ||
*/ | ||
String getType(); | ||
|
||
/** | ||
* The description of the printer column | ||
* | ||
* @return the description | ||
*/ | ||
String getDescription() default ""; | ||
} |
30 changes: 30 additions & 0 deletions
30
...notations/src/main/java/io/fabric8/crd/generator/annotation/AdditionalPrinterColumns.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,30 @@ | ||
/* | ||
* Copyright (C) 2015 Red Hat, Inc. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package io.fabric8.crd.generator.annotation; | ||
|
||
import java.lang.annotation.ElementType; | ||
import java.lang.annotation.Retention; | ||
import java.lang.annotation.RetentionPolicy; | ||
import java.lang.annotation.Target; | ||
|
||
/** | ||
* A container for multiple {@link AdditionalPrinterColumn}s | ||
*/ | ||
@Target({ ElementType.TYPE }) | ||
@Retention(RetentionPolicy.RUNTIME) | ||
public @interface AdditionalPrinterColumns { | ||
AdditionalPrinterColumn[] value(); | ||
} |