|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectca.uhn.hl7v2.conf.check.DefaultValidator
public class DefaultValidator
A default conformance validator.
Constructor Summary | |
---|---|
DefaultValidator()
Creates a new instance of DefaultValidator |
Method Summary | |
---|---|
static void |
main(java.lang.String[] args)
|
protected HL7Exception |
testCardinality(int reps,
int min,
int max,
java.lang.String usage,
java.lang.String name)
Checks cardinality and creates an appropriate exception if out of bounds. |
HL7Exception[] |
testComponent(Type type,
Component profile,
java.lang.String profileID)
|
HL7Exception[] |
testField(Type type,
Field profile,
boolean escape,
java.lang.String profileID)
|
HL7Exception[] |
testGroup(Group group,
AbstractSegmentContainer profile,
java.lang.String profileID)
Tests a group against a group section of a profile. |
HL7Exception |
testLength(Type type,
int maxLength)
Tests whether the given type falls within a maximum length. |
HL7Exception[] |
testSegment(Segment segment,
Seg profile,
java.lang.String profileID)
Tests a segment against a segment section of a profile. |
HL7Exception[] |
testStructure(Structure s,
ProfileStructure profile,
java.lang.String profileID)
Tests a structure (segment or group) against the corresponding part of a profile. |
HL7Exception[] |
testType(Type type,
AbstractComponent profile,
java.lang.String encoded,
java.lang.String profileID)
Tests a Type against the corresponding section of a profile. |
HL7Exception[] |
validate(Message message,
StaticDef profile)
Validates the given message against the given static definition from a conformance profile. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public DefaultValidator()
Method Detail |
---|
public HL7Exception[] validate(Message message, StaticDef profile) throws ProfileException, HL7Exception
Validator
validate
in interface Validator
ProfileException
- if a problem is encountered that interferes with evaluation
HL7Exception
Validator.validate(ca.uhn.hl7v2.model.Message, ca.uhn.hl7v2.conf.spec.message.StaticDef)
public HL7Exception[] testGroup(Group group, AbstractSegmentContainer profile, java.lang.String profileID) throws ProfileException
ProfileException
protected HL7Exception testCardinality(int reps, int min, int max, java.lang.String usage, java.lang.String name)
reps
- the number of repsmin
- the minimum number of repsmax
- the maximum number of reps (-1 means *)usage
- the usage codename
- the name of the repeating structure (used in exception msg)
public HL7Exception[] testStructure(Structure s, ProfileStructure profile, java.lang.String profileID) throws ProfileException
ProfileException
public HL7Exception[] testSegment(Segment segment, Seg profile, java.lang.String profileID) throws ProfileException
ProfileException
public HL7Exception[] testType(Type type, AbstractComponent profile, java.lang.String encoded, java.lang.String profileID)
encoded
- optional encoded form of type (if you want to specify this -- if null,
default pipe-encoded form is used to check length and constant val)public HL7Exception testLength(Type type, int maxLength)
public HL7Exception[] testField(Type type, Field profile, boolean escape, java.lang.String profileID) throws ProfileException
ProfileException
public HL7Exception[] testComponent(Type type, Component profile, java.lang.String profileID) throws ProfileException
ProfileException
public static void main(java.lang.String[] args)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |