Class SharedValueBase

  • Direct Known Subclasses:
    ValueCustom, ValueCustom

    public class SharedValueBase
    extends CustomBase
    Base class for all value customization information. This includes inherited values shared with customization extensions (in particular, the WSDL extensions). TODO: should this include more of the WSDL ValueCustom extensions? Look into how type mappings are handled in the BindGen code (uses bound type in WSDL)
    Author:
    Dennis M. Sosnoski
    • Field Detail

      • s_allowedAttributes

        public static final StringArray s_allowedAttributes
        Enumeration of allowed attribute names
      • m_baseName

        private java.lang.String m_baseName
        Value name as used in code.
      • m_elementForced

        private boolean m_elementForced
        Element representation forced flag.
      • m_statedType

        private java.lang.String m_statedType
        Stated type, as used in code.
      • m_workingType

        private java.lang.String m_workingType
        Type used when working with the value (actual type from customization, if supplied, or stated type).
      • m_itemWorkingType

        private java.lang.String m_itemWorkingType
        Type of item values in collection.
      • m_itemWorkingName

        private java.lang.String m_itemWorkingName
        Name for item elements in collection.
      • m_primitive

        private boolean m_primitive
        Primitive value flag.
      • m_collection

        private boolean m_collection
        Repeated value flag.
      • m_style

        private java.lang.Integer m_style
        Style used for representation (null if unspecified and derived from type).
      • m_xmlName

        private java.lang.String m_xmlName
        Element or attribute name from customization (null if none).
      • m_actualType

        private java.lang.String m_actualType
        'actual-type' attribute value (null if none).
      • m_createType

        private java.lang.String m_createType
        'create-type' attribute value (null if none).
      • m_factoryMethod

        private java.lang.String m_factoryMethod
        'factory' attribute value (null if none).
      • m_required

        private java.lang.Boolean m_required
        'required' attribute value (null if none).
      • m_itemType

        private java.lang.String m_itemType
        'item-type' attribute value (null if none).
      • m_itemName

        private java.lang.String m_itemName
        'item-name' attribute value (null if none).
    • Constructor Detail

      • SharedValueBase

        protected SharedValueBase​(SharedNestingBase parent)
        Constructor.
        Parameters:
        parent -
      • SharedValueBase

        protected SharedValueBase​(SharedNestingBase parent,
                                  java.lang.String name)
        Constructor with name known.
        Parameters:
        parent -
        name -
    • Method Detail

      • getClassCustom

        public ClassCustom getClassCustom()
        Convenience method to access the containing class customization element.
        Returns:
        class customization
      • getBaseName

        public java.lang.String getBaseName()
        Get value name as used in code. This is the actual name with any prefix or suffix stripped and the initial letter converted to lowercase unless the second letter is uppercase.
        Returns:
        name
      • setBaseName

        protected void setBaseName​(java.lang.String name)
        Set value name as used in code. This is only for use by subclasses.
        Parameters:
        name -
        See Also:
        getBaseName()
      • getStatedType

        public java.lang.String getStatedType()
        Get stated type of value, as declared in code.
        Returns:
        stated type
      • getWorkingType

        public java.lang.String getWorkingType()
        Get working type of member. This is the actual type from customization, if supplied, or stated type
        Returns:
        working type
      • convertMemberNameCase

        public static java.lang.String convertMemberNameCase​(java.lang.String name)
        Convert case of member name derived from name used in code. If the supplied name starts with an uppercase letter followed by a lowercase letter, the initial letter is converted to lowercase in order to obtain a standard form of the name.
        Parameters:
        name -
        Returns:
        converted name
      • setStyle

        protected void setStyle​(java.lang.Integer style)
        Set style code to apply to value. This method is only intended for use by subclasses.
        Parameters:
        style -
      • getXmlName

        public java.lang.String getXmlName()
        Get XML element or attribute name from customization.
        Returns:
        name (null if none)
      • setXmlName

        public void setXmlName​(java.lang.String name)
        Set XML element or attribute name from customization. This method is only intended for use by subclasses.
        Parameters:
        name -
      • getActualType

        public java.lang.String getActualType()
        Get 'actual-type' attribute value.
        Returns:
        member actual type (null if none)
      • getCreateType

        public java.lang.String getCreateType()
        Get 'create-type' attribute value.
        Returns:
        type used for creating new instance (null if none)
      • getFactoryMethod

        public java.lang.String getFactoryMethod()
        Get 'factory' attribute value.
        Returns:
        method used for creating new instance (null if none)
      • isRequired

        public boolean isRequired()
        Check if value is required.
        Returns:
        true if required, false if not
      • isElementForced

        public boolean isElementForced()
        Check if element required. This is really only relevant when the value represents a collection of child elements, since it means a wrapper element is needed.
        Returns:
        true if element required, false if not
      • setElementForced

        protected void setElementForced()
        Set element required. This method is only intended for use by subclasses.
      • getStyleText

        private java.lang.String getStyleText()
        Style get text method. This is intended for use during marshalling. TODO: add validation
        Returns:
        text
      • isCollection

        public boolean isCollection()
        Check if collection member.
        Returns:
        true if collection, false if not
      • getItemType

        public java.lang.String getItemType()
        Get item type.
        Returns:
        item type
      • setItemType

        protected void setItemType​(java.lang.String type)
        Set item type. This method is intended only for use by subclasses.
        Parameters:
        type -
      • getItemName

        public java.lang.String getItemName()
        Get item element name.
        Returns:
        item name
      • setItemName

        protected void setItemName​(java.lang.String name)
        Set item name. This method is intended only for use by subclasses.
        Parameters:
        name -
      • fillType

        protected void fillType​(IClass info,
                                java.lang.Boolean req,
                                java.lang.Integer style)
        Complete customization information based on supplied type. If the type information has not previously been set, this will set it. It will also derive the appropriate XML name, if not previously set. This method is only intended for use by subclasses.
        Parameters:
        info - value type information
        req - required member flag (null if unspecified)
        style - representation style (null if unspecified)