org.kohsuke.stapler.export.ExportedBean Java Examples

The following examples show how to use org.kohsuke.stapler.export.ExportedBean. You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: ModelBuilder.java    From blueocean-plugin with MIT License 5 votes vote down vote up
/**
 * Instead of throwing {@link NotExportableException} this method will return null
 * This should be used on hot paths where throwing the exception and catching it would incur a performance hit
 * @return model
 * @since 1.253
 */
@CheckForNull
public <T> Model<T> getOrNull(Class<T> type, @CheckForNull Class<?> propertyOwner, @Nullable String property) {
    Model<T> m = models.get(type);
    if(m==null && type.getAnnotation(ExportedBean.class) != null) {
        m = new Model<T>(this, type, propertyOwner, property);
    }
    return m;
}
 
Example #2
Source File: ActionProxiesImpl.java    From blueocean-plugin with MIT License 5 votes vote down vote up
@Override
public Object getAction() {
    if(action.getClass().isAnnotationPresent(ExportedBean.class)){
        return action;
    }else{
        return null;
    }
}
 
Example #3
Source File: NotExportableException.java    From blueocean-plugin with MIT License 4 votes vote down vote up
public NotExportableException(Class type) {
    this(type+" doesn't have @"+ ExportedBean.class.getSimpleName(),type);
}
 
Example #4
Source File: NotExportableException.java    From blueocean-plugin with MIT License 4 votes vote down vote up
public NotExportableException(Class type, Class<?> propertyOwner, String property) {
    this(type + " doesn't have @" + ExportedBean.class.getSimpleName() + " so cannot write " + propertyOwner.getName() + '.' + property, type);
}
 
Example #5
Source File: OrganizationImpl.java    From blueocean-plugin with MIT License 4 votes vote down vote up
private boolean isExportedBean(Class clz){
    return clz.getAnnotation(ExportedBean.class) != null;
}