Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  //
  // This file was generated by the JavaTM Architecture for XML Binding(JAXB) Reference Implementation, v1.0.6-01/24/2006 06:15 PM(kohsuke)-fcs 
  // See <a href="http://java.sun.com/xml/jaxb">http://java.sun.com/xml/jaxb</a> 
  // Any modifications to this file will be lost upon recompilation of the source schema. 
  // Generated on: 2007.03.26 at 04:39:11 PM CEST 
  //
  
  
  package org.jvnet.jaxbvalidation.tests.one.validation;
 
 {
 
 
     public void check(org.jvnet.jaxbcommons.locator.ObjectLocator locatorjavax.xml.bind.ValidationEventHandler handlerjava.lang.Object draftValue) {
         if (draftValue!= null) {
             final org.jvnet.jaxbvalidation.tests.one.STARAllocationType value = ((org.jvnet.jaxbvalidation.tests.one.STARAllocationTypedraftValue);
             {
                 final org.jvnet.jaxbcommons.locator.FieldObjectLocator fieldLocator = new org.jvnet.jaxbcommons.locator.DefaultFieldObjectLocator(locatorvalue"Adep");
                 if (!value.isSetAdep()) {
                     // Report missing object
                     handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(fieldLocatornew org.jvnet.jaxbvalidation.problem.structure.EmptyFieldProblem()));
                 } else {
                     // Check value
                     fieldValidator.check(fieldLocatorhandlervalue.getAdep());
                 }
             }
             {
                 final org.jvnet.jaxbcommons.locator.FieldObjectLocator fieldLocator = new org.jvnet.jaxbcommons.locator.DefaultFieldObjectLocator(locatorvalue"AircaftClass");
                 if (!value.isSetAircaftClass()) {
                     // Report missing object
                     handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(fieldLocatornew org.jvnet.jaxbvalidation.problem.structure.EmptyFieldProblem()));
                 } else {
                     // Check value
                     fieldValidator.check(fieldLocatorhandlervalue.getAircaftClass());
                 }
             }
             {
                 final org.jvnet.jaxbcommons.locator.FieldObjectLocator fieldLocator = new org.jvnet.jaxbcommons.locator.DefaultFieldObjectLocator(locatorvalue"Comment");
                 if (!value.isSetComment()) {
                     // Report missing object
                     handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(fieldLocatornew org.jvnet.jaxbvalidation.problem.structure.EmptyFieldProblem()));
                 } else {
                     // Check value
                     fieldValidator.check(fieldLocatorhandlervalue.getComment());
                 }
             }
             {
                 final org.jvnet.jaxbcommons.locator.FieldObjectLocator fieldLocator = new org.jvnet.jaxbcommons.locator.DefaultFieldObjectLocator(locatorvalue"FromTime");
                 if (!value.isSetFromTime()) {
                     // Report missing object
                     handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(fieldLocatornew org.jvnet.jaxbvalidation.problem.structure.EmptyFieldProblem()));
                 } else {
                     // Check value
                     fieldValidator.check(fieldLocatorhandlervalue.getFromTime());
                 }
             }
             {
                 final org.jvnet.jaxbcommons.locator.FieldObjectLocator fieldLocator = new org.jvnet.jaxbcommons.locator.DefaultFieldObjectLocator(locatorvalue"ToTime");
                 if (!value.isSetToTime()) {
                     // Report missing object
                     handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(fieldLocatornew org.jvnet.jaxbvalidation.problem.structure.EmptyFieldProblem()));
                 } else {
                     // Check value
                     fieldValidator.check(fieldLocatorhandlervalue.getToTime());
                 }
             }
             if (value.isSetRefPoint1()) {
                 // If left exists
                 {
                     final org.jvnet.jaxbcommons.locator.FieldObjectLocator fieldLocator = new org.jvnet.jaxbcommons.locator.DefaultFieldObjectLocator(locatorvalue"RefPoint1");
                     if (!value.isSetRefPoint1()) {
                         // Report missing object
                         handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(fieldLocatornew org.jvnet.jaxbvalidation.problem.structure.EmptyFieldProblem()));
                     } else {
                         // Check count
                         if (value.getRefPoint1().size()< 0) {
                             // Report minimum of occurences violated
                             handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(fieldLocatornew org.jvnet.jaxbvalidation.problem.structure.TooFewElementsProblem(value.getRefPoint1().size(), 0)));
                         }
                         // Check value
                         fieldValidator.check(fieldLocatorhandlervalue.getRefPoint1());
                     }
                 }
             }
             if (value.isSetRefPoint2()) {
                 // If left exists
                 {
                     final org.jvnet.jaxbcommons.locator.FieldObjectLocator fieldLocator = new org.jvnet.jaxbcommons.locator.DefaultFieldObjectLocator(locatorvalue"RefPoint2");
                     if (!value.isSetRefPoint2()) {
                         // Report missing object
                         handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(fieldLocatornew org.jvnet.jaxbvalidation.problem.structure.EmptyFieldProblem()));
                    } else {
                        // Check count
                        if (value.getRefPoint2().size()< 0) {
                            // Report minimum of occurences violated
                            handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(fieldLocatornew org.jvnet.jaxbvalidation.problem.structure.TooFewElementsProblem(value.getRefPoint2().size(), 0)));
                        }
                        // Check value
                        fieldValidator.check(fieldLocatorhandlervalue.getRefPoint2());
                    }
                }
            }
            if (value.isSetRefSTAR()) {
                // If left exists
                {
                    final org.jvnet.jaxbcommons.locator.FieldObjectLocator fieldLocator = new org.jvnet.jaxbcommons.locator.DefaultFieldObjectLocator(locatorvalue"RefSTAR");
                    if (!value.isSetRefSTAR()) {
                        // Report missing object
                        handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(fieldLocatornew org.jvnet.jaxbvalidation.problem.structure.EmptyFieldProblem()));
                    } else {
                        // Check count
                        if (value.getRefSTAR().size()< 0) {
                            // Report minimum of occurences violated
                            handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(fieldLocatornew org.jvnet.jaxbvalidation.problem.structure.TooFewElementsProblem(value.getRefSTAR().size(), 0)));
                        }
                        // Check value
                        fieldValidator.check(fieldLocatorhandlervalue.getRefSTAR());
                    }
                }
            }
        }
    }
    {
        public void check(org.jvnet.jaxbcommons.locator.ObjectLocator locatorjavax.xml.bind.ValidationEventHandler handlerjava.lang.Object value) {
            checkValue(locatorhandlervalue);
        }
        public void checkValue(org.jvnet.jaxbcommons.locator.ObjectLocator locatorjavax.xml.bind.ValidationEventHandler handlerjava.lang.Object draftValue) {
            final java.lang.String value = ((java.lang.StringdraftValue);
            if (value instanceof java.lang.String) {
                java.lang.String realValue = ((java.lang.Stringvalue);
                // Check primitive value
                {
                    // Perform the check
                    // Checking class com.sun.msv.datatype.xsd.FinalComponent datatype
                    org.jvnet.jaxbvalidation.problem.datatype.ValueProblem problem = null;
                    if (null!= problem) {
                        // Handle event
                        handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(locatorproblem));
                    }
                }
            } else {
                if (null == value) {
                    // todo: report null
                } else {
                    // Report wrong class
                    handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(locatornew org.jvnet.jaxbvalidation.problem.structure.NonExpectedClassProblem(value.getClass())));
                }
            }
        }
    }
    {
        protected java.lang.Object[] values = new java.lang.Object[] {"3""2""1"};
        protected java.util.Set valueSet = java.util.Collections.unmodifiableSet(new java.util.HashSet(java.util.Arrays.asList()));
        public void check(org.jvnet.jaxbcommons.locator.ObjectLocator locatorjavax.xml.bind.ValidationEventHandler handlerjava.lang.Object value) {
            checkValue(locatorhandlervalue);
        }
        public void checkValue(org.jvnet.jaxbcommons.locator.ObjectLocator locatorjavax.xml.bind.ValidationEventHandler handlerjava.lang.Object draftValue) {
            final java.lang.String value = ((java.lang.StringdraftValue);
            if (value instanceof java.lang.String) {
                java.lang.String realValue = ((java.lang.Stringvalue);
                // Check primitive value
                {
                    // Perform the check
                    // Checking class com.sun.msv.datatype.xsd.EnumerationFacet datatype
                    org.jvnet.jaxbvalidation.problem.datatype.ValueProblem problem = null;
                    if (.contains(realValue)) {
                        // Value is found in the enumeration, it is valid
                    } else {
                        problem = new org.jvnet.jaxbvalidation.problem.datatype.EnumerationProblem(realValue);
                    }
                    if (null!= problem) {
                        // Handle event
                        handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(locatorproblem));
                    }
                }
            } else {
                if (null == value) {
                    // todo: report null
                } else {
                    // Report wrong class
                    handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(locatornew org.jvnet.jaxbvalidation.problem.structure.NonExpectedClassProblem(value.getClass())));
                }
            }
        }
    }
    {
        public void check(org.jvnet.jaxbcommons.locator.ObjectLocator locatorjavax.xml.bind.ValidationEventHandler handlerjava.lang.Object value) {
            checkValue(locatorhandlervalue);
        }
        public void checkValue(org.jvnet.jaxbcommons.locator.ObjectLocator locatorjavax.xml.bind.ValidationEventHandler handlerjava.lang.Object draftValue) {
            final java.lang.String value = ((java.lang.StringdraftValue);
            if (value instanceof java.lang.String) {
                java.lang.String realValue = ((java.lang.Stringvalue);
                // Check primitive value
                {
                    // Perform the check
                    // Checking class com.sun.msv.datatype.xsd.FinalComponent datatype
                    org.jvnet.jaxbvalidation.problem.datatype.ValueProblem problem = null;
                    if (null!= problem) {
                        // Handle event
                        handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(locatorproblem));
                    }
                }
            } else {
                if (null == value) {
                    // todo: report null
                } else {
                    // Report wrong class
                    handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(locatornew org.jvnet.jaxbvalidation.problem.structure.NonExpectedClassProblem(value.getClass())));
                }
            }
        }
    }
    {
        public void check(org.jvnet.jaxbcommons.locator.ObjectLocator locatorjavax.xml.bind.ValidationEventHandler handlerjava.lang.Object value) {
            checkValue(locatorhandlervalue);
        }
        public void checkValue(org.jvnet.jaxbcommons.locator.ObjectLocator locatorjavax.xml.bind.ValidationEventHandler handlerjava.lang.Object draftValue) {
            final java.lang.String value = ((java.lang.StringdraftValue);
            if (value instanceof java.lang.String) {
                java.lang.String realValue = ((java.lang.Stringvalue);
                // Check primitive value
                {
                    // Perform the check
                    // Checking class com.sun.msv.datatype.xsd.PatternFacet datatype
                    org.jvnet.jaxbvalidation.problem.datatype.ValueProblem problem = null;
                    if (!new com.sun.org.apache.xerces.internal.impl.xpath.regex.RegularExpression("[MONDAY|THUESDAY|WEDNESDAY|THIRSDAY, FRIDAY, SATURDAY|SUNDAY|TUESDAY|THURSDAY][0-2][0-3][0-5][0-9]""X").matches(realValue.toString())) {
                        problem = new org.jvnet.jaxbvalidation.problem.datatype.RegularExpressionProblem(realValue"[MONDAY|THUESDAY|WEDNESDAY|THIRSDAY, FRIDAY, SATURDAY|SUNDAY|TUESDAY|THURSDAY][0-2][0-3][0-5][0-9]");
                    }
                    if (null!= problem) {
                        // Handle event
                        handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(locatorproblem));
                    }
                }
            } else {
                if (null == value) {
                    // todo: report null
                } else {
                    // Report wrong class
                    handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(locatornew org.jvnet.jaxbvalidation.problem.structure.NonExpectedClassProblem(value.getClass())));
                }
            }
        }
    }
    {
        public void check(org.jvnet.jaxbcommons.locator.ObjectLocator parentLocatorjavax.xml.bind.ValidationEventHandler handlerjava.lang.Object value) {
            final java.util.List values = ((java.util.Listvalue);
            final org.jvnet.jaxbcommons.locator.ObjectLocator locator = new org.jvnet.jaxbcommons.locator.DefaultFieldObjectLocator(parentLocator"RefPoint1");
            if (values!= null) {
                for (int index = 0; (index<values.size()); index ++) {
                    java.lang.Object item = values.get(index);
                    checkEntry(locatorhandlerindexitem);
                }
            }
        }
        public void checkEntry(org.jvnet.jaxbcommons.locator.ObjectLocator locatorjavax.xml.bind.ValidationEventHandler handlerint indexjava.lang.Object value) {
            final org.jvnet.jaxbcommons.locator.ObjectLocator entryLocator = new org.jvnet.jaxbcommons.locator.DefaultListEntryObjectLocator(locatorindex);
            checkValue(entryLocatorhandlervalue);
        }
        public void checkValue(org.jvnet.jaxbcommons.locator.ObjectLocator locatorjavax.xml.bind.ValidationEventHandler handlerjava.lang.Object draftValue) {
            if (value instanceof org.jvnet.jaxbvalidation.tests.one.CharacteristicPointRef) {
                {
                    // Check complex value
                    validator.check(locatorhandlerrealValue);
                }
            } else {
                if (null == value) {
                    // todo: report null
                } else {
                    // Report wrong class
                    handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(locatornew org.jvnet.jaxbvalidation.problem.structure.NonExpectedClassProblem(value.getClass())));
                }
            }
        }
    }
    {
        public void check(org.jvnet.jaxbcommons.locator.ObjectLocator parentLocatorjavax.xml.bind.ValidationEventHandler handlerjava.lang.Object value) {
            final java.util.List values = ((java.util.Listvalue);
            final org.jvnet.jaxbcommons.locator.ObjectLocator locator = new org.jvnet.jaxbcommons.locator.DefaultFieldObjectLocator(parentLocator"RefPoint2");
            if (values!= null) {
                for (int index = 0; (index<values.size()); index ++) {
                    java.lang.Object item = values.get(index);
                    checkEntry(locatorhandlerindexitem);
                }
            }
        }
        public void checkEntry(org.jvnet.jaxbcommons.locator.ObjectLocator locatorjavax.xml.bind.ValidationEventHandler handlerint indexjava.lang.Object value) {
            final org.jvnet.jaxbcommons.locator.ObjectLocator entryLocator = new org.jvnet.jaxbcommons.locator.DefaultListEntryObjectLocator(locatorindex);
            checkValue(entryLocatorhandlervalue);
        }
        public void checkValue(org.jvnet.jaxbcommons.locator.ObjectLocator locatorjavax.xml.bind.ValidationEventHandler handlerjava.lang.Object draftValue) {
            if (value instanceof org.jvnet.jaxbvalidation.tests.one.CharacteristicPointRef) {
                {
                    // Check complex value
                    validator.check(locatorhandlerrealValue);
                }
            } else {
                if (null == value) {
                    // todo: report null
                } else {
                    // Report wrong class
                    handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(locatornew org.jvnet.jaxbvalidation.problem.structure.NonExpectedClassProblem(value.getClass())));
                }
            }
        }
    }
    {
        public void check(org.jvnet.jaxbcommons.locator.ObjectLocator parentLocatorjavax.xml.bind.ValidationEventHandler handlerjava.lang.Object value) {
            final java.util.List values = ((java.util.Listvalue);
            final org.jvnet.jaxbcommons.locator.ObjectLocator locator = new org.jvnet.jaxbcommons.locator.DefaultFieldObjectLocator(parentLocator"RefSTAR");
            if (values!= null) {
                for (int index = 0; (index<values.size()); index ++) {
                    java.lang.Object item = values.get(index);
                    checkEntry(locatorhandlerindexitem);
                }
            }
        }
        public void checkEntry(org.jvnet.jaxbcommons.locator.ObjectLocator locatorjavax.xml.bind.ValidationEventHandler handlerint indexjava.lang.Object value) {
            final org.jvnet.jaxbcommons.locator.ObjectLocator entryLocator = new org.jvnet.jaxbcommons.locator.DefaultListEntryObjectLocator(locatorindex);
            checkValue(entryLocatorhandlervalue);
        }
        public void checkValue(org.jvnet.jaxbcommons.locator.ObjectLocator locatorjavax.xml.bind.ValidationEventHandler handlerjava.lang.Object draftValue) {
            final org.jvnet.jaxbvalidation.tests.one.STARRef value = ((org.jvnet.jaxbvalidation.tests.one.STARRefdraftValue);
            if (value instanceof org.jvnet.jaxbvalidation.tests.one.STARRef) {
                org.jvnet.jaxbvalidation.tests.one.STARRef realValue = ((org.jvnet.jaxbvalidation.tests.one.STARRefvalue);
                {
                    // Check complex value
                    validator.check(locatorhandlerrealValue);
                }
            } else {
                if (null == value) {
                    // todo: report null
                } else {
                    // Report wrong class
                    handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(locatornew org.jvnet.jaxbvalidation.problem.structure.NonExpectedClassProblem(value.getClass())));
                }
            }
        }
    }
    {
        public void check(org.jvnet.jaxbcommons.locator.ObjectLocator locatorjavax.xml.bind.ValidationEventHandler handlerjava.lang.Object value) {
            checkValue(locatorhandlervalue);
        }
        public void checkValue(org.jvnet.jaxbcommons.locator.ObjectLocator locatorjavax.xml.bind.ValidationEventHandler handlerjava.lang.Object draftValue) {
            final java.lang.String value = ((java.lang.StringdraftValue);
            if (value instanceof java.lang.String) {
                java.lang.String realValue = ((java.lang.Stringvalue);
                // Check primitive value
                {
                    // Perform the check
                    // Checking class com.sun.msv.datatype.xsd.PatternFacet datatype
                    org.jvnet.jaxbvalidation.problem.datatype.ValueProblem problem = null;
                    if (!new com.sun.org.apache.xerces.internal.impl.xpath.regex.RegularExpression("[MONDAY|THUESDAY|WEDNESDAY|THIRSDAY, FRIDAY, SATURDAY|SUNDAY|TUESDAY|THURSDAY][0-2][0-3][0-5][0-9]""X").matches(realValue.toString())) {
                        problem = new org.jvnet.jaxbvalidation.problem.datatype.RegularExpressionProblem(realValue"[MONDAY|THUESDAY|WEDNESDAY|THIRSDAY, FRIDAY, SATURDAY|SUNDAY|TUESDAY|THURSDAY][0-2][0-3][0-5][0-9]");
                    }
                    if (null!= problem) {
                        // Handle event
                        handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(locatorproblem));
                    }
                }
            } else {
                if (null == value) {
                    // todo: report null
                } else {
                    // Report wrong class
                    handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(locatornew org.jvnet.jaxbvalidation.problem.structure.NonExpectedClassProblem(value.getClass())));
                }
            }
        }
    }
New to GrepCode? Check out our FAQ X