Lines 19-24
Link Here
|
19 |
|
19 |
|
20 |
package org.apache.xmlgraphics.xmp; |
20 |
package org.apache.xmlgraphics.xmp; |
21 |
|
21 |
|
|
|
22 |
import java.net.URI; |
23 |
|
22 |
import java.util.Iterator; |
24 |
import java.util.Iterator; |
23 |
import java.util.Map; |
25 |
import java.util.Map; |
24 |
|
26 |
|
Lines 38-43
Link Here
|
38 |
private Object value; |
40 |
private Object value; |
39 |
private String xmllang; |
41 |
private String xmllang; |
40 |
private Map qualifiers; |
42 |
private Map qualifiers; |
|
|
43 |
private boolean uri; |
41 |
|
44 |
|
42 |
/** |
45 |
/** |
43 |
* Creates a new XMP property. |
46 |
* Creates a new XMP property. |
Lines 47-52
Link Here
|
47 |
public XMPProperty(QName name, Object value) { |
50 |
public XMPProperty(QName name, Object value) { |
48 |
this.name = name; |
51 |
this.name = name; |
49 |
this.value = value; |
52 |
this.value = value; |
|
|
53 |
this.uri = false; |
50 |
} |
54 |
} |
51 |
|
55 |
|
52 |
/** @return the qualified name of the property (namespace URI + local name) */ |
56 |
/** @return the qualified name of the property (namespace URI + local name) */ |
Lines 192-203
Link Here
|
192 |
public void toSAX(ContentHandler handler) throws SAXException { |
196 |
public void toSAX(ContentHandler handler) throws SAXException { |
193 |
AttributesImpl atts = new AttributesImpl(); |
197 |
AttributesImpl atts = new AttributesImpl(); |
194 |
String qName = getEffectiveQName(); |
198 |
String qName = getEffectiveQName(); |
|
|
199 |
if (value instanceof URI) { |
200 |
atts.addAttribute(XMPConstants.RDF_NAMESPACE, "resource", "rdf:resource", "CDATA", ((URI)value).toString()); |
201 |
} |
195 |
handler.startElement(getName().getNamespaceURI(), |
202 |
handler.startElement(getName().getNamespaceURI(), |
196 |
getName().getLocalName(), qName, atts); |
203 |
getName().getLocalName(), qName, atts); |
197 |
if (value instanceof XMPComplexValue) { |
204 |
if (value instanceof XMPComplexValue) { |
198 |
XMPComplexValue cv = ((XMPComplexValue)value); |
205 |
XMPComplexValue cv = ((XMPComplexValue)value); |
199 |
cv.toSAX(handler); |
206 |
cv.toSAX(handler); |
200 |
} else { |
207 |
} else if (!(value instanceof URI)) { |
201 |
char[] chars = value.toString().toCharArray(); |
208 |
char[] chars = value.toString().toCharArray(); |
202 |
handler.characters(chars, 0, chars.length); |
209 |
handler.characters(chars, 0, chars.length); |
203 |
} |
210 |
} |