Class UniqueName


  • public abstract class UniqueName
    extends Object
    Helper class for generation and validation of the unique name.
    • Field Detail

    • Constructor Detail

      • UniqueName

        protected UniqueName​(String base)
        Constructor.
        Parameters:
        base - - a prefix
    • Method Detail

      • setBase

        public void setBase​(String base)
        Sets a prefix
        Parameters:
        base - a prefix
      • generate

        public String generate()
        Generates new unique name using prefix.
        Returns:
        a new unique name
        See Also:
        setBase(String)
      • createValidator

        public org.eclipse.core.databinding.validation.IValidator createValidator​(Object owner)
        Generates new validator.
        Parameters:
        owner - - a owner of the name
        Returns:
        a new validator
      • find

        protected abstract Object find​(String name,
                                       Object owner)
        Finds the object (not equal to the specified owner) with the specified name
        Parameters:
        name - a unique name
        owner - a owner
        Returns:
        the object (not equal to the specified owner) with the specified name
      • create

        public static UniqueName create​(org.eclipse.emf.ecore.EObject eObj,
                                        org.eclipse.emf.ecore.EStructuralFeature feature,
                                        String base)
        The default implementation based on the EObject and features
        Parameters:
        eObj - a owner of the collection of object with unique name
        feature - a owner of the collection of object with unique name
        base - a prefix
        Returns:
        new instance of this class