Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
Licensed to jclouds, Inc. (jclouds) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. jclouds licenses this file to you under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0 Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
 
 package org.jclouds.elb.xml;
 
 import static org.jclouds.util.SaxUtils.currentOrNull;
 import static org.jclouds.util.SaxUtils.equalsOrSuffix;
 
 

Author(s):
Adrian Cole
See also:
 
    protected final DateService dateService;
    protected final HealthCheckHandler healthCheckHandler;
 
    @Inject
    protected LoadBalancerHandler(DateService dateServiceHealthCheckHandler healthCheckHandlerListenerWithPoliciesHandler listenerHandler) {
       this. = dateService;
       this. = healthCheckHandler;
       this. = listenerHandler;
    }
 
    private StringBuilder currentText = new StringBuilder();
    private LoadBalancer.Builder<?> builder = LoadBalancer.builder();
 
    private boolean inHealthCheck;
    private boolean inListeners;
    private boolean inAvailabilityZones;
    private boolean inSecurityGroups;
    private boolean inSubnets;
 
    protected int memberDepth;

   
 
    @Override
    public LoadBalancer getResult() {
       try {
          return .build();
       } finally {
           = LoadBalancer.builder();
       }
    }

   
 
    @Override
    public void startElement(String urlString nameString qNameAttributes attributesthrows SAXException {
       if (equalsOrSuffix(qName"member")) {
          ++;
       } else if (equalsOrSuffix(qName"HealthCheck")) {
           = true;
       } else if (equalsOrSuffix(qName"ListenerDescriptions")) {
           = true;
       } else if (equalsOrSuffix(qName"AvailabilityZones")) {
           = true;
       } else if (equalsOrSuffix(qName"SecurityGroups")) {
           = true;
       } else if (equalsOrSuffix(qName"Subnets")) {
           = true;
       } else if (equalsOrSuffix(qName"SourceSecurityGroup")) {
           = SecurityGroupAndOwner.builder();
       }
       
       if () {
          .startElement(urlnameqNameattributes);
       }
   }

   
   public void endElement(String uriString nameString qNamethrows SAXException {
      if (equalsOrSuffix(qName"member")) {
         endMember(urinameqName);
         --;
      } else if (equalsOrSuffix(qName"ListenerDescriptions")) {
          = false;
      } else if (equalsOrSuffix(qName"AvailabilityZones")) {
          = false;
      } else if (equalsOrSuffix(qName"SecurityGroups")) {
          = false;
      } else if (equalsOrSuffix(qName"Subnets")) {
          = false;         
      } else if (equalsOrSuffix(qName"HealthCheck")) {
          = false;
      } else if (equalsOrSuffix(qName"SourceSecurityGroup")) {
         if ( != null)
          = null;
      } else if (equalsOrSuffix(qName"LoadBalancerName")) {
      } else if (equalsOrSuffix(qName"CreatedTime")) {
      } else if (equalsOrSuffix(qName"DNSName")) {
      } else if (equalsOrSuffix(qName"InstanceId")) {
      } else if (equalsOrSuffix(qName"GroupName")) {
      } else if (equalsOrSuffix(qName"OwnerAlias")) {
      } else if (equalsOrSuffix(qName"Scheme")) {
         .scheme(Scheme.fromValue(currentOrNull()));
      } else if (equalsOrSuffix(qName"VPCId")) {
      } else if (equalsOrSuffix(qName"CanonicalHostedZoneName")) {
      } else if (equalsOrSuffix(qName"CanonicalHostedZoneNameID")) {
      } else if () {
         .endElement(urinameqName);
      } else if () {
         .endElement(urinameqName);
      }
       = new StringBuilder();
   }
   protected void endMember(String uriString nameString qNamethrows SAXException {
      if () {
         if ( == 2)
            .listener(.getResult());
         else
            .endElement(urinameqName);
      } else if () {
      } else if () {
      } else if () {
      }
   }

   
   public void characters(char ch[], int startint length) {
      if () {
         .characters(chstartlength);
      } else if () {
         .characters(chstartlength);
      } else {
         .append(chstartlength);
      }
   }
New to GrepCode? Check out our FAQ X