Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
 /*
  * Copyright 2009 the original author or authors.
  *
  * Licensed under the Apache License, Version 2.0 (the "License");
  * you may not use this file except in compliance with the License.
  * You may obtain a copy of the License at
  *
  *     http://www.apache.org/licenses/LICENSE-2.0
  *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */
package org.openehealth.ipf.commons.ihe.hl7v2.definitions;
Utilities to work with custom HAPI class definitions.

Author(s):
Dmytro Rud
public final class CustomModelClassUtils {
    private static final String CUSTOM_EVENT_MAP_DIRECTORY = "org/openehealth/ipf/commons/ihe/hl7v2/";
    private CustomModelClassUtils() {
        throw new IllegalStateException("Utility class, cannot instantiate");
    }

    
Creates a model class factory for the given transaction and HL7 version.
    public static CustomModelClassFactory createFactory(String transactionString version) {
        String packageName = String.format("%s.%s.%s",
                CustomModelClassUtils.class.getPackage().getName(),
                transaction,
                Version.versionOf(version).getPackageVersion());
        Map<StringString[]> map = Collections.singletonMap(versionnew String[]{packageName});
        CustomModelClassFactory cmcf = new CustomModelClassFactory(map);
        return cmcf;
    }

    
Creates a parser for the given transaction and HL7 version.

Deprecated:
the correct parser should be obtained from the ca.uhn.hl7v2.HapiContext that has been configured with the correct ca.uhn.hl7v2.parser.ModelClassFactory.
    public static Parser createParser(String transactionString version) {
        return new PipeParser(createFactory(transactionversion));
    }
New to GrepCode? Check out our FAQ X