public Section clone() { return (Section) super.clone(); } }
private void collectSubReports( final Band band ) throws FunctionProcessingException { final Element[] elements = band.getElementArray(); for ( int i = 0; i < elements.length; i++ ) { final Element element = elements[i]; if ( element instanceof SubReport ) { final InlineSubreportMarker marker = new InlineSubreportMarker( (SubReport) element.clone(), null, SubReportProcessType.BANDED ); inlineSubreports.add( marker ); } else if ( element instanceof Band ) { collectSubReports( (Band) element ); } } }
public void testElementAttributeCopyOnWrite2() { final Element e = new Element(); final Element clone = e.clone(); clone.setAttribute( "namespace", "name", "value" ); assertNull( e.getAttribute( "namespace", "name" ) ); }
public void testElementAttributeCopyOnWrite() { final Element e = new Element(); final Element clone = e.clone(); e.setAttribute( "namespace", "name", "value" ); assertNull( clone.getAttribute( "namespace", "name" ) ); }
public void testCloneAttributeOrder() throws Exception { final Element e = new Element(); e.setAttribute( "Namespace1", "Attr1", "Value1" ); e.setAttribute( "Namespace1", "Attr2", "Value1" ); e.setAttribute( "Namespace1", "Attr3", "Value1" ); e.setAttribute( "Namespace2", "Attr1", "Value1" ); e.setAttribute( "Namespace2", "Attr2", "Value1" ); e.setAttribute( "Namespace2", "Attr3", "Value1" ); final Element e2 = (Element) e.clone(); final String[] attributeNamespaces = e2.getAttributeNamespaces(); assertEquals( Arrays.asList( attributeNamespaces ), Arrays.asList( e.getAttributeNamespaces() ) ); for ( int i = 0; i < attributeNamespaces.length; i++ ) { final String namespace = attributeNamespaces[i]; final String[] names = e2.getAttributeNames( namespace ); assertEquals( Arrays.asList( names ), Arrays.asList( e.getAttributeNames( namespace ) ) ); } }
public void testElementClone() throws CloneNotSupportedException { final Band band = new Band(); final Element e = new Element(); band.addElement( e ); assertNotNull( e.getParent() ); assertNotNull( e.getDataSource() ); assertNotNull( e.getStyle() ); assertNotNull( e.getName() ); assertTrue( e.isVisible() ); final Element clone = (Element) e.clone(); assertNull( clone.getParent() ); assertNotNull( clone.getDataSource() ); assertNotNull( clone.getStyle() ); assertNotNull( clone.getName() ); assertTrue( clone.isVisible() ); final Band clonedBand = (Band) band.clone(); assertNull( clonedBand.getParent() ); assertNotNull( clonedBand.getDataSource() ); assertNotNull( clonedBand.getStyle() ); assertNotNull( clonedBand.getName() ); assertTrue( clonedBand.isVisible() ); final Element clientElement = clonedBand.getElement( 0 ); assertNotNull( clientElement.getParent() ); assertNotNull( clientElement.getDataSource() ); assertNotNull( clientElement.getStyle() ); assertNotNull( clientElement.getName() ); assertTrue( clientElement.isVisible() ); assertEquals( clonedBand, clientElement.getParent() ); }