Package org.jvnet.hk2.internal
Class ValidationInformationImpl
- java.lang.Object
-
- org.jvnet.hk2.internal.ValidationInformationImpl
-
- All Implemented Interfaces:
ValidationInformation
public class ValidationInformationImpl extends java.lang.Object implements ValidationInformation
-
-
Field Summary
Fields Modifier and Type Field Description private ActiveDescriptor<?>candidateprivate static java.lang.StringCHECK_METHODprivate Filterfilterprivate Injecteeinjecteeprivate Operationoperationprivate static java.util.HashSet<java.lang.String>PACKAGES_TO_SKIPprivate static java.lang.StringSERVICE_LOCATOR_IMPLprivate static java.lang.String[]SKIP_MEprivate static java.lang.StringVALIDATE_METHOD
-
Constructor Summary
Constructors Constructor Description ValidationInformationImpl(Operation operation, ActiveDescriptor<?> candidate)Creates the validation informationValidationInformationImpl(Operation operation, ActiveDescriptor<?> candidate, Injectee injectee, Filter filter)Creates the validation information
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.StackTraceElementgetCaller()The implementation of this method is VERY dependent on the implementation of ServiceLocatorImpl.ActiveDescriptor<?>getCandidate()The candidate descriptor for this operationFiltergetFilter()On a LOOKUP operation theFilterthat was used in the lookup operation.InjecteegetInjectee()On a LOOKUP operation if the lookup is being performed due to an injection point (as opposed to a lookup via the API) then this method will return a non-nullInjecteethat is the injection point that would be injected intoOperationgetOperation()The operation that is to be performed, one of BIND - The candidate descriptor is being added to the system UNBIND - The candidate descriptor is being removed from the system LOOKUP - The candidate descriptor is being looked upprivate java.lang.StringgetPackage(java.lang.String name)java.lang.StringtoString()
-
-
-
Field Detail
-
SERVICE_LOCATOR_IMPL
private static final java.lang.String SERVICE_LOCATOR_IMPL
- See Also:
- Constant Field Values
-
VALIDATE_METHOD
private static final java.lang.String VALIDATE_METHOD
- See Also:
- Constant Field Values
-
CHECK_METHOD
private static final java.lang.String CHECK_METHOD
- See Also:
- Constant Field Values
-
SKIP_ME
private static final java.lang.String[] SKIP_ME
-
PACKAGES_TO_SKIP
private static final java.util.HashSet<java.lang.String> PACKAGES_TO_SKIP
-
operation
private final Operation operation
-
candidate
private final ActiveDescriptor<?> candidate
-
injectee
private final Injectee injectee
-
filter
private final Filter filter
-
-
Constructor Detail
-
ValidationInformationImpl
public ValidationInformationImpl(Operation operation, ActiveDescriptor<?> candidate, Injectee injectee, Filter filter)
Creates the validation information- Parameters:
operation- The operation to performcandidate- The candidate to perform it oninjectee- The injecteee that may be involvedfilter- The filter that may be involved in the lookup
-
ValidationInformationImpl
public ValidationInformationImpl(Operation operation, ActiveDescriptor<?> candidate)
Creates the validation information- Parameters:
operation- The operation to performcandidate- The candidate to perform it on
-
-
Method Detail
-
getOperation
public Operation getOperation()
Description copied from interface:ValidationInformationThe operation that is to be performed, one of- BIND - The candidate descriptor is being added to the system
- UNBIND - The candidate descriptor is being removed from the system
- LOOKUP - The candidate descriptor is being looked up
- Specified by:
getOperationin interfaceValidationInformation- Returns:
- The operation being performed
-
getCandidate
public ActiveDescriptor<?> getCandidate()
Description copied from interface:ValidationInformationThe candidate descriptor for this operation- Specified by:
getCandidatein interfaceValidationInformation- Returns:
- The candidate descriptor for the operation being performed
-
getInjectee
public Injectee getInjectee()
Description copied from interface:ValidationInformationOn a LOOKUP operation if the lookup is being performed due to an injection point (as opposed to a lookup via the API) then this method will return a non-nullInjecteethat is the injection point that would be injected into- Specified by:
getInjecteein interfaceValidationInformation- Returns:
- The injection point being injected into on a LOOKUP operation
-
getFilter
public Filter getFilter()
Description copied from interface:ValidationInformationOn a LOOKUP operation theFilterthat was used in the lookup operation. This may give more information about what exactly was being looked up by the caller- Specified by:
getFilterin interfaceValidationInformation- Returns:
- The filter used in the lookup operation
-
getPackage
private java.lang.String getPackage(java.lang.String name)
-
getCaller
public java.lang.StackTraceElement getCaller()
The implementation of this method is VERY dependent on the implementation of ServiceLocatorImpl. Any refactoring of ServiceLocatorImpl having to do with validation will likely cause this code to break. Hopefully the unit tests will catch any such failures!- Specified by:
getCallerin interfaceValidationInformation- Returns:
- The caller of the HK2 API that caused this validation to occur, or null if the caller could not be determined
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
-