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 HierarchyHeaderFactory 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 return header; 39 } 40 41 42 public void visitDimension(Dimension v) { 43 header.setObject(v); 44 } 45 46 public void visitHierarchy(Hierarchy v) { 47 header.setObject(v); 48 } 49 50 public void visitLevel(Level v) { 51 header.setObject(v.getHierarchy()); 52 } 53 54 public void visitMember(Member v) { 55 header.setObject(v.getLevel().getHierarchy()); 56 } 57 58 public void visitProperty(Property v) { 59 header.setObject(new PropertyHeading(v.getLabel())); 60 } 61 62 public void visitPropertyHeading(PropertyHeading heading) { 63 header.setObject(new PropertyHeading(heading.getLabel())); 64 } 65 66 public void visitEmptyMember(EmptyMember v) { 67 header.setObject(v); 68 } 69 70 71 } 72 73 74 | Popular Tags |