Class WsdlBase

  • Direct Known Subclasses:
    Definitions, OpenAttrBase

    public abstract class WsdlBase
    extends java.lang.Object
    Base class which provides validation hooks and support for extra namespaces. This base class for WSDL element representations is based on the schema data model code.
    Author:
    Dennis M. Sosnoski
    • Field Detail

      • WSDL_NAMESPACE_URI

        public static final java.lang.String WSDL_NAMESPACE_URI
        Fixed URI for WSDL namespace.
        See Also:
        Constant Field Values
      • SOAP_NAMESPACE_URI

        public static final java.lang.String SOAP_NAMESPACE_URI
        Fixed URI for SOAP namespace.
        See Also:
        Constant Field Values
      • m_extension

        private java.lang.Object m_extension
        Extension data for application use.
      • m_namespaces

        private java.util.List m_namespaces
        Namespace definitions associated with this element (lazy create, null if unused).
      • m_documentation

        private java.util.List m_documentation
        Documentation for component (lazy create, null if unused).
    • Constructor Detail

      • WsdlBase

        public WsdlBase()
    • Method Detail

      • getExtension

        public java.lang.Object getExtension()
        Get extension data. The actual type of object used for extension data (if any) is defined by the application.
        Returns:
        extension
      • setExtension

        public void setExtension​(java.lang.Object extension)
        Set extension data. The actual type of object used for extension data (if any) is defined by the application.
        Parameters:
        extension -
      • getNamespaceDeclarations

        public final java.util.List getNamespaceDeclarations()
        Get namespace declarations list. Entries in this list consist of pairs, consisting of namespace prefix followed by namespace URI. The empty string is used as the prefix for the default namespace.
        Returns:
        extra attribute list
      • clearNamespaceDeclarations

        public final void clearNamespaceDeclarations()
        Clear namespace declarations list.
      • addNamespaceDeclaration

        public final void addNamespaceDeclaration​(java.lang.String prefix,
                                                  java.lang.String uri)
        Add namespace declaration.
        Parameters:
        prefix - namespace prefix
        uri - namespace URI
      • getDocumentation

        public java.util.List getDocumentation()
        Get documentation. This is the content of the optional <documentation> child element, which consists of DOM Nodes.
        Returns:
        documentation (null if no documentation present)
      • setDocumentation

        public void setDocumentation​(java.util.List documentation)
        Set documentation. This is the content of the optional <documentation> child element, which consists of DOM Nodes.
        Parameters:
        documentation -
      • preget

        protected void preget​(IMarshallingContext ictx)
                       throws JiBXException
        Pre-get method to be called by data binding while writing element start tag. The base class implementation just writes out any extra namespaces defined on the element. Subclasses which override this implementation must call the base implementation during their processing.
        Parameters:
        ictx - marshalling context
        Throws:
        JiBXException - on marshalling error
      • preset

        protected void preset​(IUnmarshallingContext ictx)
                       throws JiBXException
        Pre-set method to be called by data binding while parsing element start tag. The base class implementation just reads in any extra namespaces defined on the element. Subclasses which override this implementation must call the base implementation during their processing.
        Parameters:
        ictx - unmarshalling context
        Throws:
        JiBXException - on error
      • validateAttributes

        protected void validateAttributes​(IUnmarshallingContext ictx,
                                          boolean other,
                                          StringArray attrs)
        Validate attributes of element. This is designed to be called during unmarshalling as part of the pre-set method processing when a subclass instance is being created. An error is reported if an element in the default namespace is not in the declared list,
        Parameters:
        ictx - unmarshalling context
        other - attributes from other namespaces allowed flag
        attrs - attributes array
        See Also:
        preset(IUnmarshallingContext)
      • readNamespaces

        protected void readNamespaces​(IUnmarshallingContext ictx)
        Collect namespace declarations from element. This is designed to be called during unmarshalling as part of the pre-set method processing when a subclass instance is being created.
        Parameters:
        ictx - unmarshalling context
      • makeUniquePrefix

        private java.lang.String makeUniquePrefix​(java.lang.String pref,
                                                  StringSizedSet prefixes)
        Create a unique prefix. If the requested prefix is already in use, this modifies the prefix by appending a numeric suffix to create a unique variant.
        Parameters:
        pref - requested prefix
        prefixes - prefixes in use
        Returns:
        unique prefix
      • writeNamespaces

        protected void writeNamespaces​(IMarshallingContext ictx)
                                throws JiBXException
        Write namespace declarations to element. This is designed to be called during marshalling as part of the pre-get method processing when a subclass instance is being marshalled.
        Parameters:
        ictx - marshalling context
        Throws:
        JiBXException - on error writing
      • prevalidate

        public void prevalidate​(ValidationContext vctx)
        Prevalidate component information. The prevalidation step is used to check isolated aspects of a component, such as the settings for enumerated values. This empty base class implementation should be overridden by each subclass that requires prevalidation handling.
        Parameters:
        vctx - validation context
      • validate

        public void validate​(ValidationContext vctx)
        Validate component information. The validation step is used for checking the interactions between components, such as name references to other components. The prevalidate(org.jibx.schema.validation.ValidationContext) method will always be called for every component in the schema definition before this method is called for any component. This empty base class implementation should be overridden by each subclass that requires validation handling.
        Parameters:
        vctx - validation context