|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.eclipse.emf.converter.ModelConverter
org.eclipse.emf.exporter.ModelExporter
org.eclipse.emf.exporter.html.HTMLExporter
public class HTMLExporter
This example shows how the Export API and JET can be used to generate a HTML documentation for Ecore packages.
As any example, this code was NOT extensively tested and is not necessary to cover all the possible nuances of Ecore models.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class org.eclipse.emf.exporter.ModelExporter |
---|
ModelExporter.EPackageExportInfo, ModelExporter.ExportData, ModelExporter.GenPackagesTreeIterator, ModelExporter.ReferencedGenPackageExportInfo |
Nested classes/interfaces inherited from class org.eclipse.emf.converter.ModelConverter |
---|
ModelConverter.EPackageConvertInfo, ModelConverter.ReferencedEPackageFilter, ModelConverter.ReferencedGenPackageConvertInfo |
Field Summary |
---|
Fields inherited from class org.eclipse.emf.exporter.ModelExporter |
---|
directoryURI, ePackageToGenPackageMap, GENANNOTATION_KEY_DIRECTORY_URI, GENANNOTATION_SOURCE_PREFIX, GENANNOTATION_SOURCE_SELECTED_EPACKAGES, GENANNOTATION_SOURCE_SELECTED_REFERENCES, genBaseToDetailsMap, saveEPackageArtifactURI, saveExporter |
Fields inherited from class org.eclipse.emf.converter.ModelConverter |
---|
ePackages, ePackageToInfoMap, externalGenModelList, externalGenModelResourceSet, genModel, referencedEPackageFilter, referencedEPackageFilterToConvert, referencedGenPackages, referencedGenPackageToInfoMap |
Constructor Summary | |
---|---|
HTMLExporter()
|
Method Summary | |
---|---|
java.lang.String |
computeClassifierLabel(EClassifier classifier)
|
java.lang.String |
computeConstraints(EModelElement modelElement)
|
java.lang.String |
computeEKeys(EReference reference)
|
java.lang.String |
computeLabel(EClassifier classifier)
|
java.lang.String |
computeLabel(EEnumLiteral enumLiteral)
|
protected java.lang.String |
computeLabel(EGenericType genericType)
|
protected java.lang.String |
computeLabel(ENamedElement namedElement)
|
java.lang.String |
computeLabel(EOperation operation)
|
java.lang.String |
computeTypedElementLabel(ETypedElement typedElement)
|
protected java.lang.String |
computeTypeParameterLabel(ETypeParameter typeParameter)
|
protected java.lang.String |
doCheckEPackageArtifactLocation(java.lang.String location,
java.lang.String packageName)
|
protected Diagnostic |
doExport(Monitor monitor,
ModelExporter.ExportData exportData)
Subclasses should overwrite this method, adding the code that performs the actions required to export the model. |
static java.lang.String |
escape(java.lang.String string)
|
GenPackage |
getCurrentGenPackage()
|
protected java.lang.String |
getDefaultArtifactLocation(EPackage ePackage)
|
protected java.util.List<EStructuralFeature> |
getDefaultEStructuralFeatureDetails()
|
java.util.List<EStructuralFeature> |
getDetails(EAttribute attribute)
Returns the list of 'details', ie EStructuralFeature s, that should
presented for each EAttribute . |
java.util.List<EStructuralFeature> |
getDetails(EClass eClass)
Returns the list of 'details', ie EStructuralFeature s, that should
presented for each EClass . |
java.util.List<EStructuralFeature> |
getDetails(EDataType dataType)
Returns the list of 'details', ie EStructuralFeature s, that should
presented for each EDataType . |
java.util.List<EStructuralFeature> |
getDetails(EEnumLiteral enumLiteral)
Returns the list of 'details', ie EStructuralFeature s, that should
presented for each EEnumLiteral . |
java.util.List<EStructuralFeature> |
getDetails(EOperation operation)
Returns the list of 'details', ie EStructuralFeature s, that should
presented for each EOperation . |
java.util.List<EStructuralFeature> |
getDetails(EReference reference)
Returns the list of 'details', ie EStructuralFeature s, that should
presented for each EReference . |
java.lang.String |
getID()
|
java.lang.String |
getLongText(java.lang.String string)
Returns a text that is suitable for displaying in HTML. |
URI |
getPackageArtifacttURI(EPackage ePackage)
|
protected void |
save(java.lang.String content)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public HTMLExporter()
Method Detail |
---|
public static java.lang.String escape(java.lang.String string)
public java.lang.String getID()
getID
in class ModelConverter
protected java.lang.String getDefaultArtifactLocation(EPackage ePackage)
getDefaultArtifactLocation
in class ModelExporter
protected java.lang.String doCheckEPackageArtifactLocation(java.lang.String location, java.lang.String packageName)
doCheckEPackageArtifactLocation
in class ModelExporter
protected Diagnostic doExport(Monitor monitor, ModelExporter.ExportData exportData) throws java.lang.Exception
ModelExporter
Subclasses should overwrite this method, adding the code that performs the actions required to export the model.
The Diagnostic
returned by this method should be used to provide
the user some information regarding a successfull export. If the
export fails, an exception should be thrown.
doExport
in class ModelExporter
Diagnostic
java.lang.Exception
public GenPackage getCurrentGenPackage()
public URI getPackageArtifacttURI(EPackage ePackage)
public java.lang.String computeClassifierLabel(EClassifier classifier)
protected java.lang.String computeTypeParameterLabel(ETypeParameter typeParameter)
public java.lang.String computeLabel(EClassifier classifier)
public java.util.List<EStructuralFeature> getDetails(EClass eClass)
EStructuralFeature
s, that should
presented for each EClass
.
EStructuralFeature
spublic java.util.List<EStructuralFeature> getDetails(EDataType dataType)
EStructuralFeature
s, that should
presented for each EDataType
.
EStructuralFeature
sprotected java.lang.String computeLabel(ENamedElement namedElement)
protected java.lang.String computeLabel(EGenericType genericType)
public java.lang.String computeTypedElementLabel(ETypedElement typedElement)
public java.util.List<EStructuralFeature> getDetails(EAttribute attribute)
EStructuralFeature
s, that should
presented for each EAttribute
.
EStructuralFeature
spublic java.util.List<EStructuralFeature> getDetails(EReference reference)
EStructuralFeature
s, that should
presented for each EReference
.
EStructuralFeature
sprotected java.util.List<EStructuralFeature> getDefaultEStructuralFeatureDetails()
public java.lang.String computeEKeys(EReference reference)
public java.lang.String computeLabel(EOperation operation)
public java.util.List<EStructuralFeature> getDetails(EOperation operation)
EStructuralFeature
s, that should
presented for each EOperation
.
EStructuralFeature
spublic java.lang.String computeLabel(EEnumLiteral enumLiteral)
public java.util.List<EStructuralFeature> getDetails(EEnumLiteral enumLiteral)
EStructuralFeature
s, that should
presented for each EEnumLiteral
.
EStructuralFeature
sprotected void save(java.lang.String content) throws java.io.IOException
java.io.IOException
public java.lang.String getLongText(java.lang.String string)
string
, checking whether it is already formated for HTML. If it is not, it replaces
line breaks by <br />.
string
- the string to be analyzed
public java.lang.String computeConstraints(EModelElement modelElement)
|
Copyright 2001-2006 IBM Corporation and others. All Rights Reserved. |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |