# Java black-box units

###### Identifier:

org.eclipse.m2m.qvt.oml.javaBlackboxUnits

###### Since:

2.0

###### Description:

This extension point provides a mechanism for contributing QVT black-box units. Conceptually, it corresponds to QVT compilation units (OMG spec 7.13.1), though it rather represents sort of deployment unit as there is no concrete syntax source file to compile. Instead, the source is represented by a Java class, which realizes the top level unit elements using Java language constructs mapped to corresponding QVT counterpart elements. See the details on the Java implementation class format at Java black-box to QVT mappings.

###### Configuration Markup:

<!ELEMENT extension ((unit | library)+)>

<!ATTLIST extension

point CDATA #REQUIRED

id CDATA #IMPLIED

name CDATA #IMPLIED

>

Extension point to register QVT black-box unit of Java implementations

<!ELEMENT unit (library)>

<!ATTLIST unit

name CDATA #REQUIRED

namespace CDATA #IMPLIED

description CDATA #IMPLIED

>

A deployment unit that can define mutliple libraries or transformations, a conceptual analogy to `compilation unit` defined in QVT specification.

- name - Simple name of the black-box unit. Along with the namespace, it composes the qualified name of the unit referenceable from import statements.
- namespace - Namespace in which this blackbox unit is defined. If not specified, the identifier of the owning plugin will be used. Along with the name, it composes the qualified name of the unit referenceable from import statements.
- description - A textual description of this unit element, typically used by a tooling support

<!ELEMENT library (metamodel*)>

<!ATTLIST library

name CDATA #IMPLIED

class CDATA #REQUIRED

>

A library module which defines its operations in the associated implementation class and is defined in a deployment unit.
In order to facilitate the common case of a single library per unit, a simplified definition is supported to help in reducing verbosity. In this case no explicit owning unit needs to be defined and the library element can be defined as standalone. Corresponding implicit unit is synthesized based on the implementation class and inherits its qualified name.

- name - Name of the library representing the module name resolveable in QVT. If not specified, the simple name of the class will be used.
- class - The implementation class of the library (see Java black-box to QVT mappings)

<!ELEMENT metamodel EMPTY>

<!ATTLIST metamodel

nsURI CDATA #REQUIRED

>

Specifies a metamodel used by a declared library, being a part of that library signature.

- nsURI - The namespace URI of the metamodel package.

###### Examples:

The following examples registers the `ExampleJavaLib` black-box unit, which is resolvable as `m2m.qvt.oml.ExampleJavaLib` from importing QVT modules. It defines the QVT library resolveable by name `UtilLib`, implemented in the `org.eclipse.m2m.qvt.oml.examples.blackbox.UtilitiesLibrary` class. The library operation reference types defined in the `Ecore` metamodel.

    <extension point="org.eclipse.m2m.qvt.oml.javaBlackboxUnits">
      <unit name="ExampleJavaLib" namespace="m2m.qvt.oml">
        <library name="UtilLib"
                 class="org.eclipse.m2m.qvt.oml.examples.blackbox.UtilitiesLibrary">
          <metamodel nsURI="http://www.eclipse.org/emf/2002/Ecore"/>
        </library>
      </unit>
    </extension>

Copyright (c) 2008 Borland Software Corporation 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