/** * Creates a new XMLInstance2Schema * */ public XMLInstance2Schema() { super(); _internalContext = new BackwardCompatibilityContext(); }
/** * Returns the default instance of XMLNaming. * * @see org.exolab.castor.util.AbstractProperties **/ public static final XMLNaming getInstance() { return new BackwardCompatibilityContext().getXMLNaming(); }
/** * Initializes InternalContext with default values. */ public BackwardCompatibilityContext() { setClassLoader(getClass().getClassLoader()); XMLClassDescriptorResolver cdr = (XMLClassDescriptorResolver) ClassDescriptorResolverFactory .createClassDescriptorResolver(BindingType.XML); cdr.setInternalContext(this); setXMLClassDescriptorResolver(cdr); Introspector introspector = new Introspector(); introspector.setInternalContext(this); setIntrospector(introspector); ResolverStrategy resolverStrategy = new CastorXMLStrategy(); setResolverStrategy(resolverStrategy); } }
/** * Returns the String representation of this AnyNode. The String * representation is a xml well-formed fragment corresponding to the * representation of this node. * @return the String representation of this AnyNode. */ public String toString() { Serializer serializer = new BackwardCompatibilityContext().getSerializer(); if (serializer == null) { throw new RuntimeException("Unable to obtain serializer"); } StringWriter writer = new StringWriter(); serializer.setOutputCharStream(writer); try { AnyNode2SAX.fireEvents(this, serializer.asDocumentHandler()); } catch (java.io.IOException ioe) { return privateToString(); } catch (org.xml.sax.SAXException saxe) { throw new RuntimeException(saxe.getMessage()); } return writer.toString(); }
primitiveNodeType = new BackwardCompatibilityContext().getPrimitiveNodeType();
public BackwardCompatibilityContext() { super(); setClassLoader(getClass().getClassLoader()); XMLClassDescriptorResolver cdr = (XMLClassDescriptorResolver) ClassDescriptorResolverFactory .createClassDescriptorResolver(BindingType.XML); cdr.setInternalContext(this); setXMLClassDescriptorResolver(cdr); Introspector introspector = new Introspector(); introspector.setInternalContext(this); setIntrospector(introspector); cdr.setIntrospector(introspector); ResolverStrategy resolverStrategy = new CastorXMLStrategy(); setResolverStrategy(resolverStrategy); cdr.setResolverStrategy(resolverStrategy); } }
/** * Returns the String representation of this AnyNode. The String representation is a xml * well-formed fragment corresponding to the representation of this node. * * @return the String representation of this AnyNode. */ public String toString() { Serializer serializer = new BackwardCompatibilityContext().getSerializer(); if (serializer == null) { throw new RuntimeException("Unable to obtain serializer"); } StringWriter writer = new StringWriter(); serializer.setOutputCharStream(writer); try { AnyNode2SAX.fireEvents(this, serializer.asDocumentHandler()); } catch (java.io.IOException ioe) { return privateToString(); } catch (org.xml.sax.SAXException saxe) { throw new RuntimeException(saxe.getMessage()); } return writer.toString(); }
primitiveNodeType = new BackwardCompatibilityContext().getPrimitiveNodeType();
/** * Creates a new Unmarshaller with the given Object. * * @param root the instance to unmarshal into. This * may be null, if the Unmarshaller#setMapping is called * to load a mapping for the root element of xml document. */ public Unmarshaller(final Object root) { this(new BackwardCompatibilityContext(), root); }
/** * Returns the default instance of XMLNaming. * @see org.exolab.castor.util.Configuration **/ public static final XMLNaming getInstance() { return new BackwardCompatibilityContext().getXMLNaming(); } //-- getInstance
/** * Creates a new Unmarshaller with the given Mapping. An instance of BackwardsCompatibilityContext * is used as InternalContext. * * @param mapping The Mapping to use. * @throws MappingException in case that Unmarshaller fails to be instantiated */ public Unmarshaller(final Mapping mapping) throws MappingException { this(new BackwardCompatibilityContext(), mapping); }
/** * We need some stuff initialized here. */ public MarshalFramework() { _internalContext = new BackwardCompatibilityContext(); }
/** * A constructor which sets the root class. * * Internally calls constructor Unmarshaller(InternalContext, Class) with * an instance of BackwardCompatibilityContext as context. * * @param clazz root class for unmarshalling */ public Unmarshaller(final Class clazz) { this(new BackwardCompatibilityContext(), clazz); }
/** * A constructor which sets the root class. * * Internally calls constructor Unmarshaller(InternalContext, Class) with an instance of * BackwardCompatibilityContext as context. * * @param clazz root class for unmarshalling */ public Unmarshaller(final Class clazz) { this(new BackwardCompatibilityContext(), clazz); }
/** * Creates a new Unmarshaller with the given Object. * * @param root the instance to unmarshal into. This may be null, if the Unmarshaller#setMapping is * called to load a mapping for the root element of xml document. */ public Unmarshaller(final Object root) { this(new BackwardCompatibilityContext(), root); }
/** * Creates a new Unmarshaller with the given Mapping. * An instance of BackwardsCompatibilityContext is used as InternalContext. * * @param mapping The Mapping to use. * @throws MappingException in case that Unmarshaller fails to be instantiated */ public Unmarshaller(final Mapping mapping) throws MappingException { this(new BackwardCompatibilityContext(), mapping); }
/** * Creates a new XMLInstance2Schema * */ public XMLInstance2Schema() { super(); _internalContext = new BackwardCompatibilityContext(); }
public XMLClassDescriptorAdapter() { super(); _internalContext = new BackwardCompatibilityContext(); }
/** * We need some stuff initialized here. MarshalFramework requires internally an * {@link InternalContext}, so either one is given or {@link BackwardCompatibilityContext} is * instantiated! Mind that instantiating {@link BackwardCompatibilityContext} means to (re-)read * configuration files. * * @param internalContext either an {@link InternalContext} comes from outside or * {@link BackwardCompatibilityContext} is instantiated */ public MarshalFramework(final InternalContext internalContext) { if (internalContext == null) { _internalContext = new BackwardCompatibilityContext(); } else { _internalContext = internalContext; } }
/** * Initializes this Marshaller. This is common code shared among * the Constructors **/ private void initialize() { setInternalContext(new BackwardCompatibilityContext()); _namespaces = new Namespaces(); _packages = new ArrayList(3); _parents = new SafeStack(); _validate = getInternalContext().marshallingValidation(); // _naming = XMLNaming.getInstance(); _processingInstructions = new ArrayList(3); _attributes = new AttributesImpl(); _topLevelAtts = new AttributeSetImpl(); _saveMapKeys = getInternalContext().getBooleanProperty(XMLConfiguration.SAVE_MAP_KEYS).booleanValue(); String prop = getInternalContext().getStringProperty(XMLConfiguration.PROXY_INTERFACES); if (prop != null) { StringTokenizer tokenizer = new StringTokenizer(prop, ", "); while (tokenizer.hasMoreTokens()) { _proxyInterfaces.add(tokenizer.nextToken()); } } } //-- initialize();