Class ArtifactCreatorNode


  • class ArtifactCreatorNode
    extends java.lang.Object
    Stores an artifact creator and its subordinate (more specific) creators according to the inheritance hierarchy.
    Author:
    Holger Eichelberger
    • Constructor Detail

      • ArtifactCreatorNode

        public ArtifactCreatorNode​(IArtifactCreator creator)
        Creates a new artifact creator node.
        Parameters:
        creator - the artifact creator
    • Method Detail

      • isMoreGeneralThan

        public boolean isMoreGeneralThan​(java.lang.Class<? extends IArtifactCreator> cls)
        Returns whether this creator node is more general than the given cls.
        Parameters:
        cls - the class of the creator to be compared
        Returns:
        true if this creator is more general than cls, false else, in particular the relation is unclear
      • getChildrenCount

        public int getChildrenCount()
        Returns the number of children.
        Returns:
        the number of children
      • getChild

        public ArtifactCreatorNode getChild​(int index)
        Returns the specified child.
        Parameters:
        index - the index of the child to be returned
        Returns:
        the specified child
        Throws:
        java.lang.IndexOutOfBoundsException - in case of index < 0 || index >={getChildrenCount()}
      • addChild

        void addChild​(IArtifactCreator creator)
        Adds a new child.
        Parameters:
        creator - the creator to be stored in the new child
      • setCreator

        void setCreator​(IArtifactCreator creator)
        Replaces the current creator. This shall only happen if the related artifact also replaces an existing artifact.
        Parameters:
        creator - the new creator.
      • getCreator

        public IArtifactCreator getCreator()
        Returns the attached creator.
        Returns:
        the attached creator
      • handlesArtifact

        public boolean handlesArtifact​(java.lang.Class<? extends IArtifact> kind,
                                       java.lang.Object real)
        Returns whether the attached creator handles the given real artifact instance.
        Parameters:
        kind - the kind of artifact in terms of a class (typically the top-level interfaces)
        real - the real artifact
        Returns:
        true if the attached creator handles real, false else
      • getCreatorClassName

        java.lang.String getCreatorClassName()
        Returns the name of the class of the attached creator.
        Returns:
        the name of the attached creator
      • configure

        void configure​(java.util.Properties properties,
                       java.util.List<Message> messages)
        Configures the attached artifact creator.
        Parameters:
        properties - the properties used to configure the creator
        messages - configuration messages (to be modified as a side effect)
      • getArtifactName

        java.lang.String getArtifactName()
        Returns the name of the artifact.
        Returns:
        the name of the artifact
      • subtreeMayHandle

        public boolean subtreeMayHandle​(java.lang.Class<? extends IArtifact> kind)
        Returns whether the subtree represented by this node may handle the given kind of artifact.
        Parameters:
        kind - the kind to be tested (may be null)
        Returns:
        true if it may handle, false if not (in particular kind is null)