Immutable mu = new Immutable(); mu.state[1] = 'o';
public Object getRoot() { if(!all.isEmpty()) { popAll(); popAccepted(); } return root; }
public void marshal(String xsdURL, ObjectModelProvider provider, Object root, Writer writer) throws IOException, SAXException { XSModel model = Util.loadSchema(xsdURL, schemaResolver); marshallInternal(provider, root, model, writer); }
public ElementBinding(SchemaBinding schema, QName qName, TypeBinding typeBinding) { super(schema); this.qName = qName; this.typeBinding = typeBinding; if(qName == null) { throw new JBossXBRuntimeException("Each element must have a non-null QName!"); } }
/** * If there is a type being used from a different namespace, a custom * prefix will be needed * @param nsuri * @return New Prefix */ public String allocatePrefix(String nsURI) { String prefix = namespaces.getPrefix(nsURI); return (prefix == null) ? namespaces.registerURI(nsURI, null) : prefix; }
public void popFactory() { if(nsSwitchingFactory == null || nsSwitchingFactory.isEmpty()) { curNameSwitchingFactory = null; curNsSwitchingFactory = null; } else { curNameSwitchingFactory = (String)nameSwitchingFactory.pop(); curNsSwitchingFactory = (String)nsSwitchingFactory.pop(); } curFactory = getFactory(curNsSwitchingFactory); }
/** Get the prefix for the target namespace */ public String getTargetPrefix() { return namespaces.getPrefix(targetNamespace); }
public void mapFieldToElement(Class cls, String field, String namespaceURI, String localName, TypeBinding converter) { FieldToElementMapping mapping = new FieldToElementMapping(cls, field, namespaceURI, localName, converter); mapFieldToElement(mapping); }
public void init(ObjectModelFactory defaultFactory, Object root) { this.defaultFactory = getGenericObjectModelFactory(defaultFactory); all.clear(); accepted.clear(); this.root = root; }
public Object getAttributeValue(Object o, MarshallingContext ctx, String namespaceURI, String localName) { boolean optional = ctx == null ? ignoreNotFoundField : !ctx.isAttributeRequired() || ignoreNotFoundField; return getJavaValue(namespaceURI, localName, null, o, false, optional); }
private void pushAll(Object o) { all.push(new AllElement(o)); }
/** Get the namespaceURI for a given prefix */ public String getNamespaceURI(String prefix) { return namespaces.getNamespaceURI(prefix); }
/** * Extracts the package name from the typeNS * @param typeNS * @return */ public String getPackageName(String typeNS) { String pkgname = Util.xmlNamespaceToJavaPackage(typeNS); return pkgname; }
/** Register a QName and return a QName that is guarantied to have a prefix */ public QName registerQName(QName qname) { return namespaces.registerQName(qname); }
public void endElement(String namespaceURI, String localName, String qName) throws SAXException { content.endElement(namespaceURI, localName, qName); }
static final GenericObjectModelFactory getGenericObjectModelFactory(ObjectModelFactory factory) { if(!(factory instanceof GenericObjectModelFactory)) { factory = new DelegatingObjectModelFactory(factory); } return factory instanceof GenericObjectModelFactory ? (GenericObjectModelFactory)factory : new DelegatingObjectModelFactory(factory); }
public ParticleBinding getCurrentParticle() { if(curParticle == null) { throw new JBossXBRuntimeException("The cursor in all group has not been positioned yet!"); } return curParticle; }
public class Sharable { private Sharable() { } public static Immutable getImmutableInstance(int a, int b) { return new Immutable(a, b); } }
public void marshal(Reader xsdReader, ObjectModelProvider provider, Object root, Writer writer) throws IOException, SAXException, ParserConfigurationException { XSModel model = Util.loadSchema(xsdReader, null, schemaResolver); marshallInternal(provider, root, model, writer); }
/** Get the prefix for a given namespaceURI */ public String getPrefix(String namespaceURI) { return namespaces.getPrefix(namespaceURI); }