}
void parseStartElement()
throws ThreddsXmlParserException
{
StartElement startElement = this.getNextEventIfStartElementIsMine();
Attribute nameAtt = startElement.getAttributeByName( ServiceElementNames.ServiceElement_Name );
String name = nameAtt.getValue();
Attribute serviceTypeAtt = startElement.getAttributeByName( ServiceElementNames.ServiceElement_ServiceType );
ServiceType serviceType = ServiceType.getType( serviceTypeAtt.getValue() );
Attribute baseUriAtt = startElement.getAttributeByName( ServiceElementNames.ServiceElement_Base );
String baseUriString = baseUriAtt.getValue();
URI baseUri = null;
try
{
baseUri = new URI( baseUriString );
}
catch ( URISyntaxException e )
{
log.error( "parseElement(): Bad service base URI [" + baseUriString + "]: " + e.getMessage(), e );
throw new ThreddsXmlParserException( "Bad service base URI [" + baseUriString + "]", e );
}
if ( this.parentCatalogBuilder != null )
this.selfBuilder = this.parentCatalogBuilder.addService( name, serviceType, baseUri );
else if ( this.parentServiceBuilder != null )
this.selfBuilder = this.parentServiceBuilder.addService( name, serviceType, baseUri );
else
throw new ThreddsXmlParserException( "" );
Attribute suffixAtt = startElement.getAttributeByName( ServiceElementNames.ServiceElement_Suffix );
if ( suffixAtt != null )
{
this.selfBuilder.setSuffix( suffixAtt.getValue() );
}
Attribute descriptionAtt = startElement.getAttributeByName( ServiceElementNames.ServiceElement_Description );
if ( descriptionAtt != null )
{
this.selfBuilder.setSuffix( descriptionAtt.getValue() );
}
}