Package org.kohsuke.stapler.export
Class ModelBuilder
- java.lang.Object
-
- org.kohsuke.stapler.export.ModelBuilder
-
public class ModelBuilder extends Object
Creates and maintainsModel
s, that are used to write out the value representation ofexposed beans
.- Author:
- Kohsuke Kawaguchi
-
-
Constructor Summary
Constructors Constructor Description ModelBuilder()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T> Model<T>
get(Class<T> type)
<T> Model<T>
get(Class<T> type, Class<?> propertyOwner, String property)
<T> Model<T>
getOrNull(Class<T> type, Class<?> propertyOwner, String property)
Instead of throwingNotExportableException
this method will return null This should be used on hot paths where throwing the exception and catching it would incur a performance hit
-
-
-
Method Detail
-
get
@NonNull public <T> Model<T> get(Class<T> type) throws NotExportableException
- Throws:
NotExportableException
-
get
@NonNull public <T> Model<T> get(Class<T> type, @CheckForNull Class<?> propertyOwner, @Nullable String property) throws NotExportableException
- Returns:
- model
- Throws:
NotExportableException
- if type is not exportable
-
getOrNull
@CheckForNull public <T> Model<T> getOrNull(Class<T> type, @CheckForNull Class<?> propertyOwner, @Nullable String property)
Instead of throwingNotExportableException
this method will return null This should be used on hot paths where throwing the exception and catching it would incur a performance hit- Returns:
- model
- Since:
- 1.253
-
-