Top Description Fields Constructors Methods
com.sun.tools.xjc.generator.bean

public final Class PackageOutlineImpl

extends Object
implements PackageOutline
Class Inheritance
All Implemented Interfaces
com.sun.tools.xjc.outline.PackageOutline
Imports
com.sun.codemodel.JDefinedClass, .JPackage, com.sun.tools.xjc.generator.annotation.spec.XmlSchemaWriter, com.sun.tools.xjc.model.CAttributePropertyInfo, .CClassInfo, .CElement, .CElementPropertyInfo, .CPropertyInfo, .CPropertyVisitor, .CReferencePropertyInfo, .CTypeRef, .CValuePropertyInfo, .Model, com.sun.tools.xjc.outline.Aspect, .PackageOutline, jakarta.xml.bind.annotation.XmlNsForm, .XmlSchema, javax.xml.namespace.QName, java.util.Collections, .LinkedHashMap, .LinkedHashSet, .Map, .Set

PackageOutline enhanced with schema2java specific information.
Author
Kohsuke Kawaguchi ([email protected]), Martin Grebac ([email protected])

Field Summary

Modifier and TypeField and Description
private final Model
private final JPackage
private XmlNsForm
pack-priv final Set<ClassOutlineImpl>
private final Set<ClassOutlineImpl>
private XmlNsForm
private String
private final ObjectFactoryGenerator
private Map<String, Integer>
private Map<String, Integer>

Constructor Summary

AccessConstructor and Description
protected

Method Summary

Modifier and TypeMethod and Description
public JPackage
_package()

Implements com.sun.tools.xjc.outline.PackageOutline._package.

The exposed package this context is representing.

public void
calcDefaultValues()

Compute the most common namespace URI in this package (to put into XmlSchema#namespace() and what value we should put into XmlSchema#elementFormDefault().

private void
countURI(Map<String, Integer> map, QName qname)

pull the uri out of the specified QName and keep track of it in the specified hash map

public XmlNsForm
getAttributeFormDefault()

Implements com.sun.tools.xjc.outline.PackageOutline.getAttributeFormDefault.

The attribute form default for this package.

public Set<ClassOutlineImpl>
public XmlNsForm
getElementFormDefault()

Implements com.sun.tools.xjc.outline.PackageOutline.getElementFormDefault.

The element form default for this package.

private XmlNsForm
getFormDefault()

Calculate the element form defaulting.

public String
getMostUsedNamespaceURI()

Implements com.sun.tools.xjc.outline.PackageOutline.getMostUsedNamespaceURI.

The namespace URI most commonly used in classes in this package.

private String
getMostUsedURI(Map<String, Integer> map)

Iterate through the hash map looking for the namespace used most frequently.

public JDefinedClass
objectFactory()

Implements com.sun.tools.xjc.outline.PackageOutline.objectFactory.

Generated ObjectFactory from package.

public ObjectFactoryGenerator
objectFactoryGenerator()

Implements com.sun.tools.xjc.outline.PackageOutline.objectFactoryGenerator.

Generates an ObjectFactory class for this package.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Field Detail

_modelback to summary
private final Model _model
_packageback to summary
private final JPackage _package
attributeFormDefaultback to summary
private XmlNsForm attributeFormDefault
classesback to summary
pack-priv final Set<ClassOutlineImpl> classes
classesViewback to summary
private final Set<ClassOutlineImpl> classesView
elementFormDefaultback to summary
private XmlNsForm elementFormDefault
mostUsedNamespaceURIback to summary
private String mostUsedNamespaceURI
objectFactoryGeneratorback to summary
private final ObjectFactoryGenerator objectFactoryGenerator
propUriCountMapback to summary
private Map<String, Integer> propUriCountMap
uriCountMapback to summary
private Map<String, Integer> uriCountMap

Constructor Detail

PackageOutlineImplback to summary
protected PackageOutlineImpl(BeanGenerator outline, Model model, JPackage _pkg)

Method Detail

_packageback to summary
public JPackage _package()

Implements com.sun.tools.xjc.outline.PackageOutline._package.

Doc from com.sun.tools.xjc.outline.PackageOutline._package.

The exposed package this context is representing.

An exposed package is a package visible to users, a package supposed to be used by client applications. Sometime we have another parallel package that's not visible to users.

Annotations
@Override
calcDefaultValuesback to summary
public void calcDefaultValues()

Compute the most common namespace URI in this package (to put into XmlSchema#namespace() and what value we should put into XmlSchema#elementFormDefault(). This method is called after classes field is filled up.

countURIback to summary
private void countURI(Map<String, Integer> map, QName qname)

pull the uri out of the specified QName and keep track of it in the specified hash map

getAttributeFormDefaultback to summary
public XmlNsForm getAttributeFormDefault()

Implements com.sun.tools.xjc.outline.PackageOutline.getAttributeFormDefault.

The attribute form default for this package.

The value is computed by examining what would yield the smallest generated code.

Annotations
@Override
getClassesback to summary
public Set<ClassOutlineImpl> getClasses()

Implements com.sun.tools.xjc.outline.PackageOutline.getClasses.

Doc from com.sun.tools.xjc.outline.PackageOutline.getClasses.

Gets ClassOutlines whose ClassOutline#_package() points to this object.

Annotations
@Override
getElementFormDefaultback to summary
public XmlNsForm getElementFormDefault()

Implements com.sun.tools.xjc.outline.PackageOutline.getElementFormDefault.

The element form default for this package.

The value is computed by examining what would yield the smallest generated code.

Annotations
@Override
getFormDefaultback to summary
private XmlNsForm getFormDefault()

Calculate the element form defaulting. Compare the most frequently used property URI to the most frequently used element/type URI. If they match, then return QUALIFIED

getMostUsedNamespaceURIback to summary
public String getMostUsedNamespaceURI()

Implements com.sun.tools.xjc.outline.PackageOutline.getMostUsedNamespaceURI.

The namespace URI most commonly used in classes in this package. This should be used as the namespace URI for XmlSchema#namespace().

Null if no default

Annotations
@Override
See Also
calcDefaultValues()
getMostUsedURIback to summary
private String getMostUsedURI(Map<String, Integer> map)

Iterate through the hash map looking for the namespace used most frequently. Ties are arbitrarily broken by the order in which the map keys are iterated over.

Because JAX-WS often reassigns the "" namespace URI, and when that happens it unintentionally also renames (normally unqualified) local elements, prefer non-"" URI when there's a tie.

objectFactoryback to summary
public JDefinedClass objectFactory()

Implements com.sun.tools.xjc.outline.PackageOutline.objectFactory.

Doc from com.sun.tools.xjc.outline.PackageOutline.objectFactory.

Generated ObjectFactory from package. This method allows a caller to obtain a reference to such ObjectFactory from its package. Must not be null.

Annotations
@Override
objectFactoryGeneratorback to summary
public ObjectFactoryGenerator objectFactoryGenerator()

Implements com.sun.tools.xjc.outline.PackageOutline.objectFactoryGenerator.

Doc from com.sun.tools.xjc.outline.PackageOutline.objectFactoryGenerator.

Generates an ObjectFactory class for this package.

Annotations
@Override