Class WrappedInstance<T>
- java.lang.Object
-
- edu.cornell.mannlib.vitro.webapp.utils.configuration.WrappedInstance<T>
-
public class WrappedInstance<T> extends Object
An instance of a ConfigurationBean, packaged with the distilled information about the annotated methods on the class.
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classWrappedInstance.CardinalityExceptionstatic classWrappedInstance.ResourceUnavailableExceptionstatic classWrappedInstance.ValidationFailedException
-
Constructor Summary
Constructors Constructor Description WrappedInstance(T instance, Map<String,PropertyType.PropertyMethod> propertyMethods, Set<Method> validationMethods)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidcheckCardinality(Set<PropertyType.PropertyStatement> propertyStatements)The loader provides the distilled property statements from the RDF.TgetInstance()Once satisfied, populated, and validated, the instance is ready to go.voidsatisfyInterfaces(javax.servlet.ServletContext ctx, javax.servlet.http.HttpServletRequest req)The loader calls this as soon as the instance is created.voidsetProperties(ConfigurationBeanLoader loader, Collection<PropertyType.PropertyStatement> propertyStatements)The loader provides the distilled property statements from the RDF, to populate the instance.voidvalidate()After the interfaces have been satisfied and the instance has been populated, call any validation methods to see whether the instance is viable.
-
-
-
Method Detail
-
satisfyInterfaces
public void satisfyInterfaces(javax.servlet.ServletContext ctx, javax.servlet.http.HttpServletRequest req) throws WrappedInstance.ResourceUnavailableExceptionThe loader calls this as soon as the instance is created. If the loader did not have access to a request object, then req will be null. If the instance expects request models, an exception will be thrown.
-
checkCardinality
public void checkCardinality(Set<PropertyType.PropertyStatement> propertyStatements) throws WrappedInstance.CardinalityException
The loader provides the distilled property statements from the RDF. Check that they satisfy the cardinality requested on their methods.
-
setProperties
public void setProperties(ConfigurationBeanLoader loader, Collection<PropertyType.PropertyStatement> propertyStatements) throws PropertyType.PropertyTypeException, ConfigurationBeanLoaderException
The loader provides the distilled property statements from the RDF, to populate the instance.
-
validate
public void validate() throws WrappedInstance.ValidationFailedExceptionAfter the interfaces have been satisfied and the instance has been populated, call any validation methods to see whether the instance is viable.
-
getInstance
public T getInstance()
Once satisfied, populated, and validated, the instance is ready to go.
-
-