1 19 20 package org.netbeans.modules.xml.axi.sync; 21 22 import org.netbeans.modules.xml.axi.*; 23 import org.netbeans.modules.xml.schema.model.GlobalAttribute; 24 import org.netbeans.modules.xml.schema.model.GlobalAttributeGroup; 25 import org.netbeans.modules.xml.schema.model.GlobalComplexType; 26 import org.netbeans.modules.xml.schema.model.GlobalElement; 27 import org.netbeans.modules.xml.schema.model.GlobalGroup; 28 29 30 39 public abstract class AbstractSyncTestCase extends AbstractTestCase { 40 41 44 public AbstractSyncTestCase(String testName, 45 String schemaFile, String globalElement) { 46 super(testName, schemaFile, globalElement); 47 } 48 49 GlobalElement findGlobalElement(String name) { 50 for(GlobalElement element : getSchemaModel().getSchema().getElements()) { 51 if(element.getName().equals(name)) 52 return element; 53 } 54 return null; 55 } 56 57 GlobalComplexType findGlobalComplexType(String name) { 58 for(GlobalComplexType type : getSchemaModel().getSchema().getComplexTypes()) { 59 if(type.getName().equals(name)) 60 return type; 61 } 62 return null; 63 } 64 65 GlobalGroup findGlobalGroup(String name) { 66 for(GlobalGroup group : getSchemaModel().getSchema().getGroups()) { 67 if(group.getName().equals(name)) 68 return group; 69 } 70 return null; 71 } 72 73 GlobalAttribute findGlobalAttribute(String name) { 74 for(GlobalAttribute attr : getSchemaModel().getSchema().getAttributes()) { 75 if(attr.getName().equals(name)) 76 return attr; 77 } 78 return null; 79 } 80 81 GlobalAttributeGroup findGlobalAttributeGroup(String name) { 82 for(GlobalAttributeGroup group : getSchemaModel().getSchema().getAttributeGroups()) { 83 if(group.getName().equals(name)) 84 return group; 85 } 86 return null; 87 } 88 } 89 | Popular Tags |