Interface IArtifactCreator

    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String DEFAULT_PATTERN
      A pseudo token denoting the implemented configuration (value "*").
    • Field Detail

      • DEFAULT_PATTERN

        static final java.lang.String DEFAULT_PATTERN
        A pseudo token denoting the implemented configuration (value "*").
        See Also:
        Constant Field Values
    • Method Detail

      • handlesArtifact

        boolean handlesArtifact​(java.lang.Class<? extends IArtifact> kind,
                                java.lang.Object real)
        Returns whether this creator handles this type of artifact.
        Parameters:
        kind - the kind of artifact in terms of a class (typically the top-level interfaces)
        real - the real world object
        Returns:
        true if it can handle the artifact, false else
      • createArtifactInstance

        IArtifact createArtifactInstance​(java.lang.Object real,
                                         ArtifactModel model)
                                  throws VilException
        Returns the artifact instance for real.
        Parameters:
        real - the real world object
        model - the artifact model to create the artifact within
        Returns:
        the instance or null if real cannot be handled
        Throws:
        VilException - in case that any instance creation problem occurs
      • configure

        void configure​(java.util.Properties properties,
                       java.util.List<Message> messages)
        Configures its own reaction according to a set of properties. Each artifact creator may look for a property with its own single name and read a comma separated list of regular file path patterns for its configuration. If empty, the artifact creator shall be disabled. If DEFAULT_PATTERN is contained, then the default implementation shall be called, otherwise only the configured entries shall be considered. A creator shall not modify the given properties (exceptions may apply).
        Parameters:
        properties - the properties to configure on
        messages - configuration messages (to be modified as a side effect)
      • getArtifactClass

        java.lang.Class<? extends IArtifact> getArtifactClass()
        The class of the artifact being created. Do not override this method for an existing creator if you plan to just replace an existing artifact! In that case subclass the respective creator and override only createArtifactInstance(Object, ArtifactModel).
        Returns:
        the class of the artifact being created