Class CastorMarshaller

    • Method Detail

      • setMappingLocation

        public void setMappingLocation​(Resource mappingLocation)
        Deprecated.
        Set the locations of the Castor XML mapping files.
      • setMappingLocations

        public void setMappingLocations​(Resource... mappingLocations)
        Deprecated.
        Set the locations of the Castor XML mapping files.
      • setTargetPackage

        public void setTargetPackage​(String targetPackage)
        Deprecated.
        Set the name of a package with the Castor descriptor classes.
      • setTargetPackages

        public void setTargetPackages​(String... targetPackages)
        Deprecated.
        Set the names of packages with the Castor descriptor classes.
      • setValidating

        public void setValidating​(boolean validating)
        Deprecated.
        Set whether this marshaller should validate in- and outgoing documents.

        Default is false.

        See Also:
        Marshaller.setValidation(boolean)
      • setSuppressNamespaces

        public void setSuppressNamespaces​(boolean suppressNamespaces)
        Deprecated.
        Sets whether this marshaller should output namespaces.

        The default is false, i.e. namespaces are written.

        See Also:
        Marshaller.setSuppressNamespaces(boolean)
      • setSuppressXsiType

        public void setSuppressXsiType​(boolean suppressXsiType)
        Deprecated.
        Set whether this marshaller should output the xsi:type attribute.

        The default is false, i.e. the xsi:type is written.

        See Also:
        Marshaller.setSuppressXSIType(boolean)
      • setMarshalAsDocument

        public void setMarshalAsDocument​(boolean marshalAsDocument)
        Deprecated.
        Set whether this marshaller should output the xml declaration.

        The default is true, the XML declaration will be written.

        See Also:
        Marshaller.setMarshalAsDocument(boolean)
      • setMarshalExtendedType

        public void setMarshalExtendedType​(boolean marshalExtendedType)
        Deprecated.
        Set whether this marshaller should output for given type the xsi:type attribute.

        The default is true, the xsi:type attribute will be written.

        See Also:
        Marshaller.setMarshalExtendedType(boolean)
      • setRootElement

        public void setRootElement​(String rootElement)
        Deprecated.
        Set the name of the root element.
        See Also:
        Marshaller.setRootElement(String)
      • setNoNamespaceSchemaLocation

        public void setNoNamespaceSchemaLocation​(String noNamespaceSchemaLocation)
        Deprecated.
        Set the value of xsi:noNamespaceSchemaLocation attribute. When set, the xsi:noNamespaceSchemaLocation attribute will be written for the root element.
        See Also:
        Marshaller.setNoNamespaceSchemaLocation(String)
      • setSchemaLocation

        public void setSchemaLocation​(String schemaLocation)
        Deprecated.
        Set the value of xsi:schemaLocation attribute. When set, the xsi:schemaLocation attribute will be written for the root element.
        See Also:
        Marshaller.setSchemaLocation(String)
      • setUseXSITypeAtRoot

        public void setUseXSITypeAtRoot​(boolean useXSITypeAtRoot)
        Deprecated.
        Sets whether this marshaller should output the xsi:type attribute for the root element. This can be useful when the type of the element can not be simply determined from the element name.

        The default is false: The xsi:type attribute for the root element won't be written.

        See Also:
        Marshaller.setUseXSITypeAtRoot(boolean)
      • setWhitespacePreserve

        public void setWhitespacePreserve​(boolean whitespacePreserve)
        Deprecated.
        Set whether the Castor Unmarshaller should preserve "ignorable" whitespace.

        Default is false.

        See Also:
        Unmarshaller.setWhitespacePreserve(boolean)
      • setIgnoreExtraAttributes

        public void setIgnoreExtraAttributes​(boolean ignoreExtraAttributes)
        Deprecated.
        Set whether the Castor Unmarshaller should ignore attributes that do not match a specific field.

        Default is true: Extra attributes are ignored.

        See Also:
        Unmarshaller.setIgnoreExtraAttributes(boolean)
      • setIgnoreExtraElements

        public void setIgnoreExtraElements​(boolean ignoreExtraElements)
        Deprecated.
        Set whether the Castor Unmarshaller should ignore elements that do not match a specific field.

        Default is false: Extra elements are flagged as an error.

        See Also:
        Unmarshaller.setIgnoreExtraElements(boolean)
      • setRootObject

        public void setRootObject​(Object root)
        Deprecated.
        Set the expected root object for the unmarshaller, into which the source will be unmarshalled.
        See Also:
        Unmarshaller.setObject(Object)
      • setReuseObjects

        public void setReuseObjects​(boolean reuseObjects)
        Deprecated.
        Set whether this unmarshaller should re-use objects. This will be only used when unmarshalling to an existing object.

        The default is false, which means that the objects won't be re-used.

        See Also:
        Unmarshaller.setReuseObjects(boolean)
      • setClearCollections

        public void setClearCollections​(boolean clearCollections)
        Deprecated.
        Sets whether this unmarshaller should clear collections upon the first use.

        The default is false which means that marshaller won't clear collections.

        See Also:
        Unmarshaller.setClearCollections(boolean)
      • setCastorProperties

        public void setCastorProperties​(Map<String,​String> castorProperties)
        Deprecated.
        Set Castor-specific properties for marshalling and unmarshalling. Each entry key is considered the property name and each value the property value.
        See Also:
        Marshaller.setProperty(String, String), Unmarshaller.setProperty(String, String)
      • setDoctypes

        public void setDoctypes​(Map<String,​String> doctypes)
        Deprecated.
        Set the map containing document type definition for the marshaller. Each entry has system id as key and public id as value.
        See Also:
        Marshaller.setDoctype(String, String)
      • setProcessingInstructions

        public void setProcessingInstructions​(Map<String,​String> processingInstructions)
        Deprecated.
        Sets the processing instructions that will be used by during marshalling. Keys are the processing targets and values contain the processing data.
        See Also:
        Marshaller.addProcessingInstruction(String, String)
      • setNamespaceMappings

        public void setNamespaceMappings​(Map<String,​String> namespaceMappings)
        Deprecated.
        Set the namespace mappings. Property names are interpreted as namespace prefixes; values are namespace URIs.
        See Also:
        Marshaller.setNamespaceMapping(String, String)
      • setNamespaceToPackageMapping

        public void setNamespaceToPackageMapping​(Map<String,​String> namespaceToPackageMapping)
        Deprecated.
        Set the namespace to package mappings. Property names are represents the namespaces URI, values are packages.
        See Also:
        Marshaller.setNamespaceMapping(String, String)
      • setEntityResolver

        public void setEntityResolver​(EntityResolver entityResolver)
        Deprecated.
        Set the EntityResolver to be used during unmarshalling. This resolver will used to resolve system and public ids.
        See Also:
        Unmarshaller.setEntityResolver(EntityResolver)
      • setClassDescriptorResolver

        public void setClassDescriptorResolver​(org.exolab.castor.xml.XMLClassDescriptorResolver classDescriptorResolver)
        Deprecated.
        Set the XMLClassDescriptorResolver to be used during unmarshalling. This resolver will used to resolve class descriptors.
        See Also:
        Unmarshaller.setResolver(XMLClassDescriptorResolver)
      • setIdResolver

        public void setIdResolver​(org.exolab.castor.xml.IDResolver idResolver)
        Deprecated.
        Set the Castor IDResolver to be used during unmarshalling.
        See Also:
        Unmarshaller.setIDResolver(IDResolver)
      • setObjectFactory

        public void setObjectFactory​(org.exolab.castor.util.ObjectFactory objectFactory)
        Deprecated.
        Set the Castor ObjectFactory to be used during unmarshalling.
        See Also:
        Unmarshaller.setObjectFactory(ObjectFactory)
      • createXMLContext

        protected org.exolab.castor.xml.XMLContext createXMLContext​(Resource[] mappingLocations,
                                                                    Class<?>[] targetClasses,
                                                                    String[] targetPackages)
                                                             throws org.exolab.castor.mapping.MappingException,
                                                                    org.exolab.castor.xml.ResolverException,
                                                                    IOException
        Deprecated.
        Create the Castor XMLContext. Subclasses can override this to create a custom context.

        The default implementation loads mapping files if defined, or the target class or packages if defined.

        Returns:
        the created resolver
        Throws:
        org.exolab.castor.mapping.MappingException - when the mapping file cannot be loaded
        IOException - in case of I/O errors
        org.exolab.castor.xml.ResolverException
        See Also:
        XMLContext.addMapping(org.exolab.castor.mapping.Mapping), XMLContext.addClass(Class)
      • supports

        public boolean supports​(Class<?> clazz)
        Deprecated.
        Returns true for all classes, i.e. Castor supports arbitrary classes.
        Specified by:
        supports in interface Marshaller
        Specified by:
        supports in interface Unmarshaller
        Parameters:
        clazz - the class that this marshaller is being asked if it can marshal
        Returns:
        true if this marshaller can indeed marshal instances of the supplied class; false otherwise
      • customizeMarshaller

        protected void customizeMarshaller​(org.exolab.castor.xml.Marshaller marshaller)
        Deprecated.
        Template method that allows for customizing of the given Castor Marshaller.
      • customizeUnmarshaller

        protected void customizeUnmarshaller​(org.exolab.castor.xml.Unmarshaller unmarshaller)
        Deprecated.
        Template method that allows for customizing of the given Castor Unmarshaller.
      • convertCastorException

        protected XmlMappingException convertCastorException​(org.exolab.castor.xml.XMLException ex,
                                                             boolean marshalling)
        Deprecated.
        Convert the given XMLException to an appropriate exception from the org.springframework.oxm hierarchy.

        A boolean flag is used to indicate whether this exception occurs during marshalling or unmarshalling, since Castor itself does not make this distinction in its exception hierarchy.

        Parameters:
        ex - Castor XMLException that occurred
        marshalling - indicates whether the exception occurs during marshalling (true), or unmarshalling (false)
        Returns:
        the corresponding XmlMappingException