本文整理汇总了Java中gov.nih.nci.cagrid.common.Utils.removeFromArray方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.removeFromArray方法的具体用法?Java Utils.removeFromArray怎么用?Java Utils.removeFromArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类gov.nih.nci.cagrid.common.Utils
的用法示例。
在下文中一共展示了Utils.removeFromArray方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: storeExtensionDataElement
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private void storeExtensionDataElement(ExtensionTypeExtensionData extensionData, Element elem) throws Exception {
MessageElement[] anys = extensionData.get_any();
for (int i = 0; (anys != null) && (i < anys.length); i++) {
if (anys[i].getQName().equals(Data.getTypeDesc().getXmlType())) {
// remove the old extension data
anys = (MessageElement[]) Utils.removeFromArray(anys, anys[i]);
break;
}
}
// create a message element from the JDom element
MessageElement data = null;
try {
data = AxisJdomUtils.fromElement(elem);
} catch (JDOMException ex) {
throw new Exception(
"Error converting extension data to Axis message element: " + ex.getMessage(), ex);
}
anys = (MessageElement[]) Utils.appendToArray(anys, data);
extensionData.set_any(anys);
}
示例2: storeExtensionDataElement
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private void storeExtensionDataElement(Element elem) throws UpgradeException {
MessageElement[] anys = getExtensionType().getExtensionData().get_any();
for (int i = 0; (anys != null) && (i < anys.length); i++) {
if (anys[i].getQName().equals(Data.getTypeDesc().getXmlType())) {
// remove the old extension data
anys = (MessageElement[]) Utils.removeFromArray(anys, anys[i]);
break;
}
}
// create a message element from the JDom element
MessageElement data = null;
try {
data = AxisJdomUtils.fromElement(elem);
} catch (JDOMException ex) {
throw new UpgradeException(
"Error converting extension data to Axis message element: " + ex.getMessage(), ex);
}
anys = (MessageElement[]) Utils.appendToArray(anys, data);
getExtensionType().getExtensionData().set_any(anys);
}
示例3: removeCadsrPackage
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
/**
* Removes a package from the model
*
* @param packageName
* The name of the package to remove
* @return
* True if the package was found and removed
* @throws Exception
*/
public boolean removeCadsrPackage(String packageName) throws Exception {
ModelInformation info = new ModelInformation();
ModelPackage[] packs = info.getModelPackage();
boolean found = false;
for (ModelPackage currentPackage : packs) {
if (currentPackage.getPackageName().equals(packageName)) {
packs = (ModelPackage[]) Utils.removeFromArray(packs, currentPackage);
found = true;
break;
}
}
info.setModelPackage(packs);
storeModelInformation(info);
return found;
}
示例4: removeAssociatedSchema
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private void removeAssociatedSchema(ServiceInformation info, ModelPackage pack) {
// get the mapped namespace for the package
NamespaceType mappedNamespace = modelInfoUtil.getMappedNamespace(pack.getPackageName());
if (mappedNamespace != null) {
// only need to do this if there is a namespace mapped to the package
// get the schema directory for the service
String serviceName = info.getIntroduceServiceProperties().getProperty(IntroduceConstants.INTRODUCE_SKELETON_SERVICE_NAME);
String schemaDir = CacoreWizardUtils.getServiceBaseDir(info) + File.separator + "schema" + File.separator + serviceName;
// get the namespace type from the service information
NamespaceType[] namespaces = info.getNamespaces().getNamespace();
for (int i = 0; i < namespaces.length; i++) {
if (namespaces[i].getNamespace().equals(mappedNamespace.getNamespace())) {
NamespaceType delme = namespaces[i];
File schemaFile = new File(schemaDir + File.separator + delme.getLocation());
schemaFile.delete();
namespaces = (NamespaceType[]) Utils.removeFromArray(namespaces, delme);
break;
}
}
info.getNamespaces().setNamespace(namespaces);
}
}
示例5: verifyProjectSelection
import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private boolean verifyProjectSelection(Project project) {
if (mostRecentProject != null && !projectEquals(mostRecentProject, project)) {
// package comes from a different project, which is not allowed
// prompt the developer about it
String[] choices = {"Remove all other packages and insert", "Cancel"};
String[] message = {"Domain models may only be derived from one project.",
"To add the package you've selected, all other packages",
"currently in the domain model will have to be removed.", "Should this operation procede?"};
String choice = PromptButtonDialog.prompt(GridApplication.getContext().getApplication(),
"Package incompatability...", message, choices, choices[1]);
if (choice == choices[0]) {
// user has elected to go with this project / package combination
// there are likley namespaces added to the service from previous
// package selections. These should be removed.
for (String packageName : getUmlTree().getPackagesInTree()) {
try {
NamespaceType nsType = modelInfoUtil.getMappedNamespace(packageName);
if (!CommonTools.isNamespaceTypeInUse(nsType, getServiceInfo().getServiceDescriptor())) {
NamespaceType[] allNamespaces = getServiceInfo().getNamespaces().getNamespace();
NamespaceType[] cleanedNamespaces = (NamespaceType[]) Utils.removeFromArray(
allNamespaces, nsType);
getServiceInfo().getNamespaces().setNamespace(cleanedNamespaces);
}
// clear the package out of the UML tree
getUmlTree().removeUmlPackage(packageName);
} catch (Exception ex) {
ex.printStackTrace();
CompositeErrorDialog.showErrorDialog("Error removing namespace for package", ex.getMessage(),
ex);
return false;
}
}
// inform whom it may concern that classes were cleared
fireClassesCleared();
// change the most recent project
mostRecentProject = project;
} else {
return false;
}
}
return true;
}