## org.eclipse.emf.ecore
Interface EFactory

All Superinterfaces:
  EModelElement, EObject, Notifier

All Known Subinterfaces:
  ChangeFactory, Ecore2EcoreFactory, Ecore2XMLFactory, EcoreFactory, GenModelFactory, MappingFactory, TreeFactory, XMLNamespaceFactory, XMLTypeFactory

All Known Implementing Classes:
  ChangeFactoryImpl, Ecore2EcoreFactoryImpl, Ecore2XMLFactoryImpl, EcoreFactoryImpl, EFactoryImpl, GenModelFactoryImpl, MappingFactoryImpl, TreeFactoryImpl, XMLNamespaceFactoryImpl, XMLTypeFactoryImpl

    public interface EFactory

extends EModelElement

A representation of the model object 'EFactory'.

A factory is responsible for `creating` class instances, and for converting data type instances `to` and `from` `String`.

The following features are supported:

- `EPackage`

See Also:
  `EcorePackage.getEFactory()`

Method Summary
`java.lang.String` `convertToString(EDataType eDataType, java.lang.Object instanceValue)` Returns the literal value of the instance.
`EObject` `create(EClass eClass)` Creates a new instance of the class and returns it.
`java.lang.Object` `createFromString(EDataType eDataType, java.lang.String literalValue)` Creates an instance of the data type from the literal value.
`EPackage` `getEPackage()` Returns the value of the 'EPackage' reference.
`void` `setEPackage(EPackage value)` Sets the value of the '`EPackage`' reference

Methods inherited from interface org.eclipse.emf.ecore.EModelElement
`getEAnnotation, getEAnnotations`

Methods inherited from interface org.eclipse.emf.ecore.EObject
`eAllContents, eClass, eContainer, eContainingFeature, eContainmentFeature, eContents, eCrossReferences, eGet, eGet, eInvoke, eIsProxy, eIsSet, eResource, eSet, eUnset`

Methods inherited from interface org.eclipse.emf.common.notify.Notifier
`eAdapters, eDeliver, eNotify, eSetDeliver`

Method Detail

### getEPackage

    EPackage getEPackage()

  Returns the value of the 'EPackage' reference. It is bidirectional and its opposite is '`EFactory Instance`'.

  It represent the package of this factory.

  Returns:
    the value of the 'EPackage' reference.
  See Also:
    `setEPackage(EPackage)`, `EcorePackage.getEFactory_EPackage()`, `EPackage.getEFactoryInstance()`

### setEPackage

    void setEPackage(EPackage value)

  Sets the value of the '`EPackage`' reference.

  Parameters:
    `value` - the new value of the 'EPackage' reference.
  See Also:
    `getEPackage()`

### create

    EObject create(EClass eClass)

  Creates a new instance of the class and returns it.

  Parameters:
    `eClass` - the class of the new instance.
  Returns:
    a new instance of the class.

### createFromString

    java.lang.Object createFromString(EDataType eDataType,
                                      java.lang.String literalValue)

  Creates an instance of the data type from the literal value.

  Parameters:
    `literalValue` - literal value of the instance.
  Returns:
    an instance of the data type.
  See Also:
    `convertToString(EDataType, Object)`

### convertToString

    java.lang.String convertToString(EDataType eDataType,
                                     java.lang.Object instanceValue)

  Returns the literal value of the instance.

  Parameters:
    `eDataType` - the data type of the value.
    `instanceValue` - the value.
  Returns:
    the literal value of the instance.
  See Also:
    `createFromString(EDataType, String)`

Copyright 2001-2006 IBM Corporation and others. All Rights Reserved.