|
Re: derivation from existing Java classes [message #64705 is a reply to message #64682] |
Thu, 20 October 2005 09:42 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) ![Go to next message Go to next message](theme/Solstice/images/down.png) |
Eclipse User![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=) |
|
|
|
Originally posted by: merks.ca.ibm.com
This is a multi-part message in MIME format.
--------------070604030007060606040509
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
Enrique,
You can mix in your own interfaces and can add your own methods into the
generated code so I'm not sure you should be trying to model this in the
schema. After all, will you be able to convert your adapter instance to
and from a string representation? This is how you can extend additional
interfaces by hand:
import org.eclipse.emf.common.util.Enumerator;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>EEnum Literal</b></em>'.
* @extends Enumerator
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.emf.ecore.EEnumLiteral#getValue
<em>Value</em>}</li>
* <li>{@link org.eclipse.emf.ecore.EEnumLiteral#getInstance
<em>Instance</em>}</li>
* <li>{@link org.eclipse.emf.ecore.EEnumLiteral#getEEnum
<em>EEnum</em>}</li>
* </ul>
* </p>
*
* @see org.eclipse.emf.ecore.EcorePackage#getEEnumLiteral()
* @model
* @generated
*/
public interface EEnumLiteral extends ENamedElement, Enumerator
As part of 93194 <https://bugs.eclipse.org/bugs/show_bug.cgi?id=93194>
I am looking into extending the annotation syntax so that things like
EOperations and multiple inheritance are expressible directly in the
schema (to try to make Ecore -> XSD -> Ecore a round trip).
Enrique wrote:
> Hi,
> if I understood well, the generated classes are notifiers, but they
> aren`t adapters.
> I would like them to derive from an adapter class.
>
> As simpleType it could look like this:
>
> <xsd:simpleType ecore:name="AnotherAdapter"
> ecore:instanceClass="org.eclipse.emf.common.notify.impl.AdapterImpl ">
> <xsd:restriction/>
> </xsd:simpleType>
>
> But as it is not possible to derive from a simpleType, that doesn`t work.
>
> The only thing which comes in my mind is to have an adapter as
> instance in the specified objects.
> Is there another possibility to derive objects from existing Java
> classes? Thanks for help in advance.
>
>
--------------070604030007060606040509
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Enrique,<br>
<br>
You can mix in your own interfaces and can add your own methods into
the generated code so I'm not sure you should be trying to model this
in the schema.
|
|
|
|
Re: derivation from existing Java classes [message #597037 is a reply to message #64682] |
Thu, 20 October 2005 09:42 ![Go to previous message Go to previous message](theme/Solstice/images/up.png) |
Ed Merks![Friend of Eclipse Friend](/donate/web-api/friends_decorator.php?email=ed.merks%40gmail.com) Messages: 33194 Registered: July 2009 |
Senior Member |
|
|
This is a multi-part message in MIME format.
--------------070604030007060606040509
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit
Enrique,
You can mix in your own interfaces and can add your own methods into the
generated code so I'm not sure you should be trying to model this in the
schema. After all, will you be able to convert your adapter instance to
and from a string representation? This is how you can extend additional
interfaces by hand:
import org.eclipse.emf.common.util.Enumerator;
/**
* <!-- begin-user-doc -->
* A representation of the model object '<em><b>EEnum Literal</b></em>'.
* @extends Enumerator
* <!-- end-user-doc -->
*
* <p>
* The following features are supported:
* <ul>
* <li>{@link org.eclipse.emf.ecore.EEnumLiteral#getValue
<em>Value</em>}</li>
* <li>{@link org.eclipse.emf.ecore.EEnumLiteral#getInstance
<em>Instance</em>}</li>
* <li>{@link org.eclipse.emf.ecore.EEnumLiteral#getEEnum
<em>EEnum</em>}</li>
* </ul>
* </p>
*
* @see org.eclipse.emf.ecore.EcorePackage#getEEnumLiteral()
* @model
* @generated
*/
public interface EEnumLiteral extends ENamedElement, Enumerator
As part of 93194 <https://bugs.eclipse.org/bugs/show_bug.cgi?id=93194>
I am looking into extending the annotation syntax so that things like
EOperations and multiple inheritance are expressible directly in the
schema (to try to make Ecore -> XSD -> Ecore a round trip).
Enrique wrote:
> Hi,
> if I understood well, the generated classes are notifiers, but they
> aren`t adapters.
> I would like them to derive from an adapter class.
>
> As simpleType it could look like this:
>
> <xsd:simpleType ecore:name="AnotherAdapter"
> ecore:instanceClass="org.eclipse.emf.common.notify.impl.AdapterImpl ">
> <xsd:restriction/>
> </xsd:simpleType>
>
> But as it is not possible to derive from a simpleType, that doesn`t work.
>
> The only thing which comes in my mind is to have an adapter as
> instance in the specified objects.
> Is there another possibility to derive objects from existing Java
> classes? Thanks for help in advance.
>
>
--------------070604030007060606040509
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Enrique,<br>
<br>
You can mix in your own interfaces and can add your own methods into
the generated code so I'm not sure you should be trying to model this
in the schema.
Ed Merks
Professional Support: https://www.macromodeling.com/
|
|
|
|
Powered by
FUDForum. Page generated in 0.05746 seconds