1 17 18 19 20 package org.apache.fop.render.afp.modca; 21 import java.io.UnsupportedEncodingException ; 22 23 28 public abstract class AbstractNamedAFPObject extends AbstractAFPObject{ 29 30 33 protected String _name = null; 34 35 38 protected byte[] _nameBytes; 39 40 45 public AbstractNamedAFPObject(String name) { 46 47 if (name.length() < 8) { 48 name = (name + " ").substring(0, 8); 49 } else if (name.length() > 8) { 50 log.warn("Constructor:: name truncated to 8 chars"+ name); 51 name = name.substring(0, 8); 52 } 53 54 try { 55 56 _nameBytes = name.getBytes(AFPConstants.EBCIDIC_ENCODING); 57 58 } catch (UnsupportedEncodingException usee) { 59 60 _nameBytes = name.getBytes(); 61 log.warn( 62 "Constructor:: UnsupportedEncodingException translating the name " 63 + name); 64 65 } 66 67 } 68 69 } 70 | Popular Tags |