1 23 24 package org.objectweb.jorm.naming.lib; 25 26 import java.math.BigDecimal ; 27 import java.math.BigInteger ; 28 import java.util.Date ; 29 30 import org.objectweb.jorm.api.PException; 31 import org.objectweb.jorm.naming.api.PExceptionNaming; 32 import org.objectweb.jorm.naming.api.PName; 33 import org.objectweb.jorm.naming.api.PNameManager; 34 import org.objectweb.jorm.naming.api.PNamingContext; 35 import org.objectweb.jorm.type.api.PType; 36 37 43 public abstract class BasicPName implements PName { 44 45 46 public String toString() { 47 return super.toString() 48 + " / pnc: " + (pnc == null 49 ? "no assigned " 50 : (pnc.getPType() == null 51 ? "null PType" 52 : pnc.getPType().getJormName())); 53 } 54 55 58 protected transient PNameManager pnc = null; 59 60 public void setPNamingContext(PNamingContext pnc) { 61 this.pnc = pnc; 62 } 63 64 public boolean codingSupported(int codingtype) { 65 return pnc.codingSupported(codingtype); 66 } 67 68 public byte[] encode() throws PExceptionNaming { 69 return pnc.encode(this); 70 } 71 72 public Object encodeAbstract() throws PExceptionNaming, UnsupportedOperationException { 73 return pnc.encodeAbstract(this); 74 } 75 76 public byte encodeByte() throws PExceptionNaming, UnsupportedOperationException { 77 return pnc.encodeByte(this); 78 } 79 80 public Byte encodeObyte() throws PExceptionNaming, UnsupportedOperationException { 81 return pnc.encodeObyte(this); 82 } 83 84 public char encodeChar() throws PExceptionNaming, UnsupportedOperationException { 85 return pnc.encodeChar(this); 86 } 87 88 public Character encodeOchar() throws PExceptionNaming, UnsupportedOperationException { 89 return pnc.encodeOchar(this); 90 } 91 92 public int encodeInt() throws PExceptionNaming, UnsupportedOperationException { 93 return pnc.encodeInt(this); 94 } 95 96 public Integer encodeOint() throws PExceptionNaming, UnsupportedOperationException { 97 return pnc.encodeOint(this); 98 } 99 100 public long encodeLong() throws PExceptionNaming, UnsupportedOperationException { 101 return pnc.encodeLong(this); 102 } 103 104 public Long encodeOlong() throws PExceptionNaming, UnsupportedOperationException { 105 return pnc.encodeOlong(this); 106 } 107 108 public short encodeShort() throws PExceptionNaming, UnsupportedOperationException { 109 return pnc.encodeShort(this); 110 } 111 112 public Short encodeOshort() throws PExceptionNaming, UnsupportedOperationException { 113 return pnc.encodeOshort(this); 114 } 115 116 public String encodeString() throws PExceptionNaming { 117 return pnc.encodeString(this); 118 } 119 120 public char[] encodeCharArray() throws PExceptionNaming { 121 return pnc.encodeCharArray(this); 122 } 123 124 public Date encodeDate() throws PExceptionNaming { 125 return pnc.encodeDate(this); 126 } 127 128 public BigInteger encodeBigInteger() throws PExceptionNaming { 129 return pnc.encodeBigInteger(this); 130 } 131 132 public BigDecimal encodeBigDecimal() throws PExceptionNaming { 133 return pnc.encodeBigDecimal(this); 134 } 135 136 public PName export(Object conn, PNamingContext pnc) throws PException { 137 return pnc.export(conn, this); 138 } 139 140 public PName export(Object conn, PNamingContext pnc, Object hints) 141 throws PException { 142 return pnc.export(conn, this, hints); 143 } 144 145 public PNameManager getPNameManager() { 146 return pnc; 147 } 148 149 public PType getPType() { 150 return pnc.getPType(); 151 } 152 153 public PName resolve(Object conn) throws UnsupportedOperationException , PException { 154 if (pnc instanceof PNamingContext) { 155 return ((PNamingContext) pnc).resolve(conn, this); 156 } 157 throw new UnsupportedOperationException (); 158 } 159 160 public void unexport(Object conn) throws PException { 161 pnc.unexport(conn, this); 162 } 163 164 public void unexport(Object conn, Object hints) throws PException { 165 pnc.unexport(conn, this, hints); 166 } 167 } 168 | Popular Tags |