Class EObjectFeature


  • public class EObjectFeature
    extends Object
    Class for EObject and EStructuralFeatures associated with it. It contains usefull methods for checking conditions and creating AEF models via IModelFactory.
    • Constructor Detail

      • EObjectFeature

        public EObjectFeature​(org.eclipse.emf.ecore.EObject object,
                              org.eclipse.emf.ecore.EStructuralFeature... features)
        Creates a new instance.
        Parameters:
        object - the object, cannot be null.
        features - features, cannot be null.
    • Method Detail

      • getObject

        public org.eclipse.emf.ecore.EObject getObject()
        Returns:
        the object.
      • getFeatures

        public org.eclipse.emf.ecore.EStructuralFeature[] getFeatures()
        Returns:
        features.
      • checkFeatureChain

        public boolean checkFeatureChain()
        Checks that chain of features exists.
        Returns:
        true if feature chain exists at the object.
      • checkTargetFeatureIsOneOf

        public boolean checkTargetFeatureIsOneOf​(org.eclipse.emf.ecore.EStructuralFeature... features)
        Checks that the getTargetFeature() equals to one of given features.
        Parameters:
        features - features.
        Returns:
        true if the target feature equals to to one of given features.
      • checkTargetFeatureIsOfType

        public boolean checkTargetFeatureIsOfType​(Class<?> class_)
        Checks that the getTargetFeature() type equals to the given one.
        Parameters:
        class_ - the class.
        Returns:
        true if the feature is of the given type.
      • checkTargetFeatureIsOfType

        public boolean checkTargetFeatureIsOfType​(org.eclipse.emf.ecore.EClassifier classifier)
        Checks that the getTargetFeature() EType equals to the given one.
        Parameters:
        classifier - the classifier.
        Returns:
        true if the feature is of the given type.
      • checkTargetFeaturePackage

        public boolean checkTargetFeaturePackage​(org.eclipse.emf.ecore.EPackage pkg)
        Checks that the getTargetFeature() EPackage equals to the given one.
        Parameters:
        pkg - the EPackage
        Returns:
        true if the feature is of contains in checking package.
      • getTargetFeature

        public org.eclipse.emf.ecore.EStructuralFeature getTargetFeature()
        Returns the feature for the potential model is about to create.
        Returns:
        the last feature in features.
      • getTargetObject

        public org.eclipse.emf.ecore.EObject getTargetObject()
        Returns the EObject for the potential model is about to create.
        NOTE: It's not safe method. Call checkFeatureChain() before to make sure that chain of features exists in the object.
        Returns:
        the target EObject for potential AEF model.