com.bowstreet.generation
Interface BuilderDef


public interface BuilderDef

Class for accessing BuilderDef data A BuilderDef looks like this in XML:

<?xml version="1.0"?>

<BuilderDef id="com.bowstreet.jsp.Button"  xmlns="http://www.bowstreet.com/2001/Schemas" >
    <ReadableName>PageCoolifier</ReadableName>
    <GenHandlerClassName>com.bowstreet.webapp.WebAppGenHandler</GenHandlerClassName>
    <HelpFile>help/jsp/button.html</HelpFile>
    <RequiredFactoryVersion>5.0.0</RequiredFactoryVersion>
    <Description>
        This is the long description of the builder, which is shown in the Designer when you click on it.
    </Description>
    <Domains>
        <Domain>WebApp</domain>
    </Domains>
    <Category>Cool Builders</Category>
    <CreateModifyList>
        <CanModify type="Page">makes pages cooler!</CanModify>
        <CanModify type="Table">hide and show columns</CanModify>
        <CanCreate type="Page">Create a new page that is cooler than any old one</CanCreate>
    </CreateModifyList>
    <CanModifyTester>com.bowstreet.builders.CoolBuilderTester</CanModifyTester>

    <BuilderData>
        <BuilderDataEntry name="BuilderClassName">com.bowstreet.builders.jsp.PageBuilder</BuilderDataEntry>
        <BuilderDataEntry name="BuilderGroupData">
            <!-- builder group data here -->
        </BuilderDataEntry>
    </BuilderData>

    <CoordinatorClassName>com.bowstreet.builders.sample.ImportantBuilderCoordinator</CoordinatorClassName>     <!-- See below -->
    <AddFromPaletteListenerClassName>com.bowstreet.builders.sample.ImportantBuilderCoordinator</AddFromPaletteListenerClassName>     <!-- See below -->
    <LayoutListenerClassName>com.bowstreet.builders.sample.ImportantBuilderCoordinator</LayoutListenerClassName>     <!-- See below -->
    <InputDefinitions>

        <!-- Complete InputDefinition.  All the boolean values show their default state -->
        <InputDefinition name="SomeImportantValue" >
            <Prompt>Important Value</Prompt>
            <HelpText>This is the help text for the Field.<HelpText>
            <Type>String</Type>  <!-- Choices are:  String, Xml, Boolean, Object
                                      which match the types availble via BuilderInputs -->

            <Required>false</Required>
            <Visible>true</Visible>     <!-- See below -->
            <Callable>true</Callable>   <!-- i.e. appears in (generated) Callable Builder class -->
            <ProfileType>Value</ProfileType>  <!-- Choices:  None, Value (default), XmlElements -->

            <Editor JavaClass="com.bowstreet.ide.edittools.ImpValEditorWidget">
                <Argument name="ImpWidgetArg1">argumentValue</Argument>
                <Argument name="ImpWidgetArg2">argumentValue2</Argument>
            </Editor>

            <Group />   <!-- Default is not to belong to a group -->

        </InputDefinition>

        <!-- InputDefinitions can name a base type, as "BuilderDefID.InputName" -->
        <InputDefinition name="PageLocation" base="com.bowstreet.core.Base.PageLocation" />

        <!-- InputDefinitions can name a base type and also override selected values. -->
        <InputDefinition name="ButtonText" base="com.bowstreet.core.Base.RuntimeText" >
            <Prompt>Button Text</Prompt>
            <Group>Advanced</Group>
        </InputDefinition>

    </InputDefinitions>

    <GroupDefinitions>
        <GroupDefinition  id="Extra">
            <Name>Extra fields</Name>
            <Description>This is the "Extra Fields" Group</Description>
            <ShowBorder>true</ShowBorder>
            <IsCollapsible>true</IsCollapsible>
        </GroupDefinition>
        <GroupDefinition  id="Advanced" base="com.bowstreet.core.Base.Advanced" />
    </GroupDefinitions>

    <Editors>
        <Editor name="default" JavaClass="com.bowstreet.ide.editors.DefaultEditor" \>
    </Editors>

</BuilderDef>

The Coordinator is an optional input which represents a class that will be generated at design time when the user is editing a BuilderCall for this BuilderDef. If present, the Designer will create an instance of the class and call it before the user sees the Inputs, and after every change made by the user. The Coordinator will be passed the entire list of BuilderInputDefs, and it will be able to change visibility values, set defaults, even add new BuilderInputDefs, as needed. (Consider the WSDL Call Builder, where we don't even know what the other inputs will be until the user has chosen a Web Service to call.)

The Visibility represents the default state for the BuilderInput, if there is a Coordinator class specified.


Nested Class Summary
static interface BuilderDef.CanModifyTester
           
 
Method Summary
 java.lang.String getAddFromPaletteListenerClassName()
          Get the AddFromPaletteListener class name
 java.lang.String getBuilderDataString(java.lang.String name)
          Get builder data (String value)
 IXml getBuilderDataXml(java.lang.String name)
          Get builder data (XML value)
 java.util.List getCanCreateList()
          Get list of the types of thing this might be able to create
 java.util.List getCanModifyList()
          Get list of the types of thing this might be able to modify
 BuilderDef.CanModifyTester getCanModifyTester()
          Get an instance that will test to see if this can modify the thing pointed to in the GenElement.
 java.util.Collection getCategories()
          Get all the categories to which this Builder belongs.
 java.lang.String getCoordinatorClassName()
          Get the Coordinator class name
 java.lang.String getDeprecationMessage()
          Gets the deprecation message for the builder.
 java.lang.String getDescription()
          Get the long description
 java.util.Iterator getDomainNames()
          Get list of domains (for use in Designer)
 java.lang.String getGenHandlerClassName()
          Get the GenHandler class name
 com.bowstreet.generation.GroupDefinition getGroupDefinition(java.lang.String id)
          Get a single GroupDefinition by id.
 java.util.Map getGroupDefinitons()
          Get the map of GroupDefinitions
 java.lang.String getHelpFile()
          Get the help filename
 java.lang.String getID()
          Get the builder's unique ID
 BuilderInputDefinition getInputDefinition(java.lang.String name)
          Get a single InputDefinition by name.
 java.util.List getInputDefinitons()
          Get the list of InputDefinitions
 java.util.Collection getKeywords()
          Get all the keywords and categories for the BuilderDef
 java.lang.String getName()
          Get the builder name (that appears in builder call list)
 com.bowstreet.generation.PageDefinition getPageDefinition(java.lang.String id)
          Get a single PageDefinition by id.
 java.util.List getPageDefinitons()
          Get the List of PageDefinition objects.
 java.lang.String getRequiredFactoryVersion()
          Get required version
 boolean hasDefaultBuilderInputValues()
          Since default BuilderInput values are rare, and it is expensive to fetch them, this enables us to skip that step for entire builders.
 boolean isDeprecated()
          Gets the deprecation state for the builder.
 

Method Detail

getAddFromPaletteListenerClassName

java.lang.String getAddFromPaletteListenerClassName()
Get the AddFromPaletteListener class name


getBuilderDataString

java.lang.String getBuilderDataString(java.lang.String name)
Get builder data (String value)


getBuilderDataXml

IXml getBuilderDataXml(java.lang.String name)
Get builder data (XML value)


getCanCreateList

java.util.List getCanCreateList()
Get list of the types of thing this might be able to create


getCanModifyList

java.util.List getCanModifyList()
Get list of the types of thing this might be able to modify

Returns:
List

getCanModifyTester

BuilderDef.CanModifyTester getCanModifyTester()
Get an instance that will test to see if this can modify the thing pointed to in the GenElement. It will often return null;

Returns:
An object used to test, or null.

getCategories

java.util.Collection getCategories()
Get all the categories to which this Builder belongs.

Returns:
List

getCoordinatorClassName

java.lang.String getCoordinatorClassName()
Get the Coordinator class name


getDeprecationMessage

java.lang.String getDeprecationMessage()
Gets the deprecation message for the builder.

Returns:
the deprecation message for the builder

getDescription

java.lang.String getDescription()
Get the long description


getDomainNames

java.util.Iterator getDomainNames()
Get list of domains (for use in Designer)


getGenHandlerClassName

java.lang.String getGenHandlerClassName()
Get the GenHandler class name


getGroupDefinition

com.bowstreet.generation.GroupDefinition getGroupDefinition(java.lang.String id)
Get a single GroupDefinition by id.

Parameters:
id - The id of the GroupDefinition
Returns:
GroupDefinition

getGroupDefinitons

java.util.Map getGroupDefinitons()
Get the map of GroupDefinitions

Returns:
Map of GroupDefinitions, key by their ID

getHelpFile

java.lang.String getHelpFile()
Get the help filename


getID

java.lang.String getID()
Get the builder's unique ID


getInputDefinition

BuilderInputDefinition getInputDefinition(java.lang.String name)
Get a single InputDefinition by name.

Parameters:
name - The name (id) of the InputDefinition
Returns:
BuilderInputDefinition

getInputDefinitons

java.util.List getInputDefinitons()
Get the list of InputDefinitions


getKeywords

java.util.Collection getKeywords()
Get all the keywords and categories for the BuilderDef

Returns:
List

getName

java.lang.String getName()
Get the builder name (that appears in builder call list)


getPageDefinition

com.bowstreet.generation.PageDefinition getPageDefinition(java.lang.String id)
Get a single PageDefinition by id.

Parameters:
id - The id of the PageDefinition
Returns:
PageDefinition

getPageDefinitons

java.util.List getPageDefinitons()
Get the List of PageDefinition objects.

Returns:
List of PageDefinition objects.

getRequiredFactoryVersion

java.lang.String getRequiredFactoryVersion()
Get required version


hasDefaultBuilderInputValues

boolean hasDefaultBuilderInputValues()
Since default BuilderInput values are rare, and it is expensive to fetch them, this enables us to skip that step for entire builders.

Returns:

isDeprecated

boolean isDeprecated()
Gets the deprecation state for the builder.

Returns:
the deprecation state for the builder


Copyright © 2009 IBM. All Rights Reserved.