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.GlobalStandardConversion
          Global <jaxb:javaType>.
(package private) static class BIGlobalBinding.GlobalVendorConversion
          Global <xjc:javaType>.
 
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)  Boolean generateElementProperty
           
(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 QName NAME
           
 NameConverter nameConverter
          Gets the name converter that will govern the XML->Java name conversion process for this compilation.
(package private)  String noMarshaller
           
(package private)  String noUnmarshaller
           
(package private)  String noValidatingUnmarshaller
           
(package private)  String noValidator
           
(package private)  OptionalPropertyMode optionalProperty
           
(package private)  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)  String treatRestrictionLikeNewType
          Handles complex type restriction as if it were a new type.
(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(QName typeName)
          Checks if the given XML Schema built-in type can be mapped to a type-safe enum class.
 boolean canBeMappedToTypeSafeEnum(String nsUri, String localName)
           
 boolean canBeMappedToTypeSafeEnum(XSDeclaration decl)
           
 void dispatchGlobalConversions(XSSchemaSet schema)
          Moves global BIConversion to the right object.
 void errorCheck()
          Performs error check
 ImplStructureStrategy getCodeGenerationStrategy()
           
 int getDefaultEnumMemberSizeCap()
           
 BIProperty getDefaultProperty()
           
 EnumMemberMode getEnumMemberMode()
           
 LocalScoping getFlattenClasses()
           
 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 isRestrictionFreshType()
           
 boolean isSimpleMode()
           
 boolean isSimpleTypeSubstitution()
           
 void onSetOwner()
          Called when the parent BindInfo got its owner set.
(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
getBuilder, getChildren, getCodeModel, getLocation, getOwner, isAcknowledged, markAsAcknowledged
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

nameConverter

public 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

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


treatRestrictionLikeNewType

String treatRestrictionLikeNewType
Handles complex type restriction as if it were a new type.


generateElementClass

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


generateElementProperty

Boolean generateElementProperty

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

String noMarshaller

noUnmarshaller

String noUnmarshaller

noValidator

String noValidator

noValidatingUnmarshaller

String noValidatingUnmarshaller

typeSubstitution

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

NAME

public static final 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()

isRestrictionFreshType

public boolean isRestrictionFreshType()

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)


onSetOwner

public void onSetOwner()
Description copied from interface: BIDeclaration
Called when the parent BindInfo got its owner set. This is when declarations are connected to BGMBuilder and its sibling components.

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

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. This is a good opportunity to do some follow-up initialization after JAXB unmarshalling populated BIDeclaration.

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

dispatchGlobalConversions

public void dispatchGlobalConversions(XSSchemaSet schema)
Moves global BIConversion to the right object.


canBeMappedToTypeSafeEnum

public boolean canBeMappedToTypeSafeEnum(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(String nsUri,
                                         String localName)

canBeMappedToTypeSafeEnum

public boolean canBeMappedToTypeSafeEnum(XSDeclaration decl)

getName

public 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.