private void attributeNamespaceDef(String ns) { AntTypeDefinition def = new AntTypeDefinition(); def.setName(ProjectHelper.nsToComponentName(ns)); def.setClassName(OATA + "attribute.AttributeNamespace"); def.setClassLoader(getClass().getClassLoader()); def.setRestrict(true); componentHelper.addDataTypeDefinition(def); }
/** * * @param name the name of the attribute. * @param componentHelper current component helper * @return AttributeComponentInformation instance */ private AttributeComponentInformation isRestrictedAttribute(String name, ComponentHelper componentHelper) { if (!name.contains(":")) { return new AttributeComponentInformation(null, false); } String componentName = attrToComponent(name); String ns = ProjectHelper.extractUriFromComponentName(componentName); if (componentHelper.getRestrictedDefinitions( ProjectHelper.nsToComponentName(ns)) == null) { return new AttributeComponentInformation(null, false); } return new AttributeComponentInformation(componentName, true); }
/** * Run the definition. * This registers the XML namespace (URI) as a namespace for * attributes. */ public void execute() { String componentName = ProjectHelper.nsToComponentName( getURI()); AntTypeDefinition def = new AntTypeDefinition(); def.setName(componentName); def.setClassName(AttributeNamespace.class.getName()); def.setClass(AttributeNamespace.class); def.setRestrict(true); def.setClassLoader(AttributeNamespace.class.getClassLoader()); ComponentHelper.getComponentHelper(getProject()) .addDataTypeDefinition(def); } }