1 42 43 package org.jfree.xml.util; 44 45 import java.util.HashMap ; 46 47 50 public class MultiplexMappingDefinition { 51 52 53 private Class baseClass; 54 55 56 private String attributeName; 57 58 59 private HashMap forwardMappings; 60 61 62 private HashMap reverseMappings; 63 64 71 public MultiplexMappingDefinition(final Class baseClass, 72 final String attributeName, 73 final MultiplexMappingEntry[] entries) { 74 75 this.attributeName = attributeName; 76 this.baseClass = baseClass; 77 this.forwardMappings = new HashMap (); 78 this.reverseMappings = new HashMap (); 79 80 for (int i = 0; i < entries.length; i++) { 81 final MultiplexMappingEntry entry = entries[i]; 82 this.forwardMappings.put(entry.getAttributeValue(), entry); 83 this.reverseMappings.put(entry.getTargetClass(), entry); 84 } 85 } 86 87 92 public String getAttributeName() { 93 return this.attributeName; 94 } 95 96 101 public Class getBaseClass() { 102 return this.baseClass; 103 } 104 105 112 public MultiplexMappingEntry getEntryForType(final String type) { 113 return (MultiplexMappingEntry) this.forwardMappings.get(type); 114 } 115 116 123 public MultiplexMappingEntry getEntryForClass(final String clazz) { 124 return (MultiplexMappingEntry) this.reverseMappings.get(clazz); 125 } 126 } 127
| Popular Tags
|