Class BaseFactory
java.lang.Object
org.exolab.castor.builder.factory.BaseFactory
- Direct Known Subclasses:
EnumerationFactory,MemberFactory,SourceFactory
This class defines a base type for the source generator code factory classes.
- Version:
- $Revision: 6287 $ $Date: $
- Author:
- Werner Guttmann
-
Constructor Summary
ConstructorsConstructorDescriptionBaseFactory(BuilderConfiguration config, FieldInfoFactory infoFactory, GroupNaming groupNaming, SourceGenerator sourceGenerator) Creates an instance of this class. -
Method Summary
Modifier and TypeMethodDescriptionprotected StringcreateComment(Annotated annotated) Creates and returns a Javadoc comment from the given annotations.protected StringextractCommentsFromAnnotations(Annotated annotated) Creates Comments from Schema annotations.protected final BuilderConfigurationGet BuilderConfiguration instance, for callbacks to obtain certain configured properties.final GroupNamingReturns the group naming helper class for naming nested anonymous groups.protected final FieldInfoFactoryGet type factory.final JavaNamingTo get theJavaNamingto be used.protected SourceGeneratorReturns the callingSourceGeneratorinstance.protected final StringNormalizes the given string for use in comments.final voidsetGroupNaming(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 configurationinfoFactory- the FieldInfoFactory to usegroupNaming- Group naming scheme to be used.sourceGenerator- The calling source generator.
-
-
Method Details
-
getConfig
Get BuilderConfiguration instance, for callbacks to obtain certain configured properties.- Returns:
- BuilderConfiguration instance.
-
getInfoFactory
Get type factory.- Returns:
- Type factory.
-
normalize
Normalizes the given string for use in comments.- Parameters:
value- the String to normalize- Returns:
- the given string, normalized, for use in comments.
-
getGroupNaming
Returns the group naming helper class for naming nested anonymous groups.- Returns:
- the group naming helper class for naming nested anonymous groups.
-
setGroupNaming
Sets the group naming helper class for naming nested anonymous groups.- Parameters:
groupNaming- the group naming helper class for naming nested anonymous groups.
-
getSourceGenerator
Returns the callingSourceGeneratorinstance.- Returns:
- the calling source generator
-
createComment
Creates and returns a Javadoc comment from the given annotations.- Parameters:
annotated- TheAnnotatedinstance holding annotations.- Returns:
- The Javadoc comment created from the annotations.
-
extractCommentsFromAnnotations
Creates Comments from Schema annotations.- Parameters:
annotated- the Annotated structure to process- Returns:
- the generated comment.
-
getJavaNaming
To get theJavaNamingto be used.- Returns:
JavaNaminginstance to be used- Since:
- 1.1.3
-