01: package com.sun.tools.xjc.reader.xmlschema.bindinfo;
02:
03: import javax.xml.bind.annotation.XmlRootElement;
04: import javax.xml.bind.annotation.XmlAttribute;
05: import javax.xml.namespace.QName;
06:
07: import com.sun.xml.xsom.XSComponent;
08: import com.sun.tools.xjc.model.CPropertyInfo;
09: import com.sun.tools.xjc.reader.Ring;
10: import com.sun.tools.xjc.reader.Const;
11: import com.sun.tools.xjc.reader.xmlschema.BGMBuilder;
12:
13: /**
14: * Controls the <tt>ObjectFactory</tt> method name.
15: *
16: * @author Kohsuke Kawaguchi
17: */
18: @XmlRootElement(name="factoryMethod")
19: public class BIFactoryMethod extends AbstractDeclarationImpl {
20: @XmlAttribute
21: public String name;
22:
23: /**
24: * If the given component has {@link BIInlineBinaryData} customization,
25: * reflect that to the specified property.
26: */
27: public static void handle(XSComponent source, CPropertyInfo prop) {
28: BIInlineBinaryData inline = Ring.get(BGMBuilder.class)
29: .getBindInfo(source).get(BIInlineBinaryData.class);
30: if (inline != null) {
31: prop.inlineBinaryData = true;
32: inline.markAsAcknowledged();
33: }
34: }
35:
36: public final QName getName() {
37: return NAME;
38: }
39:
40: /** Name of the declaration. */
41: public static final QName NAME = new QName(Const.JAXB_NSURI,
42: "factoryMethod");
43: }
|