Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
<copyright> Copyright (c) 2009, 2010 Springsite BV (The Netherlands) and others All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html Contributors: Martin Taal - Initial API and implementation </copyright> $Id: ModelFactory.java,v 1.11 2011/08/25 12:32:37 mtaal Exp $
 
 
 package org.eclipse.emf.texo.model;
 
 import  org.eclipse.emf.ecore.EClass;
 import  org.eclipse.emf.ecore.EPackage;
 import  org.eclipse.emf.ecore.EStructuralFeature;

The ModelFactory is responsible for runtime and instance handling of a model. This interface defines methods providing and creating instances of the generated pojo's, access to features of model instances. Generated ModelFactory classes will have inner classes (extending AbstractModelObject and implementing ModelObject) for each of the EClass of the EPackage. These inner classes provide efficient access to the runtime model for a pojo. See also the ModelResolver.getModelObject(Object) method.

Author(s):
Martin Taal
See also:
AbstractModelObject
ModelObject
 
 public interface ModelFactory {

  
Creates an instance for the EClass.

Returns:
an instance for the EClass.
 
   Object create(EClass eClass);

  
Wraps an object in a ModelObject.

Parameters:
eClass the EClass of the object
adaptee the object being wrapped/adapted
Returns:
the wrapper ModelObject
 
   ModelObject<?> createModelObject(EClass eClassObject adaptee);

  
Creates a feature map entry instance for a certain EStructuralFeature.

Parameters:
eStructuralFeature the feature map feature
Returns:
the pojo feature map entry
Generated:
 
   public Object createFeatureMapEntry(EStructuralFeature eFeature);

  
Wraps a feature map entry pojo in a AbstractModelFeatureMapEntry. If the feature map entry is null then a new one is created and

Parameters:
eStructuralFeature the feature map feature of the object
adaptee the pojo feature map entry being wrapped/adapted
Returns:
the wrapper ModelFeatureMapEntry
Generated:
 
   public ModelFeatureMapEntry<?> createModelFeatureMapEntry(EStructuralFeature eFeatureObject adaptee);

  
Converts an instance of an org.eclipse.emf.ecore.EDataType to a String

Parameters:
eDataType the org.eclipse.emf.ecore.EDataType defining the type
value the object to convert, if null then null is returned
Generated:
 
   String convertToString(org.eclipse.emf.ecore.EDataType eDataTypeObject value);

  
Converts an instance of an org.eclipse.emf.ecore.EDataType to a String

Parameters:
eDataType the org.eclipse.emf.ecore.EDataType defining the type
value the object to convert, if null then null is returned
Generated:
  Object createFromString(org.eclipse.emf.ecore.EDataType eDataTypeString value);
New to GrepCode? Check out our FAQ X