protected Object performInitialLookup( final String name ) { return rootXmlReadHandler.getHelperObject( name ); } }
public void init( final RootXmlReadHandler rootHandler, final ElementStyleSheet styleSheet ) { this.keyfactory = (StyleKeyFactory) rootHandler.getHelperObject( ReportDefinitionReadHandler.STYLE_FACTORY_KEY ); this.styleSheet = styleSheet; }
/** * Checks whether this report is a included report and not the main report definition. * * @param rootXmlReadHandler * the root handler that provides access to the properties. * @return true, if the report is included, false otherwise. */ public static boolean isIncluded( final RootXmlReadHandler rootXmlReadHandler ) { return INCLUDE_PARSING_VALUE.equals( rootXmlReadHandler.getHelperObject( INCLUDE_PARSING_KEY ) ); }
/** * Returns the object for this element or null, if this element does not create an object. * * @return the object. */ public Object getObject() { return getRootHandler().getHelperObject( ReportParserUtil.HELPER_OBJ_REPORT_NAME ); } }
/** * Returns the object for this element or null, if this element does not create an object. * * @return the object. */ public Object getObject() { return getRootHandler().getHelperObject( ReportParserUtil.HELPER_OBJ_REPORT_NAME ); }
/** * Initialises the handler. * * @param rootHandler * the root handler. * @param tagName * the tag name. */ public void init( final RootXmlReadHandler rootHandler, final String uri, final String tagName ) throws SAXException { super.init( rootHandler, uri, tagName ); styleSheetCollection = (HashMap<String, ElementStyleSheet>) rootHandler.getHelperObject( ReportParserUtil.HELPER_OBJ_LEGACY_STYLES ); }
protected Object performInitialLookup( final String name ) { return getRootHandler().getHelperObject( name ); } }
/** * Initialises the handler. * * @param rootHandler * the root handler. * @param tagName * the tag name. */ public void init( final RootXmlReadHandler rootHandler, final String uri, final String tagName ) throws SAXException { super.init( rootHandler, uri, tagName ); templateCollection = (TemplateCollection) rootHandler.getHelperObject( ReportDefinitionReadHandler.TEMPLATE_FACTORY_KEY ); }
public String getResult() { if ( Boolean.TRUE.equals( getRootHandler().getHelperObject( "property-expansion" ) ) ) { return lookupParser.translateAndLookup( buffer.toString() ); } return buffer.toString(); }
/** * Initialises the handler. * * @param rootHandler * the root handler. * @param tagName * the tag name. */ public void init( final RootXmlReadHandler rootHandler, final String uri, final String tagName ) throws SAXException { super.init( rootHandler, uri, tagName ); this.classFactory = (ClassFactory) getRootHandler().getHelperObject( ReportDefinitionReadHandler.CLASS_FACTORY_KEY ); }
/** * Done parsing. * * @throws org.xml.sax.SAXException * if there is a parsing error. */ protected void doneParsing() throws SAXException { final TemplateCollection templateCollection = (TemplateCollection) getRootHandler().getHelperObject( ReportDefinitionReadHandler.TEMPLATE_FACTORY_KEY ); for ( int i = 0; i < templateList.size(); i++ ) { final TemplateReadHandler readHandler = (TemplateReadHandler) templateList.get( i ); templateCollection.addTemplate( (TemplateDescription) readHandler.getObjectDescription() ); } }
protected void handleInheritedStyle( final String styleClass ) { if ( styleClass != null ) { final HashMap<String, ElementStyleSheet> report = (HashMap<String, ElementStyleSheet>) getRootHandler().getHelperObject( ReportParserUtil.HELPER_OBJ_LEGACY_STYLES ); if ( report != null ) { final ElementStyleSheet existingStyleSheet = report.get( styleClass ); if ( existingStyleSheet != null ) { element.getStyle().addDefault( existingStyleSheet ); } } } }
protected Resource createResource( final ResourceKey targetKey, final RootXmlReadHandler handler, final Object createdProduct, final Class createdType ) { if ( ReportParserUtil.INCLUDE_PARSING_VALUE .equals( handler.getHelperObject( ReportParserUtil.INCLUDE_PARSING_KEY ) ) ) { return new ReportResource( targetKey, handler.getDependencyCollector(), createdProduct, createdType, false ); } return new ReportResource( targetKey, handler.getDependencyCollector(), createdProduct, createdType, true ); } }
protected Resource createResource( final ResourceKey targetKey, final RootXmlReadHandler handler, final Object createdProduct, final Class createdType ) { if ( ReportParserUtil.INCLUDE_PARSING_VALUE .equals( handler.getHelperObject( ReportParserUtil.INCLUDE_PARSING_KEY ) ) ) { return new ReportResource( targetKey, handler.getDependencyCollector(), createdProduct, createdType, false ); } return new ReportResource( targetKey, handler.getDependencyCollector(), createdProduct, createdType, true ); }
protected Resource createResource( final ResourceKey targetKey, final RootXmlReadHandler handler, final Object createdProduct, final Class createdType ) { if ( ReportParserUtil.INCLUDE_PARSING_VALUE .equals( handler.getHelperObject( ReportParserUtil.INCLUDE_PARSING_KEY ) ) ) { return new ReportResource( targetKey, handler.getDependencyCollector(), createdProduct, createdType, false ); } return new ReportResource( targetKey, handler.getDependencyCollector(), createdProduct, createdType, true ); }
/** * Done parsing. * * @throws org.xml.sax.SAXException * if there is a parsing error. */ protected void doneParsing() throws SAXException { if ( pageReadHandler == null ) { throw new SAXException( "simple-page-definition element needs one page definition." ); } final SimplePageDefinition pageDefinition = new SimplePageDefinition( pageReadHandler.getPageFormat(), width, height ); final MasterReport report = (MasterReport) getRootHandler().getHelperObject( ReportParserUtil.HELPER_OBJ_REPORT_NAME ); report.setPageDefinition( pageDefinition ); }
/** * Done parsing. * * @throws org.xml.sax.SAXException * if there is a parsing error. */ protected void doneParsing() throws SAXException { if ( pageDefList.isEmpty() ) { throw new SAXException( "page-definition element needs at least one page definition." ); } final CustomPageDefinition pageDefinition = new CustomPageDefinition(); for ( int i = 0; i < pageDefList.size(); i++ ) { final PageReadHandler readHandler = (PageReadHandler) pageDefList.get( i ); pageDefinition.addPageFormat( readHandler.getPageFormat(), readHandler.getX(), readHandler.getY() ); } final MasterReport report = (MasterReport) getRootHandler().getHelperObject( ReportParserUtil.HELPER_OBJ_REPORT_NAME ); report.setPageDefinition( pageDefinition ); }
/** * Starts parsing. * * @param attrs * the attributes. * @throws SAXException * if there is a parsing error. */ protected void startParsing( final Attributes attrs ) throws SAXException { final Object maybeReport = getRootHandler().getHelperObject( ReportParserUtil.HELPER_OBJ_REPORT_NAME ); if ( maybeReport instanceof SubReport == false ) { // replace it .. report = new SubReport(); getRootHandler().setHelperObject( ReportParserUtil.HELPER_OBJ_REPORT_NAME, report ); } else { report = (SubReport) maybeReport; } }
protected void startParsing( final PropertyAttributes attrs ) throws SAXException { final ReportDefinition report = (ReportDefinition) getRootHandler().getHelperObject( ReportParserUtil.HELPER_OBJ_REPORT_NAME ); final int groupCount = report.getGroupCount(); for ( int i = 0; i < groupCount; i++ ) { final Group g = report.getGroup( i ); if ( g instanceof RelationalGroup ) { groupList.add( (RelationalGroup) g ); } else { throw new ParseException( "The existing report contains non-default groups. " + "This parser cannot handle such a construct." ); } } }
/** * Done parsing. * * @throws SAXException * if there is a parsing error. */ protected void doneParsing() throws SAXException { final AbstractReportDefinition report = (AbstractReportDefinition) getRootHandler().getHelperObject( ReportParserUtil.HELPER_OBJ_REPORT_NAME ); try { final GroupList clone = (GroupList) groupList.clone(); clone.installIntoReport( report ); } catch ( CloneNotSupportedException e ) { throw new ParseException( "Failed to add group-list to report", getLocator() ); } }