1 19 package org.netbeans.modules.xml.axi; 20 21 import java.io.IOException ; 22 import java.util.List ; 23 import javax.swing.text.BadLocationException ; 24 import org.netbeans.modules.xml.axi.impl.SchemaGeneratorFactoryImpl; 25 import org.netbeans.modules.xml.schema.model.SchemaModel; 26 27 31 public abstract class SchemaGeneratorFactory { 32 33 public enum TransformHint{ 34 OK, 35 SAME_DESIGN_PATTERN, 36 INVALID_SCHEMA, 37 NO_GLOBAL_ELEMENTS, 38 GLOBAL_ELEMENTS_HAVE_NO_CHILD_ELEMENTS, 39 GLOBAL_ELEMENTS_HAVE_NO_CHILD_ATTRIBUTES, 40 GLOBAL_ELEMENTS_HAVE_NO_CHILD_ELEMENTS_AND_ATTRIBUTES, 41 GLOBAL_ELEMENTS_HAVE_NO_GRAND_CHILDREN, 42 NO_ATTRIBUTES, 43 WILL_REMOVE_TYPES, 44 WILL_REMOVE_GLOBAL_ELEMENTS, 45 WILL_REMOVE_GLOBAL_ELEMENTS_AND_TYPES, 46 CANNOT_REMOVE_TYPES, 47 CANNOT_REMOVE_GLOBAL_ELEMENTS, 48 CANNOT_REMOVE_GLOBAL_ELEMENTS_AND_TYPES; 49 } 50 51 private static SchemaGeneratorFactory instance; 52 53 54 public static SchemaGeneratorFactory getDefault() { 55 if(instance == null) 56 instance = new SchemaGeneratorFactoryImpl(); 57 return instance; 58 } 59 60 64 public abstract SchemaGenerator.Pattern inferDesignPattern(AXIModel am); 65 66 70 public abstract void updateSchema(SchemaModel sm, 71 SchemaGenerator.Pattern pattern) throws BadLocationException , IOException ; 72 73 79 public abstract List <Element> findMasterGlobalElements(AXIModel am); 80 81 88 public abstract TransformHint canTransformSchema(SchemaModel sm, 89 SchemaGenerator.Pattern currentPattern, SchemaGenerator.Pattern targetPattern); 90 91 99 public abstract TransformHint canTransformSchema(SchemaModel sm, 100 SchemaGenerator.Pattern currentPattern, SchemaGenerator.Pattern targetPattern, 101 List <Element> ges); 102 103 107 public abstract void transformSchema(SchemaModel sm, 108 SchemaGenerator.Pattern targetPattern) throws IOException ; 109 } 110 | Popular Tags |