/** * Returns the current handler. * * @return The current handler. */ protected XmlReadHandler getCurrentHandler() { return this.currentHandlers.peek(); }
public MfDcState getCurrentState() { return (MfDcState) dcStack.peek(); }
private StyleContext getCurrentContext() { return context.peek(); }
public RenderedCrosstabLayout getCurrentRenderedCrosstabLayout() { return renderedCrosstabLayouts.peek(); }
protected StyleRule getParentRule() { if ( parentRules.isEmpty() == false ) { return (StyleRule) parentRules.peek(); } return null; }
/** * Returns the predicted size of the current group. This can return <code>null</code> if there is no prediction. * * @return */ public Integer getPredictedStateCount() { if ( groupCounts.size() == 0 ) { logger.debug( "Outside of any group: Unable to predict results" ); return null; } final Integer prediction = counts.get( keys.peek() ); return prediction; } }
/** * Returns all namespaces as properties-collection. This reflects the currently defined namespaces, therefore calls to * writeOpenTag(..) might cause this method to return different collections. * * @return the defined namespaces. */ public Properties getNamespaces() { final Properties namespaces = new Properties(); if ( openTags.isEmpty() ) { if ( impliedNamespaces != null ) { //noinspection UseOfPropertiesAsHashtable namespaces.putAll( impliedNamespaces ); } return namespaces; } final ElementLevel parent = (ElementLevel) openTags.peek(); //noinspection UseOfPropertiesAsHashtable namespaces.putAll( parent.getNamespaces().getNamespaces() ); return namespaces; }
/** * Checks, whether the given namespace prefix is defined. * * @param prefix the namespace prefix. * @return true, if the prefix is defined, false otherwise. */ public boolean isNamespacePrefixDefined( final String prefix ) { if ( impliedNamespaces != null ) { if ( impliedNamespaces.containsValue( prefix ) ) { return true; } } if ( openTags.isEmpty() ) { return false; } final ElementLevel parent = (ElementLevel) openTags.peek(); return parent.getNamespaces().isPrefixDefined( prefix ); }
/** * Checks, whether the given URI is defined as valid namespace. * * @param uri the uri of the namespace. * @return true, if there's a namespace defined, false otherwise. */ public boolean isNamespaceDefined( final String uri ) { if ( impliedNamespaces != null ) { if ( impliedNamespaces.containsKey( uri ) ) { return true; } } if ( openTags.isEmpty() ) { return false; } final ElementLevel parent = (ElementLevel) openTags.peek(); return parent.getNamespaces().isNamespaceDefined( uri ); }
public BoxAlignContext closeContext() { final BoxAlignContext context = contexts.pop(); context.validate(); if ( contexts.isEmpty() ) { currentLine = null; } else { currentLine = contexts.peek(); } return context; } }
protected void finishInlineBox( final InlineRenderBox box ) { formatBufferStack.pop(); if ( formatBufferStack.isEmpty() ) { return; } RichTextFormat rtf = formatBufferStack.peek(); final RichTextFormat lastRtf = formatBuffer.get( formatBuffer.size() - 1 ); if ( lastRtf.getFont().equals( rtf.getFont() ) == false ) { formatBuffer.add( new RichTextFormat( getTextLength(), rtf.getFont() ) ); } }
protected void inspectEndSection( final ReportElement box, final boolean inlineSection ) { formatBufferStack.pop(); if ( formatBufferStack.isEmpty() ) { return; } RichTextFormat rtf = formatBufferStack.peek(); final RichTextFormat lastRtf = formatBuffer.get( formatBuffer.size() - 1 ); if ( lastRtf.getFont().equals( rtf.getFont() ) == false ) { formatBuffer.add( new RichTextFormat( getTextLength(), rtf.getFont() ) ); } } }
/** * Computes the current collection of defined namespaces. * * @return the namespaces declared at this writing position. */ protected DeclaredNamespaces computeNamespaces() { if ( openTags.isEmpty() ) { final DeclaredNamespaces namespaces = new DeclaredNamespaces(); if ( impliedNamespaces != null ) { return namespaces.add( impliedNamespaces ); } return namespaces; } final ElementLevel parent = (ElementLevel) openTags.peek(); return parent.getNamespaces(); }
public int getGroupStartRow( final int group ) { if ( group < 0 || group >= groupStarts.size() ) { if ( groupStarts.isEmpty() ) { return 0; } final GroupStartRecord o = groupStarts.peek(); return o.getRow(); } final GroupStartRecord o = groupStarts.get( group ); return o.getRow(); } }
private RepositoryFileTreeDto searchTreeNode( FastStack<String> fullName, RepositoryFileTreeDto treeNode ) { // no more name parts to search, found file in subtree if ( fullName.size() == 0 ) { return treeNode; } // search recursively for each name part in subtree final String fileOrDirName = fullName.peek(); final List<RepositoryFileTreeDto> children = treeNode.getChildren(); for ( final RepositoryFileTreeDto child : children ) { final String childName = child.getFile().getName(); if ( fileOrDirName.equals( childName ) ) { fullName.pop(); return searchTreeNode( fullName, child ); } } // didn't find file return null; }
public void groupBodyFinished( final ReportEvent event ) { clearPendingPageStart( event ); setCurrentEvent( event ); try { final GroupOutputHandler handler = outputHandlers.peek(); handler.groupBodyFinished( this, event ); } catch ( final InvalidReportStateException fe ) { throw fe; } catch ( final Exception e ) { throw new InvalidReportStateException( "GroupBody failed", e ); } finally { clearCurrentEvent(); } }
/** * Receives notification that a row of data is being processed. * * @param event * the event. */ public void itemsAdvanced( final ReportEvent event ) { if ( event.getLevel() == getDependencyLevel() ) { if ( processingStack == null || processingStack.isEmpty() ) { return; } final CrosstabSpecification state = processingStack.peek(); if ( state == null ) { return; } // this may throw an InvalidReportStateException that ends the report processing. state.add( getDataRow() ); } }
/** * Writes a comment into the generated xml file. * * @param writer the writer. * @param comment the comment text * @throws IOException if there is a problem writing to the character stream. */ public void writeComment( final Writer writer, final String comment ) throws IOException { if ( openTags.isEmpty() == false ) { final ElementLevel level = (ElementLevel) openTags.peek(); if ( getTagDescription().hasCData( level.getNamespace(), level.getTagName() ) == false ) { indent( writer ); } } setLineEmpty( false ); writer.write( "<!-- " ); writeTextNormalized( writer, comment, false ); writer.write( " -->" ); doEndOfLine( writer ); }
public DefaultFlowController deactivateExpressions() { final Integer counter = this.expressionsStack.peek(); final int counterRaw = counter.intValue(); if ( counterRaw == 0 ) { final DefaultFlowController fc = new DefaultFlowController( this, dataRow ); fc.expressionsStack.pop(); return fc; } final MasterDataRow dataRow = this.dataRow.derive(); final ExpressionDataRow edr = dataRow.getExpressionDataRow(); final DefaultFlowController fc = new DefaultFlowController( this, dataRow ); fc.expressionsStack.pop(); edr.popExpressions( counterRaw ); dataRow.resetDataSchema(); return fc; }
/** * Conditionally writes an end-of-line character. The End-Of-Line is only written, if the tag description indicates * that the currently open element does not expect any CDATA inside. Writing a newline for CDATA-elements may have * sideeffects. * * @param w the writer. * @throws java.io.IOException if there is an I/O problem. */ private void doEndOfLine( final Writer w ) throws IOException { if ( openTags.isEmpty() ) { if ( isWriteFinalLinebreak() ) { writeNewLine( w ); } } else { final ElementLevel level = (ElementLevel) openTags.peek(); if ( getTagDescription().hasCData( level.getNamespace(), level.getTagName() ) == false ) { writeNewLine( w ); } } }