Class CodesManagerExtension


  • public class CodesManagerExtension
    extends Object
    Object model extensions to manage verbatim code to attzach to operations.
    Since:
    2.0.2
    Author:
    Tony Chemit - chemit@codelutin.com
    See Also:
    CodesManager
    • Field Detail

      • OBJECTMODEL_EXTENSION

        public static final String OBJECTMODEL_EXTENSION
        Extension static used to identify CodesManagerExtension in ObjectModel
        See Also:
        Constant Field Values
      • managers

        protected Map<String,​CodesManager> managers
        Map of CodesManager with key equals to the classifier qualified name associated to the CodesManager
    • Constructor Detail

      • CodesManagerExtension

        public CodesManagerExtension()
    • Method Detail

      • addcode

        public void addcode​(ObjectModelClassifier classifier,
                            ObjectModelOperation operation,
                            String code)
        Add the code for the given operation of the given classifier.
        Parameters:
        classifier - the classifier container of the operation
        operation - the operation on which to add the code
        code - the code to add for the operation
      • getCode

        public String getCode​(ObjectModelClassifier classifier,
                              ObjectModelOperation operation)
        Get body code for a operation of the given classifier. The CodesManager must be defined in the model.
        Parameters:
        classifier - reference for the codes
        operation - the operation to seek
        Returns:
        the body code of the method
      • getManager

        public CodesManager getManager​(ObjectModelClassifier classifier)
        Get the CodesManager associated to the classifier. Note: If not exist, it will be created.
        Parameters:
        classifier - reference for the ImportsManager
        Returns:
        the codesManager associated to the classifier (never null)