当前位置: 首页>>代码示例>>Java>>正文


Java Utils.appendToArray方法代码示例

本文整理汇总了Java中gov.nih.nci.cagrid.common.Utils.appendToArray方法的典型用法代码示例。如果您正苦于以下问题:Java Utils.appendToArray方法的具体用法?Java Utils.appendToArray怎么用?Java Utils.appendToArray使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在gov.nih.nci.cagrid.common.Utils的用法示例。


在下文中一共展示了Utils.appendToArray方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:21,代码来源:UpgradeFrom1pt4to1pt6.java

示例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);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:21,代码来源:DataServiceUpgradeFrom1pt4.java

示例3: addAdditionalJar

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
/**
 * Adds an additional jar
 * 
 * @param jarName
 *      The name of the jar to add
 * @throws Exception
 */
public void addAdditionalJar(String jarName) throws Exception {
    AdditionalLibraries libs = getAdditionalLibraries();
    String[] jarNames = null;
    if (libs.getJarName() == null) {
        jarNames = new String[] {jarName};
    } else {
        boolean shouldAdd = true;
        for (String name : libs.getJarName()) {
            if (name.equals(jarName)) {
                shouldAdd = false;
                break;
            }
        }
        if (shouldAdd) {
            jarNames = (String[]) Utils.appendToArray(libs.getJarName(), jarName);
        }
    }
    libs.setJarName(jarNames);
    storeAdditionalLibraries(libs);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:28,代码来源:ExtensionDataManager.java

示例4: storeModelPackage

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
/**
 * Stores a Model Package.  If an existing package has the same name,
 * the existing package will be replaced
 * 
 * @param pack
 * @throws Exception
 */
public void storeModelPackage(ModelPackage pack) throws Exception {
    ModelInformation info = getModelInformation();
    ModelPackage[] currentPackages = info.getModelPackage();
    if (currentPackages == null) {
        currentPackages = new ModelPackage[] {pack};
    } else {
        boolean replaced = false;
        for (int i = 0; i < currentPackages.length; i++) {
            if (currentPackages[i].getPackageName().equals(pack.getPackageName())) {
                currentPackages[i] = pack;
                replaced = true;
                break;
            }
        }
        if (!replaced) {
            currentPackages = (ModelPackage[]) Utils.appendToArray(currentPackages, pack);
        }
    }
    info.setModelPackage(currentPackages);
    storeModelInformation(info);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:29,代码来源:ExtensionDataManager.java

示例5: setServiceProperty

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
/**
 * Sets a service property on the service information. If no service
 * properties are found, a new array of properties is created and
 * initialized with a single property containing the key and value
 * specified. If the property is found to exist in the service, it's value
 * is changed to the one specified.
 * 
 * @param desc
 *            The service information to set a property on
 * @param key
 *            The key of the service property to set
 * @param value
 *            The value to associate with the property key
 * @param description
 *            The description of the service property
 */
public static void setServiceProperty(ServiceDescription desc, String key, String value, boolean isFromETC,
    String description) {
    if (description == null) {
        description = "";
    }
    ServiceProperties props = desc.getServiceProperties();
    if (props == null) {
        props = new ServiceProperties();
        desc.setServiceProperties(props);
    }
    ServicePropertiesProperty[] allProperties = props.getProperty();
    if (allProperties == null) {
        allProperties = new ServicePropertiesProperty[]{new ServicePropertiesProperty(description, new Boolean(
            isFromETC), key, value)};
    } else {
        boolean found = false;
        for (int i = 0; i < allProperties.length; i++) {
            if (allProperties[i].getKey().equals(key)) {
                allProperties[i].setValue(value);
                allProperties[i].setIsFromETC(new Boolean(isFromETC));
                allProperties[i].setDescription(description);
                found = true;
                break;
            }
        }
        if (!found) {
            allProperties = (ServicePropertiesProperty[]) Utils.appendToArray(allProperties,
                new ServicePropertiesProperty(description, new Boolean(isFromETC), key, value));
        }
    }
    props.setProperty(allProperties);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:49,代码来源:CommonTools.java

示例6: getExpectedLocalClientLibFiles

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public static String[] getExpectedLocalClientLibFiles(String applicationName) {
    String[] applicationJarNames = new String[]{applicationName + "-beans.jar", applicationName + "-orm.jar",
            applicationName + "-schema.jar"};
    String[] expected = LOCAL_CLIENT_LIB;
    for (String name : applicationJarNames) {
        expected = (String[]) Utils.appendToArray(expected, name);
    }
    return expected;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:10,代码来源:SdkProjectExpectedFiles.java

示例7: getExpectedRemoteClientLibFiles

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
public static String[] getExpectedRemoteClientLibFiles(String applicationName) {
    String[] applicationJarNames = new String[]{applicationName + "-beans.jar", applicationName + "-schema.jar"};
    String[] expected = REMOTE_CLIENT_LIB;
    for (String name : applicationJarNames) {
        expected = (String[]) Utils.appendToArray(expected, name);
    }
    return expected;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:9,代码来源:SdkProjectExpectedFiles.java

示例8: getTargetServiceStatus

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private TargetServiceStatus getTargetServiceStatus(String serviceURL) throws InternalErrorFault, ResourceException {
    FederatedQueryExecutionStatus executionStatus = getExecutionStatus();
    TargetServiceStatus status = null;
    if (executionStatus.getTargetServiceStatus() == null) {
        executionStatus.setTargetServiceStatus(new TargetServiceStatus[0]);
    }
    for (TargetServiceStatus storedStatus : executionStatus.getTargetServiceStatus()) {
        if (storedStatus.getServiceURL().toString().equals(serviceURL)) {
            status = storedStatus;
            break;
        }
    }
    if (status == null) {
        status = new TargetServiceStatus();
        try {
            status.setServiceURL(new URI(serviceURL));
        } catch (MalformedURIException ex) {
            FaultHelper helper = new FaultHelper(new InternalErrorFault());
            helper.addDescription("Error parsing data service URL");
            helper.addDescription(ex.getMessage());
            helper.addFaultCause(ex);
            throw (InternalErrorFault) helper.getFault();
        }
        TargetServiceStatus[] statusArray = 
            (TargetServiceStatus[]) Utils.appendToArray(executionStatus.getTargetServiceStatus(), status);
        executionStatus.setTargetServiceStatus(statusArray);
    }
    return status;
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:30,代码来源:FederatedQueryResultsResourcePropertyManager.java

示例9: getConfigLocations

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
@Override
protected String[] getConfigLocations() {
    return (String[]) Utils.appendToArray(super.getConfigLocations(),
        SpringTestApplicationContextConstants.SIMPLE_LOCATION);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:6,代码来源:GMETestCaseWithSimpleModel.java

示例10: getConfigLocations

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
@Override
protected String[] getConfigLocations() {
    return (String[]) Utils.appendToArray(super.getConfigLocations(),
        SpringTestApplicationContextConstants.REDEFINES_LOCATION);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:6,代码来源:GMEAddSchemaRedefinesTestCase.java

示例11: getConfigLocations

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
@Override
protected String[] getConfigLocations() {
    return (String[]) Utils.appendToArray(super.getConfigLocations(),
        SpringTestApplicationContextConstants.CYCLES_LOCATION);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:6,代码来源:GMEAddSchemaCyclesTestCase.java

示例12: getConfigLocations

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
@Override
protected String[] getConfigLocations() {
    return (String[]) Utils.appendToArray(super.getConfigLocations(),
        SpringTestApplicationContextConstants.ERRORS_LOCATION);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:6,代码来源:GMEAddSchemaErrorsTestCase.java

示例13: getConfigLocations

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
@Override
protected String[] getConfigLocations() {
    return (String[]) Utils.appendToArray(super.getConfigLocations(),
        SpringTestApplicationContextConstants.INCLUDES_LOCATION);
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:6,代码来源:GMEAddSchemaIncludesTestCase.java

示例14: addUmlPackage

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
private void addUmlPackage(UMLPackageMetadata pack) {
    // see if the package name is new
    boolean newName = true;
    for (int i = 0; i < getSelectedPackagesList().getModel().getSize(); i++) {
        if (pack.getName().equals(getSelectedPackagesList().getModel().getElementAt(i))) {
            newName = false;
            break;
        }
    }

    if (newName) {
        // add the package name to the list
        String[] names = new String[getSelectedPackagesList().getModel().getSize() + 1];
        for (int i = 0; i < getSelectedPackagesList().getModel().getSize(); i++) {
            names[i] = (String) getSelectedPackagesList().getModel().getElementAt(i);
        }
        names[names.length - 1] = pack.getName();
        getSelectedPackagesList().setListData(names);
        // add the package to the cadsr information in extension data
        try {
            ModelInformation info = getModelInformation();
            // create cadsr package for the new metadata package
            ModelPackage newPackage = new ModelPackage();
            newPackage.setPackageName(pack.getName());
            ModelClass[] modelClasses = createModelClasses(lastSelectedProject, pack);
            newPackage.setModelClass(modelClasses);
            ModelPackage[] packages = info.getModelPackage();
            if (packages == null) {
                packages = new ModelPackage[]{newPackage};
            } else {
                packages = (ModelPackage[]) Utils.appendToArray(packages, newPackage);
            }
            info.setModelPackage(packages);
            UMLProjectIdentifer id = new UMLProjectIdentifer();
            id.setIdentifier(lastSelectedProject.getShortName());
            id.setVersion(lastSelectedProject.getVersion());
            info.setUMLProjectIdentifer(id);
            storeModelInformation(info);
        } catch (Exception ex) {
            ex.printStackTrace();
            CompositeErrorDialog.showErrorDialog("Error storing the new package information", ex);
        }
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:45,代码来源:DomainModelPanel.java

示例15: addExtensionToService

import gov.nih.nci.cagrid.common.Utils; //导入方法依赖的package包/类
/**
 * Adds an extension's functionality to an <b><i>existing</i></b>
 * service. The extension will be added to the extensions list, and its
 * creation processes invoked against the service.
 * 
 * @param service
 *            The service to extend
 * @param extensionName
 *            The name of the service extension
 */
public static void addExtensionToService(ServiceInformation service, String extensionName)
    throws CreationExtensionException {
    // locate the extension
    ExtensionDescription extensionDescription = ExtensionsLoader.getInstance().getExtension(extensionName);
    ServiceExtensionDescriptionType serviceExtensionDescription = ExtensionsLoader.getInstance()
        .getServiceExtension(extensionName);
    if (extensionDescription == null || serviceExtensionDescription == null) {
        logger.warn("Extension description NOT FOUND for " + extensionName);
        throw new CreationExtensionException("No service extension named " + extensionName
            + " was able to be loaded");
    }
    // add the extension to the service information
    logger.info("Creating new extension type");
    ExtensionType addedExtension = new ExtensionType();
    addedExtension.setName(extensionName);
    addedExtension.setVersion(extensionDescription.getVersion());
    addedExtension.setExtensionType(extensionDescription.getExtensionType());
    logger.info("Appending extension to extensions list");
    if (service.getExtensions() == null) {
        service.setExtensions(new ExtensionsType());
    }
    ExtensionType[] serviceExtensions = service.getExtensions().getExtension();
    if (serviceExtensions == null) {
        serviceExtensions = new ExtensionType[]{addedExtension};
    } else {
        serviceExtensions = (ExtensionType[]) Utils.appendToArray(serviceExtensions, addedExtension);
    }
    service.getExtensions().setExtension(serviceExtensions);
    // invoke the creation post processor
    CreationExtensionPostProcessor creationPostProcessor = null;
    try {
        creationPostProcessor = getCreationPostProcessor(extensionName);
    } catch (Exception ex) {
        logger.error("ERROR LOADING EXTENSION POST PROCESSOR");
        throw new CreationExtensionException("Error loading post processor for extension: " + ex.getMessage(), ex);
    }
    if (creationPostProcessor != null) {
        logger.info("Invoking extension creation post processor");
        creationPostProcessor.postCreate(serviceExtensionDescription, service);
    }
}
 
开发者ID:NCIP,项目名称:cagrid-core,代码行数:52,代码来源:ExtensionTools.java


注:本文中的gov.nih.nci.cagrid.common.Utils.appendToArray方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。