1 51 package org.apache.fop.fo; 52 53 import org.apache.fop.layout.Area; 54 import org.apache.fop.apps.FOPException; 55 56 public class UnknownXMLObj extends XMLObj { 57 String namespace; 58 59 62 public static class Maker extends FObj.Maker { 63 String space; 64 String tag; 65 66 Maker(String sp, String t) { 67 space = sp; 68 tag = t; 69 } 70 71 79 public FObj make(FObj parent, PropertyList propertyList, 80 String systemId, int line, int column) 81 throws FOPException { 82 return new UnknownXMLObj(parent, propertyList, space, tag, 83 systemId, line, column); 84 } 85 } 86 87 92 public static FObj.Maker maker(String space, String tag) { 93 return new UnknownXMLObj.Maker(space, tag); 94 } 95 96 102 protected UnknownXMLObj(FObj parent, PropertyList propertyList, 103 String namespace, String name, 104 String systemId, int line, int column) { 105 super(parent, propertyList, name, systemId, line, column); 106 this.namespace = namespace; 107 } 108 109 public String getNameSpace() { 110 return this.namespace; 111 } 112 113 protected void addChild(FONode child) { 114 if(doc == null) { 115 createBasicDocument(); 116 } 117 super.addChild(child); 118 } 119 120 protected void addCharacters(char data[], int start, int length) { 121 if(doc == null) { 122 createBasicDocument(); 123 } 124 super.addCharacters(data, start, length); 125 } 126 127 public int layout(Area area) throws FOPException { 128 log.error("no handler defined for " + this.getName() + " foreign xml"); 133 134 135 return Status.OK; 136 } 137 138 public String getName() { 139 if (namespace == null || namespace.length() == 0) { 140 return tagName; 141 } else { 142 return namespace + ":" + tagName; 143 } 144 } 145 } 146 147 | Popular Tags |