com.sun.tools.xjc.reader.xmlschema.bindinfo
Class BIGlobalBinding

java.lang.Object
  extended by com.sun.tools.xjc.reader.xmlschema.bindinfo.AbstractDeclarationImpl
      extended by com.sun.tools.xjc.reader.xmlschema.bindinfo.BIGlobalBinding
All Implemented Interfaces:
BIDeclaration

public final class BIGlobalBinding
extends AbstractDeclarationImpl

Global binding customization. The code is highly temporary.

One of the information contained in a global customization is the default binding for properties. This object contains a BIProperty object to keep this information.


Nested Class Summary
(package private) static class BIGlobalBinding.ClassNameAdapter
           
(package private) static class BIGlobalBinding.ClassNameBean
          Used to unmarshal <[element] name="className" />
(package private) static class BIGlobalBinding.GlobalConversion
           
 
Field Summary
(package private)  boolean choiceContentProperty
           
(package private)  ImplStructureStrategy codeGenerationStrategy
          The code generation strategy.
(package private)  int defaultEnumMemberSizeCap
          Default cap to the number of constants in the enum.
(package private)  LocalScoping flattenClasses
          If true, interfaces/classes that are normally generated as a nested interface/class will be generated into the package, allowing the generated classes to be flat.
(package private)  boolean generateElementClass
          True to generate a class for elements by default.
(package private)  EnumMemberMode generateEnumMemberName
          Returns true if the compiler needs to generate type-safe enum member names when enumeration values cannot be used as constant names.
(package private)  boolean isJavaNamingConventionEnabled
          Returns true if the "isJavaNamingConventionEnabled" option is turned on.
static javax.xml.namespace.QName NAME
           
 com.sun.xml.bind.api.impl.NameConverter nameConverter
          Gets the name converter that will govern the XML->Java name conversion process for this compilation.
(package private)  java.lang.String noMarshaller
           
(package private)  java.lang.String noUnmarshaller
           
(package private)  java.lang.String noValidatingUnmarshaller
           
(package private)  java.lang.String noValidator
           
(package private)  OptionalPropertyMode optionalProperty
           
(package private)  java.lang.String simpleMode
          Generate the simpler optimized code, but not necessarily conforming to the spec.
(package private)  boolean simpleTypeSubstitution
          True to generate classes for every simple type.
(package private)  BIGlobalBinding.ClassNameBean superClass
          If <xjc:superClass> extension is specified, returns the specified root class.
(package private)  BIGlobalBinding.ClassNameBean superInterface
          If <xjc:superInterface> extension is specified, returns the specified root class.
(package private)  com.sun.tools.xjc.reader.xmlschema.bindinfo.BIGlobalBinding.TypeSubstitutionElement typeSubstitution
           
 
Fields inherited from class com.sun.tools.xjc.reader.xmlschema.bindinfo.AbstractDeclarationImpl
loc, parent
 
Constructor Summary
BIGlobalBinding()
          Creates a bind info object with the default values
 
Method Summary
 boolean canBeMappedToTypeSafeEnum(javax.xml.namespace.QName typeName)
          Checks if the given XML Schema built-in type can be mapped to a type-safe enum class.
 boolean canBeMappedToTypeSafeEnum(java.lang.String nsUri, java.lang.String localName)
           
 boolean canBeMappedToTypeSafeEnum(com.sun.xml.xsom.XSDeclaration decl)
           
 void dispatchGlobalConversions(com.sun.xml.xsom.XSSchemaSet schema)
          Moves global BIConversion to the right object.
 void errorCheck()
          Performs error check
 ImplStructureStrategy getCodeGenerationStrategy()
           
 int getDefaultEnumMemberSizeCap()
           
 BIProperty getDefaultProperty()
           
 EnumMemberMode getEnumMemberMode()
           
 LocalScoping getFlattenClasses()
           
 javax.xml.namespace.QName getName()
          Gets the name of this binding declaration, which is the same as the tag name of the binding element.
 BISerializable getSerializable()
           
 com.sun.codemodel.JDefinedClass getSuperClass()
           
 com.sun.codemodel.JDefinedClass getSuperInterface()
           
(package private)  com.sun.tools.xjc.reader.xmlschema.bindinfo.BIGlobalBinding.UnderscoreBinding getUnderscoreBinding()
           
 boolean isChoiceContentPropertyEnabled()
           
 boolean isGenerateElementClass()
           
 boolean isJavaNamingConventionEnabled()
           
 boolean isSimpleMode()
           
 boolean isSimpleTypeSubstitution()
           
(package private)  void setGenerateIsSetMethod(boolean b)
           
 void setParent(BindInfo parent)
          Sets the parent BindInfo object of this declaration.
(package private)  void setUnderscoreBinding(com.sun.tools.xjc.reader.xmlschema.bindinfo.BIGlobalBinding.UnderscoreBinding ub)
           
(package private)  void setXjcSerializable(BISerializable s)
          Another 1.0 compatibility customization (but we accept it and treat it as serializable)
 
Methods inherited from class com.sun.tools.xjc.reader.xmlschema.bindinfo.AbstractDeclarationImpl
_assert, getBuilder, getCodeModel, getLocation, getOwner, isAcknowledged, markAsAcknowledged, onSetOwner
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nameConverter

public com.sun.xml.bind.api.impl.NameConverter nameConverter
Gets the name converter that will govern the XML->Java name conversion process for this compilation.

The "underscoreBinding" customization will determine the exact object returned from this method. The rest of XJC should just use the NameConverter interface.

Always non-null.


isJavaNamingConventionEnabled

boolean isJavaNamingConventionEnabled
Returns true if the "isJavaNamingConventionEnabled" option is turned on. In this mode, the compiler is expected to apply XML-to-Java name conversion algorithm even to names given by customizations. This method is intended to be called by other BIXXX classes. The effect of this switch should be hidden inside this package. IOW, the reader.xmlschema package shouldn't be aware of this switch.


simpleTypeSubstitution

boolean simpleTypeSubstitution
True to generate classes for every simple type.


generateEnumMemberName

EnumMemberMode generateEnumMemberName
Returns true if the compiler needs to generate type-safe enum member names when enumeration values cannot be used as constant names.


codeGenerationStrategy

ImplStructureStrategy codeGenerationStrategy
The code generation strategy.


superClass

BIGlobalBinding.ClassNameBean superClass
If <xjc:superClass> extension is specified, returns the specified root class. Otherwise null.


superInterface

BIGlobalBinding.ClassNameBean superInterface
If <xjc:superInterface> extension is specified, returns the specified root class. Otherwise null.


simpleMode

java.lang.String simpleMode
Generate the simpler optimized code, but not necessarily conforming to the spec.


generateElementClass

boolean generateElementClass
True to generate a class for elements by default.


choiceContentProperty

boolean choiceContentProperty

optionalProperty

OptionalPropertyMode optionalProperty

defaultEnumMemberSizeCap

int defaultEnumMemberSizeCap
Default cap to the number of constants in the enum. We won't attempt to produce a type-safe enum by default if there are more enumeration facets than specified in this field.


flattenClasses

LocalScoping flattenClasses
If true, interfaces/classes that are normally generated as a nested interface/class will be generated into the package, allowing the generated classes to be flat. See Bug 4969415 for the motivation.


noMarshaller

java.lang.String noMarshaller

noUnmarshaller

java.lang.String noUnmarshaller

noValidator

java.lang.String noValidator

noValidatingUnmarshaller

java.lang.String noValidatingUnmarshaller

typeSubstitution

com.sun.tools.xjc.reader.xmlschema.bindinfo.BIGlobalBinding.TypeSubstitutionElement typeSubstitution

NAME

public static final javax.xml.namespace.QName NAME
Constructor Detail

BIGlobalBinding

public BIGlobalBinding()
Creates a bind info object with the default values

Method Detail

setUnderscoreBinding

void setUnderscoreBinding(com.sun.tools.xjc.reader.xmlschema.bindinfo.BIGlobalBinding.UnderscoreBinding ub)

getUnderscoreBinding

com.sun.tools.xjc.reader.xmlschema.bindinfo.BIGlobalBinding.UnderscoreBinding getUnderscoreBinding()

getSuperClass

public com.sun.codemodel.JDefinedClass getSuperClass()

getSuperInterface

public com.sun.codemodel.JDefinedClass getSuperInterface()

getDefaultProperty

public BIProperty getDefaultProperty()

isJavaNamingConventionEnabled

public boolean isJavaNamingConventionEnabled()

getSerializable

public BISerializable getSerializable()

isGenerateElementClass

public boolean isGenerateElementClass()

isChoiceContentPropertyEnabled

public boolean isChoiceContentPropertyEnabled()

getDefaultEnumMemberSizeCap

public int getDefaultEnumMemberSizeCap()

isSimpleMode

public boolean isSimpleMode()

getEnumMemberMode

public EnumMemberMode getEnumMemberMode()

isSimpleTypeSubstitution

public boolean isSimpleTypeSubstitution()

getCodeGenerationStrategy

public ImplStructureStrategy getCodeGenerationStrategy()

getFlattenClasses

public LocalScoping getFlattenClasses()

errorCheck

public void errorCheck()
Performs error check


setGenerateIsSetMethod

void setGenerateIsSetMethod(boolean b)

setXjcSerializable

void setXjcSerializable(BISerializable s)
Another 1.0 compatibility customization (but we accept it and treat it as serializable)


setParent

public void setParent(BindInfo parent)
Description copied from interface: BIDeclaration
Sets the parent BindInfo object of this declaration. A declaration object can use this pointer to access context information, such as other customizations.

This method can be only called from BindInfo, and only once.

Specified by:
setParent in interface BIDeclaration
Overrides:
setParent in class AbstractDeclarationImpl

dispatchGlobalConversions

public void dispatchGlobalConversions(com.sun.xml.xsom.XSSchemaSet schema)
Moves global BIConversion to the right object.


canBeMappedToTypeSafeEnum

public boolean canBeMappedToTypeSafeEnum(javax.xml.namespace.QName typeName)
Checks if the given XML Schema built-in type can be mapped to a type-safe enum class.

Parameters:
typeName -

canBeMappedToTypeSafeEnum

public boolean canBeMappedToTypeSafeEnum(java.lang.String nsUri,
                                         java.lang.String localName)

canBeMappedToTypeSafeEnum

public boolean canBeMappedToTypeSafeEnum(com.sun.xml.xsom.XSDeclaration decl)

getName

public javax.xml.namespace.QName getName()
Description copied from interface: BIDeclaration
Gets the name of this binding declaration, which is the same as the tag name of the binding element.