/** * Returns the locator as provided by the XML parser. This method may return null if the XML parser has no locator * support. * * @return the locator or null. */ public Locator getLocator() { return rootHandler.getDocumentLocator(); }
/** * Process character data. * * @param ch the character buffer. * @param start the start index. * @param length the length of the character data. * @throws SAXException if there is a parsing error. */ public void characters( final char[] ch, final int start, final int length ) throws SAXException { try { getCurrentHandler().characters( ch, start, length ); } catch ( SAXException se ) { throw se; } catch ( Exception e ) { throw new ParseException ( "Failed at handling character data", e, getDocumentLocator() ); } }
/** * Starts parsing. * * @param attrs * the attributes. * @throws org.xml.sax.SAXException * if there is a parsing error. */ protected void startParsing( final PropertyAttributes attrs ) throws SAXException { final String name = attrs.getValue( getUri(), "name" ); if ( name == null ) { throw new ParseException( "Required attribute 'name' is missing.", getRootHandler().getDocumentLocator() ); } final ElementStyleSheet parent = styleSheetCollection.get( name ); if ( parent == null ) { throw new ParseException( "Specified parent stylesheet is not defined.", getRootHandler().getDocumentLocator() ); } styleSheet.addDefault( parent ); }
String className = CompatibilityMapperUtil.mapClassName( attrs.getValue( getUri(), "class" ) ); if ( className == null ) { throw new ParseException( "Attribute 'class' is missing.", getRootHandler().getDocumentLocator() );
orientationVal = PageFormat.PORTRAIT; } else { throw new ParseException( "Orientation value in REPORT-Tag is invalid.", getRootHandler().getDocumentLocator() );
orientationVal = PageFormat.PORTRAIT; } else { throw new ParseException( "Orientation value in REPORT-Tag is invalid.", getRootHandler().getDocumentLocator() );
if ( nameRequired && templateName == null ) { throw new ParseException( "The 'name' attribute is required for template definitions", getRootHandler() .getDocumentLocator() ); .getDocumentLocator() ); .getDocumentLocator() );
/** * Starts parsing. * * @param attrs * the attributes. * @throws org.xml.sax.SAXException * if there is a parsing error. */ protected void startParsing( final PropertyAttributes attrs ) throws SAXException { final String className = CompatibilityMapperUtil.mapClassName( attrs.getValue( getUri(), "class" ) ); if ( className == null ) { throw new ParseException( "Attribute 'class' is missing.", getRootHandler().getDocumentLocator() ); } final StyleKeyFactoryCollector fc = (StyleKeyFactoryCollector) getRootHandler().getHelperObject( ReportDefinitionReadHandler.STYLE_FACTORY_KEY ); final StyleKeyFactory factory = (StyleKeyFactory) ObjectUtilities.loadAndInstantiate( className, getClass(), StyleKeyFactory.class ); fc.addFactory( factory ); }
/** * Starts parsing. * * @param attrs * the attributes. * @throws org.xml.sax.SAXException * if there is a parsing error. */ protected void startParsing( final PropertyAttributes attrs ) throws SAXException { final String className = CompatibilityMapperUtil.mapClassName( attrs.getValue( getUri(), "class" ) ); if ( className == null ) { throw new ParseException( "Attribute 'class' is missing.", getRootHandler().getDocumentLocator() ); } final ElementFactoryCollector fc = (ElementFactoryCollector) getRootHandler().getHelperObject( ReportDefinitionReadHandler.ELEMENT_FACTORY_KEY ); final ElementFactory factory = (ElementFactory) ObjectUtilities.loadAndInstantiate( className, getClass(), ElementFactory.class ); fc.addFactory( factory ); }
/** * Starts parsing. * * @param attrs * the attributes. * @throws org.xml.sax.SAXException * if there is a parsing error. */ protected void startParsing( final PropertyAttributes attrs ) throws SAXException { final String className = CompatibilityMapperUtil.mapClassName( attrs.getValue( getUri(), "class" ) ); if ( className == null ) { throw new ParseException( "Attribute 'class' is missing.", getRootHandler().getDocumentLocator() ); } final TemplateCollector fc = (TemplateCollector) getRootHandler().getHelperObject( ReportDefinitionReadHandler.TEMPLATE_FACTORY_KEY ); final TemplateCollection factory = (TemplateCollection) ObjectUtilities.loadAndInstantiate( className, getClass(), TemplateCollection.class ); if ( factory != null ) { factory.configure( getRootHandler().getParserConfiguration() ); fc.addTemplateCollection( factory ); } }
/** * Starts parsing. * * @param attrs * the attributes. * @throws org.xml.sax.SAXException * if there is a parsing error. */ protected void startParsing( final PropertyAttributes attrs ) throws SAXException { final String className = CompatibilityMapperUtil.mapClassName( attrs.getValue( getUri(), "class" ) ); if ( className == null ) { throw new ParseException( "Attribute 'class' is missing.", getRootHandler().getDocumentLocator() ); } final DataSourceCollector fc = (DataSourceCollector) getRootHandler().getHelperObject( ReportDefinitionReadHandler.DATASOURCE_FACTORY_KEY ); final DataSourceFactory factory = (DataSourceFactory) ObjectUtilities.loadAndInstantiate( className, getClass(), DataSourceFactory.class ); if ( factory != null ) { factory.configure( getRootHandler().getParserConfiguration() ); fc.addFactory( factory ); } }
final String file = attrs.getValue( getUri(), "src" ); if ( file == null ) { throw new ParseException( "Required attribute 'src' is missing.", getRootHandler().getDocumentLocator() ); throw new ParseException( "Illegal State: No valid report", getRootHandler().getDocumentLocator() ); targetType = MasterReport.class; } else { throw new ParseException( "Illegal State: No valid report", getRootHandler().getDocumentLocator() );
/** * Starts parsing. * * @param attrs * the attributes. * @throws org.xml.sax.SAXException * if there is a parsing error. */ protected void startParsing( final PropertyAttributes attrs ) throws SAXException { final String typeName = attrs.getValue( getUri(), "type" ); if ( typeName == null ) { throw new ParseException( "The datasource type must be specified", getRootHandler().getDocumentLocator() ); } final DataSourceCollector fc = (DataSourceCollector) getRootHandler().getHelperObject( ReportDefinitionReadHandler.DATASOURCE_FACTORY_KEY ); final ObjectDescription od = fc.getDataSourceDescription( typeName ); if ( od == null ) { throw new ParseException( "The specified DataSource type is not defined", getLocator() ); } setObjectDescription( od ); }