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.AlertType value = ((org.jvnet.jaxbvalidation.tests.one.AlertTypedraftValue);
             {
                 final org.jvnet.jaxbcommons.locator.FieldObjectLocator fieldLocator = new org.jvnet.jaxbcommons.locator.DefaultFieldObjectLocator(locatorvalue"MaxOutput");
                 if (!value.isSetMaxOutput()) {
                     // Report missing object
                     handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(fieldLocatornew org.jvnet.jaxbvalidation.problem.structure.EmptyFieldProblem()));
                 } else {
                     // Check value
                     fieldValidator.check(fieldLocatorhandlernew java.lang.Integer(value.getMaxOutput()));
                 }
             }
             {
                 final org.jvnet.jaxbcommons.locator.FieldObjectLocator fieldLocator = new org.jvnet.jaxbcommons.locator.DefaultFieldObjectLocator(locatorvalue"ReportName");
                 if (!value.isSetReportName()) {
                     // Report missing object
                     handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(fieldLocatornew org.jvnet.jaxbvalidation.problem.structure.EmptyFieldProblem()));
                 } else {
                     // Check value
                     fieldValidator.check(fieldLocatorhandlervalue.getReportName());
                 }
             }
             {
                 final org.jvnet.jaxbcommons.locator.FieldObjectLocator fieldLocator = new org.jvnet.jaxbcommons.locator.DefaultFieldObjectLocator(locatorvalue"ReportText1");
                 if (!value.isSetReportText1()) {
                     // Report missing object
                     handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(fieldLocatornew org.jvnet.jaxbvalidation.problem.structure.EmptyFieldProblem()));
                 } else {
                     // Check value
                     fieldValidator.check(fieldLocatorhandlervalue.getReportText1());
                 }
             }
             {
                 final org.jvnet.jaxbcommons.locator.FieldObjectLocator fieldLocator = new org.jvnet.jaxbcommons.locator.DefaultFieldObjectLocator(locatorvalue"ReportText2");
                 if (!value.isSetReportText2()) {
                     // Report missing object
                     handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(fieldLocatornew org.jvnet.jaxbvalidation.problem.structure.EmptyFieldProblem()));
                 } else {
                     // Check value
                     fieldValidator.check(fieldLocatorhandlervalue.getReportText2());
                 }
             }
             {
                 final org.jvnet.jaxbcommons.locator.FieldObjectLocator fieldLocator = new org.jvnet.jaxbcommons.locator.DefaultFieldObjectLocator(locatorvalue"Addresses");
                 if (!value.isSetAddresses()) {
                     // Report missing object
                     handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(fieldLocatornew org.jvnet.jaxbvalidation.problem.structure.EmptyFieldProblem()));
                 } else {
                     // Check count
                     if (value.getAddresses().size()< 1) {
                         // Report minimum of occurences violated
                         handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(fieldLocatornew org.jvnet.jaxbvalidation.problem.structure.TooFewElementsProblem(value.getAddresses().size(), 1)));
                     }
                     if (value.getAddresses().size()> 5) {
                         // Report maximum of occurences violated
                         handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(fieldLocatornew org.jvnet.jaxbvalidation.problem.structure.TooManyElementsProblem(value.getAddresses().size(), 5)));
                     }
                     // Check value
                     fieldValidator.check(fieldLocatorhandlervalue.getAddresses());
                 }
             }
             {
                 final org.jvnet.jaxbcommons.locator.FieldObjectLocator fieldLocator = new org.jvnet.jaxbcommons.locator.DefaultFieldObjectLocator(locatorvalue"RefAlertClass");
                 if (!value.isSetRefAlertClass()) {
                     // Report missing object
                     handler.handleEvent(new org.jvnet.jaxbvalidation.event.ObjectValidationEvent(fieldLocatornew org.jvnet.jaxbvalidation.problem.structure.EmptyFieldProblem()));
                 } else {
                     // Check value
                     fieldValidator.check(fieldLocatorhandlervalue.getRefAlertClass());
                 }
             }
         }
     }
 
     {
 
        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"Addresses");
            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.AddressType value = ((org.jvnet.jaxbvalidation.tests.one.AddressTypedraftValue);
            if (value instanceof org.jvnet.jaxbvalidation.tests.one.AddressType) {
                org.jvnet.jaxbvalidation.tests.one.AddressType realValue = ((org.jvnet.jaxbvalidation.tests.one.AddressTypevalue);
                {
                    // 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.Integer value = ((java.lang.IntegerdraftValue);
            if (value instanceof java.lang.Integer) {
                java.lang.Integer realValue = ((java.lang.Integervalue);
                // 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 org.jvnet.jaxbvalidation.tests.one.AlertClassRef value = ((org.jvnet.jaxbvalidation.tests.one.AlertClassRefdraftValue);
            if (value instanceof org.jvnet.jaxbvalidation.tests.one.AlertClassRef) {
                org.jvnet.jaxbvalidation.tests.one.AlertClassRef realValue = ((org.jvnet.jaxbvalidation.tests.one.AlertClassRefvalue);
                {
                    // 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.MaxLengthFacet datatype
                    org.jvnet.jaxbvalidation.problem.datatype.ValueProblem problem = null;
                    if (((null == realValue)? 0 :realValue.length())>= 1) {
                        // Value length is correct
                    } else {
                        problem = new org.jvnet.jaxbvalidation.problem.datatype.TooShortProblem(realValue, ((null == realValue)? 0 :realValue.length()), 1);
                    }
                    if (((null == realValue)? 0 :realValue.length())<= 39) {
                        // Value length is correct
                    } else {
                        problem = new org.jvnet.jaxbvalidation.problem.datatype.TooLongProblem(realValue, ((null == realValue)? 0 :realValue.length()), 39);
                    }
                    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.MaxLengthFacet datatype
                    org.jvnet.jaxbvalidation.problem.datatype.ValueProblem problem = null;
                    if (((null == realValue)? 0 :realValue.length())>= 1) {
                        // Value length is correct
                    } else {
                        problem = new org.jvnet.jaxbvalidation.problem.datatype.TooShortProblem(realValue, ((null == realValue)? 0 :realValue.length()), 1);
                    }
                    if (((null == realValue)? 0 :realValue.length())<= 80) {
                        // Value length is correct
                    } else {
                        problem = new org.jvnet.jaxbvalidation.problem.datatype.TooLongProblem(realValue, ((null == realValue)? 0 :realValue.length()), 80);
                    }
                    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.MaxLengthFacet datatype
                    org.jvnet.jaxbvalidation.problem.datatype.ValueProblem problem = null;
                    if (((null == realValue)? 0 :realValue.length())>= 1) {
                        // Value length is correct
                    } else {
                        problem = new org.jvnet.jaxbvalidation.problem.datatype.TooShortProblem(realValue, ((null == realValue)? 0 :realValue.length()), 1);
                    }
                    if (((null == realValue)? 0 :realValue.length())<= 80) {
                        // Value length is correct
                    } else {
                        problem = new org.jvnet.jaxbvalidation.problem.datatype.TooLongProblem(realValue, ((null == realValue)? 0 :realValue.length()), 80);
                    }
                    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