Package com.helger.photon.api
Class APIRegistry
- java.lang.Object
-
- com.helger.photon.api.APIRegistry
-
- All Implemented Interfaces:
IAPIRegistry,Serializable
@ThreadSafe public class APIRegistry extends Object implements IAPIRegistry
Default implementation ifIAPIRegistry.- Author:
- Philip Helger
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description APIRegistry()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description com.helger.commons.collection.impl.ICommonsList<IAPIDescriptor>getAllAPIDescriptors()InvokableAPIDescriptorgetAPIByPath(APIPath aPath, IAPIPathAmbiguityResolver aAmbiguityResolver)Find anInvokableAPIDescriptorthat matches the provided path.voidregisterAPI(APIDescriptor aDescriptor)Register a new API descriptor.StringtoString()-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.helger.photon.api.IAPIRegistry
getAPIByPath
-
-
-
-
Method Detail
-
registerAPI
public void registerAPI(@Nonnull APIDescriptor aDescriptor)
Description copied from interface:IAPIRegistryRegister a new API descriptor. It is the callers responsibility to ensure each API is only registered once.- Specified by:
registerAPIin interfaceIAPIRegistry- Parameters:
aDescriptor- The descriptor to be registered. May not benull.
-
getAllAPIDescriptors
@Nonnull @ReturnsMutableCopy public com.helger.commons.collection.impl.ICommonsList<IAPIDescriptor> getAllAPIDescriptors()
- Specified by:
getAllAPIDescriptorsin interfaceIAPIRegistry- Returns:
- A mutable list of all registered descriptors. Never
nullbut maybe empty.
-
getAPIByPath
@Nullable public InvokableAPIDescriptor getAPIByPath(@Nonnull APIPath aPath, @Nonnull IAPIPathAmbiguityResolver aAmbiguityResolver)
Description copied from interface:IAPIRegistryFind anInvokableAPIDescriptorthat matches the provided path.- Specified by:
getAPIByPathin interfaceIAPIRegistry- Parameters:
aPath- The path to search. May not benull.aAmbiguityResolver- The ambiguity resolver to be used. May not benull.- Returns:
nullif no matching invoker is registered meaning the path cannot be handled by this invoker.
-
-