Class SharedValueBase

java.lang.Object
org.jibx.custom.classes.CustomBase
org.jibx.custom.classes.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 Details

    • s_allowedAttributes

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

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

      private boolean m_elementForced
      Element representation forced flag.
    • m_statedType

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

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

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

      private 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 Integer m_style
      Style used for representation (null if unspecified and derived from type).
    • m_xmlName

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

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

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

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

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

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

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

    • SharedValueBase

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

      protected SharedValueBase(SharedNestingBase parent, String name)
      Constructor with name known.
      Parameters:
      parent -
      name -
  • Method Details

    • getClassCustom

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

      public 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(String name)
      Set value name as used in code. This is only for use by subclasses.
      Parameters:
      name -
      See Also:
    • getStatedType

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

      public 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 String convertMemberNameCase(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
    • getStyle

      public int getStyle()
      Get style code to apply to value.
      Returns:
      value from NestingBase.s_valueStyleEnum enumeration
    • setStyle

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

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

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

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

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

      public 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 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 String getItemType()
      Get item type.
      Returns:
      item type
    • setItemType

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

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

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

      protected void fillType(IClass info, Boolean req, 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)