All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.altova.text.edi.DataValueSubCodeListValidator Maven / Gradle / Ivy

There is a newer version: 2.0.4
Show newest version
////////////////////////////////////////////////////////////////////////
//
// DataValueSubCodeListValidator.java
//
// This file was generated by MapForce 2017sp2.
//
// YOU SHOULD NOT MODIFY THIS FILE, BECAUSE IT WILL BE
// OVERWRITTEN WHEN YOU RE-RUN CODE GENERATION.
//
// Refer to the MapForce Documentation for further details.
// http://www.altova.com/mapforce
//
////////////////////////////////////////////////////////////////////////

package com.altova.text.edi;

public class DataValueSubCodeListValidator extends DataValueCodeListValidator {
	int mPosOffset;
	int mPosLength;
	
	public DataValueSubCodeListValidator(boolean complete, int posOffset, int posLength, String[] codeList) {
		super(complete, codeList);
		mPosOffset = posOffset;
		mPosLength = posLength;
	}

	public boolean hasValue(String value) {
		if( mCodeList != null) {
			if( mPosOffset > 0 ) {
				value = value.substring( mPosOffset - 1, mPosOffset - 1 + mPosLength );
			}
			for( int i = 0; i < mCodeList.length; i++) {
				if( value.equals( mCodeList[i] ) )
					return true;
			}
		}
		else
			return true;
		
		return false;
	}

}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy