Class NdNodeTypeRegistry<R>

java.lang.Object
org.aspectj.org.eclipse.jdt.internal.core.nd.NdNodeTypeRegistry<R>

public class NdNodeTypeRegistry<R> extends Object
Maps integer constants onto factories for NdNode objects.
  • Constructor Details

    • NdNodeTypeRegistry

      public NdNodeTypeRegistry()
  • Method Details

    • register

      public <T extends R> void register​(int typeId, ITypeFactory<T> toRegister)
      Registers a class to be used with this node type registry. Note that if we ever want to stop registering a type name in the future, its fully-qualified class name should be passed to reserve(...) to prevent its hashfrom being reused in the future.
    • reserve

      public void reserve​(short typeId)
      Reserves the given node class name, such that its hash cannot be used by any other node registered with "register". If we ever want to unregister a given Class from the type registry, its class name should be reserved using this method. Doing so will prevent its type ID from being reused by another future class.
    • getClassForType

      public ITypeFactory<? extends R> getClassForType​(short type)
      Returns the class associated with the given type or null if the given type ID is not known
    • createNode

      public R createNode​(Nd nd, long address, short nodeType) throws IndexException
      Throws:
      IndexException
    • isRegisteredClass

      public boolean isRegisteredClass​(Class<?> toQuery)
    • getTypeForClass

      public short getTypeForClass​(Class<?> toQuery)
    • getTypeFactory

      public <T extends R> ITypeFactory<T> getTypeFactory​(short nodeType)