Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  
  package org.jibx.schema.org.opentravel._2012B.rail;
  
  import java.util.List;
The Rail Schedule response message contains schedule information including origin and destination, equipment, marketing and operating companies, departure and arrival stations, accommodation and ancillary service information, etc. Schema fragment(s) for this class:
 <xs:element xmlns:ns="http://www.opentravel.org/OTA/2003/05/common" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="OTA_RailScheduleRS">
   <xs:complexType>
     <xs:choice>
       <xs:sequence>
         <xs:element type="ns:SuccessType" name="Success"/>
         <xs:element type="ns:WarningsType" name="Warnings" minOccurs="0"/>
         <xs:element name="OriginDestinationOptions" minOccurs="0">
           <!-- Reference to inner class OriginDestinationOptions -->
         </xs:element>
       </xs:sequence>
       <xs:element type="ns:ErrorsType" name="Errors"/>
     </xs:choice>
     <xs:attributeGroup ref="ns:OTA_PayloadStdAttributes"/>
   </xs:complexType>
 </xs:element>
 
 
 public class ScheduleRS
 {
     private int choiceSelect = -1;
     private static final int SUCCESS_CHOICE = 0;
     private static final int ERRORS_CHOICE = 1;
     private Success success;
     private Warnings warnings;
     private Errors errors;
 
     private void setChoiceSelect(int choice) {
         if ( == -1) {
              = choice;
         } else if ( != choice) {
             throw new IllegalStateException(
                     "Need to call clearChoiceSelect() before changing existing choice");
         }
     }

    
Clear the choice selection.
 
     public void clearChoiceSelect() {
          = -1;
     }

    
Check if Success is current selection for choice.

Returns:
true if selection, false if not
 
     public boolean ifSuccess() {
         return  == ;
     }

    
Get the 'Success' element value. The standard way to indicate successful processing of an OpenTravel message. Returning an empty element of this type indicates success.

Returns:
value
 
     public Success getSuccess() {
         return ;
     }

    
Set the 'Success' element value. The standard way to indicate successful processing of an OpenTravel message. Returning an empty element of this type indicates success.

Parameters:
success
 
     public void setSuccess(Success success) {
         setChoiceSelect();
         this. = success;
     }

    
Get the 'Warnings' element value. The standard way to indicate successful processing of an OpenTravel message, but one in which business warnings are generated.

Returns:
value
 
     public Warnings getWarnings() {
         return ;
     }

    
Set the 'Warnings' element value. The standard way to indicate successful processing of an OpenTravel message, but one in which business warnings are generated.

Parameters:
warnings
    public void setWarnings(Warnings warnings) {
        this. = warnings;
    }

    
Get the 'OriginDestinationOptions' element value.

Returns:
value
        return ;
    }

    
Set the 'OriginDestinationOptions' element value.

Parameters:
originDestinationOptions
    public void setOriginDestinationOptions(
            OriginDestinationOptions originDestinationOptions) {
        this. = originDestinationOptions;
    }

    
Check if Errors is current selection for choice.

Returns:
true if selection, false if not
    public boolean ifErrors() {
        return  == ;
    }

    
Get the 'Errors' element value. A collection of errors that occurred during the processing of this message.

Returns:
value
    public Errors getErrors() {
        return ;
    }

    
Set the 'Errors' element value. A collection of errors that occurred during the processing of this message.

Parameters:
errors
    public void setErrors(Errors errors) {
        this. = errors;
    }

    
Get the 'OTA_PayloadStdAttributes' attributeGroup value. The OTA_PayloadStdAttributes defines the standard attributes that appear on the root element for all OpenTravel messages.

Returns:
value
        return ;
    }

    
Set the 'OTA_PayloadStdAttributes' attributeGroup value. The OTA_PayloadStdAttributes defines the standard attributes that appear on the root element for all OpenTravel messages.

Parameters:
OTAPayloadStdAttributes
    public void setOTAPayloadStdAttributes(
            OTAPayloadStdAttributes OTAPayloadStdAttributes) {
        this. = OTAPayloadStdAttributes;
    }
    
The origin location, destination location and train segment information for the rail schedule request. Schema fragment(s) for this class:
 <xs:element xmlns:ns="http://www.opentravel.org/OTA/2003/05/common" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="OriginDestinationOptions" minOccurs="0">
   <xs:complexType>
     <xs:sequence>
       <xs:element type="ns:LocationType" name="OriginLocation"/>
       <xs:element type="ns:LocationType" name="DestinationLocation"/>
       <xs:element name="OriginDestinationOption" maxOccurs="999">
         <!-- Reference to inner class OriginDestinationOption -->
       </xs:element>
     </xs:sequence>
   </xs:complexType>
 </xs:element>
 
    public static class OriginDestinationOptions
    {
        private Location originLocation;
        private Location destinationLocation;
        private List<OriginDestinationOptionoriginDestinationOptionList = new ArrayList<OriginDestinationOption>();

        
Get the 'OriginLocation' element value. Travel origin location.

Returns:
value
        public Location getOriginLocation() {
            return ;
        }

        
Set the 'OriginLocation' element value. Travel origin location.

Parameters:
originLocation
        public void setOriginLocation(Location originLocation) {
            this. = originLocation;
        }

        
Get the 'DestinationLocation' element value. Travel destination location.

Returns:
value
        public Location getDestinationLocation() {
            return ;
        }

        
Set the 'DestinationLocation' element value. Travel destination location.

Parameters:
destinationLocation
        public void setDestinationLocation(Location destinationLocation) {
            this. = destinationLocation;
        }

        
Get the list of 'OriginDestinationOption' element items.

Returns:
list
            return ;
        }

        
Set the list of 'OriginDestinationOption' element items.

Parameters:
list
        public void setOriginDestinationOptionList(
                List<OriginDestinationOptionlist) {
             = list;
        }

        
Get the number of 'OriginDestinationOption' element items.

Returns:
count
        public int sizeOriginDestinationOptionList() {
            return .size();
        }

        
Add a 'OriginDestinationOption' element item.

Parameters:
item
        public void addOriginDestinationOption(OriginDestinationOption item) {
            .add(item);
        }

        
Get 'OriginDestinationOption' element item by position.

Parameters:
index
Returns:
item
        public OriginDestinationOption getOriginDestinationOption(int index) {
            return .get(index);
        }

        
Remove all 'OriginDestinationOption' element items.
        public void clearOriginDestinationOptionList() {
            .clear();
        }
        
Train segment information and train segment comments. Schema fragment(s) for this class:
 <xs:element xmlns:ns="http://www.opentravel.org/OTA/2003/05/common" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="OriginDestinationOption" maxOccurs="999">
   <xs:complexType>
     <xs:sequence>
       <xs:element name="TrainSegment" maxOccurs="9">
         <!-- Reference to inner class TrainSegment -->
       </xs:element>
       <xs:element type="ns:FreeTextType" name="Comment" minOccurs="0" maxOccurs="10"/>
     </xs:sequence>
   </xs:complexType>
 </xs:element>
 
        public static class OriginDestinationOption
        {
            private List<TrainSegmenttrainSegmentList = new ArrayList<TrainSegment>();
            private List<FreeTextcommentList = new ArrayList<FreeText>();

            
Get the list of 'TrainSegment' element items.

Returns:
list
            public List<TrainSegmentgetTrainSegmentList() {
                return ;
            }

            
Set the list of 'TrainSegment' element items.

Parameters:
list
            public void setTrainSegmentList(List<TrainSegmentlist) {
                 = list;
            }

            
Get the number of 'TrainSegment' element items.

Returns:
count
            public int sizeTrainSegmentList() {
                return .size();
            }

            
Add a 'TrainSegment' element item.

Parameters:
item
            public void addTrainSegment(TrainSegment item) {
                .add(item);
            }

            
Get 'TrainSegment' element item by position.

Parameters:
index
Returns:
item
            public TrainSegment getTrainSegment(int index) {
                return .get(index);
            }

            
Remove all 'TrainSegment' element items.
            public void clearTrainSegmentList() {
                .clear();
            }

            
Get the list of 'Comment' element items. Used to specify comment information for a group of train segments.

Returns:
list
            public List<FreeTextgetCommentList() {
                return ;
            }

            
Set the list of 'Comment' element items. Used to specify comment information for a group of train segments.

Parameters:
list
            public void setCommentList(List<FreeTextlist) {
                 = list;
            }

            
Get the number of 'Comment' element items.

Returns:
count
            public int sizeCommentList() {
                return .size();
            }

            
Add a 'Comment' element item.

Parameters:
item
            public void addComment(FreeText item) {
                .add(item);
            }

            
Get 'Comment' element item by position.

Parameters:
index
Returns:
item
            public FreeText getComment(int index) {
                return .get(index);
            }

            
Remove all 'Comment' element items.
            public void clearCommentList() {
                .clear();
            }
            
A collection of one or more legs that are defined as a single train number. Schema fragment(s) for this class:
 <xs:element xmlns:ns="http://www.opentravel.org/OTA/2003/05/common" xmlns:xs="http://www.w3.org/2001/XMLSchema" name="TrainSegment" maxOccurs="9">
   <xs:complexType>
     <xs:complexContent>
       <xs:extension base="ns:TrainSegmentType">
         <xs:sequence>
           <xs:choice minOccurs="0">
             <!-- Reference to inner class Choice -->
           </xs:choice>
           <xs:element type="ns:FreeTextType" name="Comment" minOccurs="0" maxOccurs="10"/>
         </xs:sequence>
         <xs:attribute type="xs:float" use="optional" name="OnTimeRate"/>
       </xs:extension>
     </xs:complexContent>
   </xs:complexType>
 </xs:element>
 
            public static class TrainSegment
                    extends
                        org.jibx.schema.org.opentravel._2012B.base.rail.TrainSegment
            {
                private Choice choice;
                private List<FreeTextcommentList = new ArrayList<FreeText>();
                private Float onTimeRate;

                
Get the choice value.

Returns:
value
                public Choice getChoice() {
                    return ;
                }

                
Set the choice value.

Parameters:
choice
                public void setChoice(Choice choice) {
                    this. = choice;
                }

                
Get the list of 'Comment' element items. Any special comments on the leg, e.g. "Operated by Amtrak."

Returns:
list
                public List<FreeTextgetCommentList() {
                    return ;
                }

                
Set the list of 'Comment' element items. Any special comments on the leg, e.g. "Operated by Amtrak."

Parameters:
list
                public void setCommentList(List<FreeTextlist) {
                     = list;
                }

                
Get the number of 'Comment' element items.

Returns:
count
                public int sizeCommentList() {
                    return .size();
                }

                
Add a 'Comment' element item.

Parameters:
item
                public void addComment(FreeText item) {
                    .add(item);
                }

                
Get 'Comment' element item by position.

Parameters:
index
Returns:
item
                public FreeText getComment(int index) {
                    return .get(index);
                }

                
Remove all 'Comment' element items.
                public void clearCommentList() {
                    .clear();
                }

                
Get the 'OnTimeRate' attribute value. Specifies the on time performance of the train from a recognized reporting agency such as the US Department of Transport, e.g. 99%.

Returns:
value
                public Float getOnTimeRate() {
                    return ;
                }

                
Set the 'OnTimeRate' attribute value. Specifies the on time performance of the train from a recognized reporting agency such as the US Department of Transport, e.g. 99%.

Parameters:
onTimeRate
                public void setOnTimeRate(Float onTimeRate) {
                    this. = onTimeRate;
                }
                
A choice between entering train class codes as a general list or categorized by type, class and compartment. Schema fragment(s) for this class:
 <xs:choice xmlns:ns="http://www.opentravel.org/OTA/2003/05/common" xmlns:xs="http://www.w3.org/2001/XMLSchema" minOccurs="0">
   <xs:element type="ns:ClassCodeType" name="ClassCodes" minOccurs="0" maxOccurs="99"/>
   <xs:element ref="ns:AccommodationCategory" minOccurs="0"/>
 </xs:choice>
 
                public static class Choice
                {
                    private int choiceSelect = -1;
                    private static final int CLASS_CODE_LIST_CHOICE = 0;
                    private static final int ACCOMMODATION_CATEGORY_CHOICE = 1;
                    private List<ClassCodeclassCodeList = new ArrayList<ClassCode>();
                    private AccommodationCategory accommodationCategory;
                    private void setChoiceSelect(int choice) {
                        if ( == -1) {
                             = choice;
                        } else if ( != choice) {
                            throw new IllegalStateException(
                                    "Need to call clearChoiceSelect() before changing existing choice");
                        }
                    }

                    
Clear the choice selection.
                    public void clearChoiceSelect() {
                         = -1;
                    }

                    
Check if ClassCodeList is current selection for choice.

Returns:
true if selection, false if not
                    public boolean ifClassCodeList() {
                        return  == ;
                    }

                    
Get the list of 'ClassCodes' element items. The class of inventory controlled services available.

Returns:
list
                    public List<ClassCodegetClassCodeList() {
                        return ;
                    }

                    
Set the list of 'ClassCodes' element items. The class of inventory controlled services available.

Parameters:
list
                    public void setClassCodeList(List<ClassCodelist) {
                        setChoiceSelect();
                         = list;
                    }

                    
Get the number of 'ClassCodes' element items.

Returns:
count
                    public int sizeClassCodeList() {
                        return .size();
                    }

                    
Add a 'ClassCodes' element item.

Parameters:
item
                    public void addClassCode(ClassCode item) {
                        .add(item);
                    }

                    
Get 'ClassCodes' element item by position.

Parameters:
index
Returns:
item
                    public ClassCode getClassCode(int index) {
                        return .get(index);
                    }

                    
Remove all 'ClassCodes' element items.
                    public void clearClassCodeList() {
                        .clear();
                    }

                    
Check if AccommodationCategory is current selection for choice.

Returns:
true if selection, false if not
                    public boolean ifAccommodationCategory() {
                        return  == ;
                    }

                    
Get the 'AccommodationCategory' element value.

Returns:
value
                    public AccommodationCategory getAccommodationCategory() {
                        return ;
                    }

                    
Set the 'AccommodationCategory' element value.

Parameters:
accommodationCategory
                    public void setAccommodationCategory(
                            AccommodationCategory accommodationCategory) {
                        setChoiceSelect();
                        this. = accommodationCategory;
                    }
                }
            }
        }
    }
New to GrepCode? Check out our FAQ X