Implementing a profile provider

To define the profile provider implementation:

  1. Click File > New > Class
  2. Type a package name (e.g. com.sodius.mdw.metamodel.library) in the Package name field.
  3. Type a class name (e.g. LibraryProfileProvider) in the Name field. This is the name of the Java class that will define the implementation of the profile provider.
  4. Click Add..., on the right of the Interfaces list.
  5. Type ProfileProvider and click OK.
  6. Back in the Java class wizard, click Finish.
  7. Change the body of the created Java class and click File > Save.
    package com.sodius.mdw.metamodel.library;
    
    import com.sodius.mdw.metamodel.library.Book;
    import com.sodius.mdw.core.model.MDWObject;
    import com.sodius.mdw.corext.model.ProfileProvider;
    
    public class LibraryProfileProvider implements ProfileProvider {
    
        public String[] getStereotypeNames(MDWObject object) {
            if (object instanceof Book) {
                String kind = ((Book) object).getKind();
                if (kind.length() != 0)
                    return new String[] { kind };
            }		
            return null;
        }
    }

Refer to the Javadoc of ProfileProvider for details on the contents of a profile provider.

Related reference
ProfileProvider API