/** * Done parsing. * * @throws SAXException * if there is a parsing error. */ protected void doneParsing() throws SAXException { for ( int i = 0; i < elementHandlers.size(); i++ ) { final XmlReadHandler readHandler = elementHandlers.get( i ); final Element e = (Element) readHandler.getObject(); band.addElement( e ); } for ( int i = 0; i < styleExpressionHandlers.size(); i++ ) { final StyleExpressionHandler handler = styleExpressionHandlers.get( i ); if ( handler.getKey() != null ) { band.setStyleExpression( handler.getKey(), handler.getExpression() ); } } band.setAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, getRootHandler().getSource() ); super.doneParsing(); }
/** * Done parsing. * * @throws org.xml.sax.SAXException * if there is a parsing error. */ protected void doneParsing() throws SAXException { if ( dataSourceHandler != null ) { element.setDataSource( (DataSource) dataSourceHandler.getObject() ); } for ( int i = 0; i < styleExpressionHandlers.size(); i++ ) { final StyleExpressionHandler handler = (StyleExpressionHandler) styleExpressionHandlers.get( i ); final StyleKey key = handler.getKey(); if ( handler.getKey() != null ) { final Expression expression = handler.getExpression(); element.setStyleExpression( key, expression ); } } element.setAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, getRootHandler().getSource() ); }
/** * Done parsing. * * @throws org.xml.sax.SAXException * if there is a parsing error. */ protected void doneParsing() throws SAXException { element = getElementFactory().createElement(); element.setAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, getRootHandler().getSource() ); handleInheritedStyle( styleClass ); for ( int i = 0; i < styleExpressionHandlers.size(); i++ ) { final StyleExpressionHandler handler = styleExpressionHandlers.get( i ); final StyleKey key = handler.getKey(); if ( handler.getKey() != null ) { final Expression expression = handler.getExpression(); element.setStyleExpression( key, expression ); } } super.doneParsing(); }
/** * 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 groupName = attrs.getValue( getUri(), GroupReadHandler.NAME_ATT ); if ( groupName != null ) { final AbstractReportDefinition report = (AbstractReportDefinition) getRootHandler().getHelperObject( ReportParserUtil.HELPER_OBJ_REPORT_NAME ); final Group maybeDefaultGroup = report.getGroupByName( groupName ); if ( maybeDefaultGroup instanceof RelationalGroup ) { group = (RelationalGroup) maybeDefaultGroup; } else { group = new RelationalGroup(); group.setName( groupName ); group.setAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, getRootHandler().getSource() ); } } else { group = new RelationalGroup(); group.setAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, getRootHandler().getSource() ); } }
/** * 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 groupName = attrs.getValue( getUri(), GroupReadHandler.NAME_ATT ); if ( groupName != null ) { final AbstractReportDefinition report = (AbstractReportDefinition) getRootHandler().getHelperObject( ReportParserUtil.HELPER_OBJ_REPORT_NAME ); final Group maybeDefaultGroup = report.getGroupByName( groupName ); if ( maybeDefaultGroup instanceof RelationalGroup ) { group = (RelationalGroup) maybeDefaultGroup; } else { group = new RelationalGroup(); group.setName( groupName ); group.setAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, getRootHandler().getSource() ); } } else { group = new RelationalGroup(); group.setAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, getRootHandler().getSource() ); } }
/** * Parses an external file using LibLoader and returns the parsed result as an object of type * <code>targetClass</code>. The file is given as relative pathname (relative to the current source file). The current * helper-methods are used as parse-parameters for the external parsing. * * @param file the file to be parsed. * @param targetClass the target type of the parse operation. * @param map the map of parse parameters. * @return the result, never null. * @throws ParseException if parsing the result failed for some reason. * @throws ResourceLoadingException if there was an IO error loading the resource. * @see #deriveParseParameters() */ protected Object performExternalParsing( final String file, final Class targetClass, final Map map ) throws ParseException, ResourceLoadingException { try { final ResourceManager resourceManager = rootHandler.getResourceManager(); final ResourceKey source = rootHandler.getSource(); final ResourceKey target = resourceManager.deriveKey( source, file, map ); final DependencyCollector dc = rootHandler.getDependencyCollector(); final Resource resource = resourceManager.create( target, rootHandler.getContext(), targetClass ); dc.add( resource ); return resource.getResource(); } catch ( ResourceLoadingException rle ) { throw rle; } catch ( ResourceException e ) { throw new ParseException( "Failure while loading data: " + file, e, getLocator() ); } }
} else { report = new SubReport(); report.setAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, rootHandler.getSource() );
final RootXmlReadHandler rootHandler = getRootHandler(); final ResourceManager resourceManager = rootHandler.getResourceManager(); final ResourceKey source = rootHandler.getSource();
final ResourceKey key = getRootHandler().getSource(); final ResourceManager manager = getRootHandler().getResourceManager(); try {
report.setAttribute( AttributeNames.Internal.NAMESPACE, AttributeNames.Internal.FILEFORMAT, "unified-fileformat" ); final ResourceKey key = getRootHandler().getSource(); if ( key.getParent() != null ) { final ResourceManager resourceManager = getRootHandler().getResourceManager();
report.setAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, rootHandler.getSource() ); } else { report = (MasterReport) maybeReport;
report.setAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, getRootHandler().getSource() ); } else { report = (SubReport) maybeReport;
report.setAttribute( AttributeNames.Core.NAMESPACE, AttributeNames.Core.SOURCE, rootHandler.getSource() ); } else { report = (MasterReport) maybeReport;