/** * {@inheritDoc} */ @Override public GlobalsModel addGlobal(GlobalModel global) { addChildModel(global); _globals.add(global); return this; }
/** * Creates a new V1GlobalsModel with the specified configuration and descriptor. * @param config the configuration * @param desc the descriptor */ public V1GlobalsModel(Configuration config, Descriptor desc) { super(config, desc); for (Configuration global_config : config.getChildren(GLOBAL)) { GlobalModel global = (GlobalModel)readModel(global_config); if (global != null) { _globals.add(global); } } setModelChildrenOrder(GLOBAL); }
return new V1OperationsModel(config, desc); } else if (GLOBALS.equals(name)) { return new V1GlobalsModel(config, desc); } else if (GLOBAL.equals(name)) { return new V1GlobalModel(config, desc);
/** * Creates a new V1GlobalsModel in the specified namespace. * @param namespace the specified namespace */ public V1GlobalsModel(String namespace) { super(XMLHelper.createQName(namespace, GLOBALS)); setModelChildrenOrder(GLOBAL); }
return new V1OperationsModel(config, desc); } else if (GLOBALS.equals(name)) { return new V1GlobalsModel(config, desc); } else if (GLOBAL.equals(name)) { return new V1GlobalModel(config, desc);
/** * Creates a new V1GlobalsModel in the specified namespace. * @param namespace the specified namespace */ public V1GlobalsModel(String namespace) { super(XMLHelper.createQName(namespace, GLOBALS)); setModelChildrenOrder(GLOBAL); }
/** * Creates a new V1GlobalsModel with the specified configuration and descriptor. * @param config the configuration * @param desc the descriptor */ public V1GlobalsModel(Configuration config, Descriptor desc) { super(config, desc); for (Configuration global_config : config.getChildren(GLOBAL)) { GlobalModel global = (GlobalModel)readModel(global_config); if (global != null) { _globals.add(global); } } setModelChildrenOrder(GLOBAL); }
/** * Converts globals to mappings model. * @param globals globals * @param knowledgeNamespace knowledgeNamespace * @return mappings model */ protected GlobalsModel toGlobalsModel(Global[] globals, KnowledgeNamespace knowledgeNamespace) { GlobalsModel globalsModel = null; if (globals != null) { for (Global global : globals) { if (global != null) { GlobalModel globalModel = new V1GlobalModel(knowledgeNamespace.uri()); String from = global.from(); if (!UNDEFINED.equals(from)) { globalModel.setFrom(from); } String to = global.to(); if (!UNDEFINED.equals(to)) { globalModel.setTo(to); } if (globalsModel == null) { globalsModel = new V1GlobalsModel(knowledgeNamespace.uri()); } globalsModel.addGlobal(globalModel); } } } return globalsModel; }
/** * {@inheritDoc} */ @Override public GlobalsModel addGlobal(GlobalModel global) { addChildModel(global); _globals.add(global); return this; }
/** * Converts globals to mappings model. * @param globals globals * @param knowledgeNamespace knowledgeNamespace * @return mappings model */ protected GlobalsModel toGlobalsModel(Global[] globals, KnowledgeNamespace knowledgeNamespace) { GlobalsModel globalsModel = null; if (globals != null) { for (Global global : globals) { if (global != null) { GlobalModel globalModel = new V1GlobalModel(knowledgeNamespace.uri()); String from = global.from(); if (!UNDEFINED.equals(from)) { globalModel.setFrom(from); } String to = global.to(); if (!UNDEFINED.equals(to)) { globalModel.setTo(to); } if (globalsModel == null) { globalsModel = new V1GlobalsModel(knowledgeNamespace.uri()); } globalsModel.addGlobal(globalModel); } } } return globalsModel; }