public void createParser() throws IOException {
- String parserPackagePostfix = "_elem";
String importerClassPostfix = "Importer";
String parserClassPostfix = "Parser";
- elementPackageName = name+parserPackagePostfix;
+
importParserDir= new File(converter.getParserDir().getAbsolutePath()+"/"+elementPackageName);
if (!importParserDir.exists())
mainWriter.close();
}
+ @Override
+ protected String getPackagePostFix() {
+ return "_elem";
+ }
+
@Override
public void handleSimpleType(SchemaObject parent, SchemaObject simpleTypeObj) {
}
@Override
public void createReferenceIndicator(SchemaObject parent, RefType referenceType, String refName, String objectName, String primaryClassName, String secondaryClassName, boolean useElementList, boolean useOriginalList) {
+ if (refName == null)
+ System.out.println();
FileWriter fw = getWriter(parent);
if (referenceType == RefType.Type) {
// create internal class for handling the element and child attachment
@Override
protected void createElementIndicator(SchemaObject parent, boolean useElementList, String refName, String className, boolean useOriginalList) {
+ if (refName == null)
+ System.out.println();
FileWriter fw = getWriter(parent);
//if (!reference)
fw.writer.println(" addParser(\""+ refName +"\", "+className+".class);");
public void handle(SchemaObject parent, Attribute attribute) {
if (parent == null)
return;
- String name = attribute.getName();
+ String attrName = attribute.getName();
QName primitiveType = attribute.getType();
SimpleType simpleType = attribute.getSimpleType();
QName ref = attribute.getRef();
String relationName;
- String attrName;
- if (name != null) {
- attrName = name;
- relationName = ontShort+"has"+name;
- if (parent != null)
- relationName = ontShort+getName(parent)+"_has"+name;
+ if (attrName != null) {
+ 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 = this.base.getRefAttribute(ref);
if (referred != null) {
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);