org.exolab.castor.builder.factory

Class BaseFactory

Known Direct Subclasses:
EnumerationFactory, MemberFactory, SourceFactory

public class BaseFactory
extends java.lang.Object

This class defines a base type for the source generator code factory classes.
Version:
$Revision: 6287 $ $Date: $
Author:
Werner Guttmann

Constructor Summary

BaseFactory(BuilderConfiguration config, FieldInfoFactory infoFactory, GroupNaming groupNaming, SourceGenerator sourceGenerator)
Creates an instance of this class.

Method Summary

protected String
createComment(Annotated annotated)
Creates and returns a Javadoc comment from the given annotations.
protected String
extractCommentsFromAnnotations(Annotated annotated)
Creates Comments from Schema annotations.
protected BuilderConfiguration
getConfig()
Get BuilderConfiguration instance, for callbacks to obtain certain configured properties.
GroupNaming
getGroupNaming()
Returns the group naming helper class for naming nested anonymous groups.
protected FieldInfoFactory
getInfoFactory()
Get type factory.
JavaNaming
getJavaNaming()
To get the JavaNaming to be used.
protected SourceGenerator
getSourceGenerator()
Returns the calling SourceGenerator instance.
protected String
normalize(String value)
Normalizes the given string for use in comments.
void
setGroupNaming(GroupNaming groupNaming)
Sets the group naming helper class for naming nested anonymous groups.

Constructor Details

BaseFactory

public BaseFactory(BuilderConfiguration config,
                   FieldInfoFactory infoFactory,
                   GroupNaming groupNaming,
                   SourceGenerator sourceGenerator)
Creates an instance of this class.
Parameters:
config - XML code generator configuration
infoFactory - the FieldInfoFactory to use
groupNaming - Group naming scheme to be used.
sourceGenerator - The calling source generator.

Method Details

createComment

protected String createComment(Annotated annotated)
Creates and returns a Javadoc comment from the given annotations.
Parameters:
annotated - The Annotated instance holding annotations.
Returns:
The Javadoc comment created from the annotations.

extractCommentsFromAnnotations

protected String extractCommentsFromAnnotations(Annotated annotated)
Creates Comments from Schema annotations.
Parameters:
annotated - the Annotated structure to process
Returns:
the generated comment.

getConfig

protected final BuilderConfiguration getConfig()
Get BuilderConfiguration instance, for callbacks to obtain certain configured properties.
Returns:
BuilderConfiguration instance.

getGroupNaming

public final GroupNaming getGroupNaming()
Returns the group naming helper class for naming nested anonymous groups.
Returns:
the group naming helper class for naming nested anonymous groups.

getInfoFactory

protected final FieldInfoFactory getInfoFactory()
Get type factory.
Returns:
Type factory.

getJavaNaming

public final JavaNaming getJavaNaming()
To get the JavaNaming to be used.
Returns:
JavaNaming instance to be used
Since:
1.1.3

getSourceGenerator

protected SourceGenerator getSourceGenerator()
Returns the calling SourceGenerator instance.
Returns:
the calling source generator

normalize

protected final String normalize(String value)
Normalizes the given string for use in comments.
Parameters:
value - the String to normalize
Returns:
the given string, normalized, for use in comments.

setGroupNaming

public final void setGroupNaming(GroupNaming groupNaming)
Sets the group naming helper class for naming nested anonymous groups.
Parameters:
groupNaming - the group naming helper class for naming nested anonymous groups.

Intalio Inc. (C) 1999-2008. All rights reserved http://www.intalio.com