1 22 23 package org.xquark.extractor.metadata; 24 25 public class Attribute extends NamedNode { 26 27 private static final String RCSRevision = "$Revision: 1.7 $"; 28 private static final String RCSName = "$Name: $"; 29 30 private boolean _nullable; 31 private ExtractorMappingInfo _mappingInfo = null; 32 33 34 38 public Attribute(String name) { 39 super(name); 40 _alias = name; 41 } 42 43 public Attribute(String name, String alias) { 44 super(name); 45 setAlias(alias); 46 } 47 48 53 public boolean getNullable() { 54 return _nullable; 55 } 56 57 63 public void setNullable(boolean aNullable) { 64 _nullable = aNullable; 65 } 66 67 71 public ExtractorMappingInfo getMappingInfo() { 72 return _mappingInfo; 73 } 74 75 79 public void setMappingInfo(ExtractorMappingInfo mappingInfo) { 80 _mappingInfo = mappingInfo; 81 } 82 83 public String getFullName() { 84 StringBuffer retVal = new StringBuffer (); 85 String name = null; 86 87 name = getFather().getFather().getFather().getName(); 88 if (null != name) { 89 retVal.append(name); 90 retVal.append('.'); 91 } 92 93 name = getFather().getFather().getName(); 94 if (null != name) { 95 retVal.append(name); 96 retVal.append('.'); 97 } 98 99 name = getFather().getName(); 100 if (null != name) { 101 retVal.append(name); 102 retVal.append('.'); 103 } 104 105 retVal.append(_name); 106 return retVal.toString(); 107 } 108 109 public String pprint() { 110 StringBuffer retVal = new StringBuffer (); 111 112 String newLine = System.getProperty("line.separator"); 113 retVal.append(_name); 114 retVal.append(" : "); 115 retVal.append(_mappingInfo.getDBType().pprint()); 116 117 return retVal.toString(); 118 } 119 } 120 | Popular Tags |