1 22 package org.jboss.repository.plugins; 23 24 import org.jboss.repository.spi.MetaDataCombiner; 25 import org.jboss.repository.spi.Key; 26 import org.jboss.repository.spi.MetaData; 27 28 32 public class KeyMetaDataCombiner 33 implements MetaDataCombiner 34 { 35 private MetaDataCombiner next; 36 37 public KeyMetaDataCombiner() 38 { 39 this(null); 40 } 41 public KeyMetaDataCombiner(MetaDataCombiner next) 42 { 43 this.next = next; 44 } 45 46 public MetaDataCombiner getNext() 47 { 48 return next; 49 } 50 public void setNext(MetaDataCombiner next) 51 { 52 this.next = next; 53 } 54 55 61 public Object combine(Key key, MetaData[] levelData) 62 { 63 int level = key.getLevel(); 64 MetaData metadata = levelData[level]; 65 Object value = null; 66 if( metadata != null ) 67 value = metadata.getData(); 68 if( next != null ) 69 value = next.combine(key, levelData); 70 return value; 71 } 72 73 } 74 | Popular Tags |