1 13 package com.tonbeller.jpivot.table.span; 14 15 import com.tonbeller.jpivot.olap.model.Dimension; 16 import com.tonbeller.jpivot.olap.model.EmptyMember; 17 import com.tonbeller.jpivot.olap.model.Hierarchy; 18 import com.tonbeller.jpivot.olap.model.Level; 19 import com.tonbeller.jpivot.olap.model.Member; 20 import com.tonbeller.jpivot.olap.model.Property; 21 import com.tonbeller.jpivot.olap.model.VisitorSupportStrict; 22 23 29 public class LevelHeaderFactory extends VisitorSupportStrict implements SpanVisitor, SpanHeaderFactory { 30 Span header; 31 32 35 public Span create(Span span) { 36 header = (Span)span.clone(); 37 span.getObject().accept(this); 38 header.setPosition(null); 40 return header; 41 } 42 43 44 public void visitDimension(Dimension v) { 45 header.setObject(v); 46 } 47 48 public void visitHierarchy(Hierarchy v) { 49 header.setObject(v); 50 } 51 52 public void visitLevel(Level v) { 53 header.setObject(v); 54 } 55 56 public void visitMember(Member v) { 57 header.setObject(v.getLevel()); 58 } 59 60 public void visitProperty(Property v) { 61 header.setObject(new PropertyHeading(v.getLabel())); 62 } 63 64 public void visitPropertyHeading(PropertyHeading heading) { 65 header.setObject(new PropertyHeading(heading.getLabel())); 66 } 67 68 public void visitEmptyMember(EmptyMember v) { 69 header.setObject(v); 70 } 71 72 } 73 | Popular Tags |