protected void startParsing( final Attributes attrs ) throws SAXException { super.startParsing( attrs ); final int length = attrs.getLength(); for ( int i = 0; i < length; i++ ) { attributes.setAttribute( attrs.getURI( i ), attrs.getLocalName( i ), attrs.getValue( i ) ); } }
protected void startParsing( final Attributes attrs ) throws SAXException { super.startParsing( attrs ); name = attrs.getValue( getUri(), "name" ); if ( name == null ) { throw new SAXException( "Required attribute 'name' is missing." ); } namespace = attrs.getValue( getUri(), "namespace" ); if ( namespace == null ) { throw new SAXException( "Required attribute 'namespace' is missing." ); } }
/** * Starts parsing. * * @param attrs the attributes. * @throws SAXException if there is a parsing error. */ protected void startParsing( final Attributes attrs ) throws SAXException { super.startParsing( attrs ); name = attrs.getValue( getUri(), nameAttribute ); if ( nameMandatory && name == null ) { throw new ParseException( "Required attribute '" + nameAttribute + "' missing", getLocator() ); } }
/** * Starts parsing. * * @param attrs * the attributes. * @throws SAXException * if there is a parsing error. */ protected void startParsing( final Attributes attrs ) throws SAXException { super.startParsing( attrs ); if ( "true".equals( attrs.getValue( getUri(), "null" ) ) ) { nullValue = true; } // redefine the declared type. Do not care whether the type will be compatible with the global one, // this is the user's problem. final String type = attrs.getValue( getUri(), "type" ); if ( type != null ) { try { final ClassLoader loader = ObjectUtilities.getClassLoader( AbstractXmlReadHandler.class ); this.type = Class.forName( CompatibilityMapperUtil.mapClassName( type ), false, loader ); } catch ( ClassNotFoundException e ) { throw new ParseException( "Required attribute 'type' is not valid.", getLocator() ); } } }