X-Git-Url: https://gerrit.simantics.org/r/gitweb?a=blobdiff_plain;f=org.simantics.xml.sax%2Fsrc%2Forg%2Fsimantics%2Fxml%2Fsax%2FExporterGenerator.java;h=5294e913fce5d13832c484467de8fbb3825489b1;hb=fc60d91049c46ee5b6107da4d4c54eada4a9f21c;hp=f538bcb42bae58e026e17978d0a5dd4e89945eff;hpb=77f3d80dca05a61969b3ecedc4e476066545c8b3;p=simantics%2Finterop.git diff --git a/org.simantics.xml.sax/src/org/simantics/xml/sax/ExporterGenerator.java b/org.simantics.xml.sax/src/org/simantics/xml/sax/ExporterGenerator.java index f538bcb..5294e91 100644 --- a/org.simantics.xml.sax/src/org/simantics/xml/sax/ExporterGenerator.java +++ b/org.simantics.xml.sax/src/org/simantics/xml/sax/ExporterGenerator.java @@ -40,10 +40,9 @@ public class ExporterGenerator extends JavaGenerator{ public void createParser() throws IOException { - String parserPackagePostfix = "_exp"; + String importerClassPostfix = "Exporter"; String parserClassPostfix = "Writer"; - elementPackageName = name+parserPackagePostfix; importParserDir= new File(converter.getParserDir().getAbsolutePath()+"/"+elementPackageName); if (!importParserDir.exists()) @@ -108,6 +107,11 @@ public class ExporterGenerator extends JavaGenerator{ mainWriter.close(); } + @Override + protected String getPackagePostFix() { + return "_exp"; + } + // @Override // protected void handle(TopLevelAttribute topLevelAttribute) { // @@ -428,13 +432,13 @@ public class ExporterGenerator extends JavaGenerator{ String attrName; if (name != null) { attrName = name; - relationName = ontShort+"has"+name; + relationName = ontShort+"has"+base.getName(attribute); if (parent != null) - relationName = ontShort+getName(parent)+"_has"+name; + relationName = ontShort+getName(parent)+"_has"+base.getName(attribute); } else if (ref != null && parent != null) { attrName = ref.getLocalPart(); - relationName = ontShort+getName(parent)+"_has"+ref.getLocalPart(); + relationName = ontShort+getName(parent)+"_has"+base.getName(ref); Attribute referred = base.getRefAttribute(ref); if (referred != null) { @@ -530,7 +534,7 @@ public class ExporterGenerator extends JavaGenerator{ FileWriter fw = getWriter(parent); NamedAttributeGroup group = this.base.getAttributeGroup(attribute.getRef()); fw.writer.println(commentTag+" AttributeGroup " + group.getName()); - SchemaObject obj = new SchemaObject(parent,attribute); + SchemaObject obj = new SchemaObject(base,parent,attribute); for (Annotated annotated : group.getAttributeOrAttributeGroup()) { if (annotated instanceof Attribute) { //handle("AttributeGroups_"+group.getName(),(Attribute)annotated);