Oracle Fusion Middleware
Java API Reference for Oracle WebLogic Server
12c (12.1.2)

Part Number E27170-01

weblogic.descriptor.example
Interface ExampleRootBean


public interface ExampleRootBean

Defines an example root descriptor bean. This interface provides an example of each property pattern and describes the characteristics of each in accompanying javadocs.

This bean is identified as the root bean by the presence of a BeanAnnotations.ROOT annotation in the interface javadoc block.


Method Summary
 void addReference(ExampleChildBean bean)
          Adds bean to References (See ExampleRootBean.getReferences())
 ExampleChildBean createChild()
          Creates a new child and adds it to the Children array property.
 ExampleChildBean createNullableChild()
          Creates new instance of NullableChild and returns it.
 void destroyChild(ExampleChildBean childToDestroy)
          Destroys childToDestroy by removing it from the Children array property.
 void destroyNullableChild()
          Destroys existing NullableChild by setting the property to null.
 ExampleChildBean[] getAllChildren()
           
 ExampleChildBean[] getChildren()
          Defines, in conjunction with ExampleRootBean.createChild() and ExampleRootBean.destroyChild(weblogic.descriptor.example.ExampleChildBean) an array property of child beans named Children.
 int getModifiablePrimitive()
          Defines, in conjunction with ExampleRootBean.setModifiablePrimitive(int), a modifiable primitive property named ModifiablePrimitive.
 ExampleChildBean getModifiableRef()
          Defines, in conjunction with ExampleRootBean.setModifiableRef(weblogic.descriptor.example.ExampleChildBean) a nullable child bean property named ModifiableRef.
 ExampleChildBean getNullableChild()
          Defines, in conjunction with ExampleRootBean.createNullableChild() and ExampleRootBean.destroyNullableChild(), a nullable child bean property named NullableChild.
 ExampleChildBean getReadOnlyChild()
          Defines a read-only child property name ReadOnlyChild.
 int getReadOnlyPrimitive()
          Defines a read-only primitive property named ReadOnlyPrimitive.
 ExampleChildBean getReadOnlyRef()
          Defines a read-only bean reference named ReadOnlyRef.
 ExampleChildBean getReferences()
          Defines, in conjunction with ExampleRootBean.addReference(weblogic.descriptor.example.ExampleChildBean) and ExampleRootBean.removeReference(weblogic.descriptor.example.ExampleChildBean), a array of references property named References.
 ExampleChildBean lookupChild(String name)
          Searches the Children array property for the first occurance of a child whose Name property matches the value of name.
 void removeReference(ExampleChildBean bean)
          Removes bean from References (See ExampleRootBean.getReferences()
 void setModifiablePrimitive(int value)
          See ExampleRootBean.getModifiablePrimitive()
 void setModifiableRef(ExampleChildBean bean)
          See ExampleRootBean.getModifiableRef()
 

Method Detail

getReadOnlyPrimitive

int getReadOnlyPrimitive()
Defines a read-only primitive property named ReadOnlyPrimitive.


getModifiablePrimitive

int getModifiablePrimitive()
Defines, in conjunction with ExampleRootBean.setModifiablePrimitive(int), a modifiable primitive property named ModifiablePrimitive.


setModifiablePrimitive

void setModifiablePrimitive(int value)
See ExampleRootBean.getModifiablePrimitive()


getReadOnlyChild

ExampleChildBean getReadOnlyChild()
Defines a read-only child property name ReadOnlyChild. This property will be created automatically when the bean is created and cannot be destroyed. Note that the child bean itself is modifiable.


getNullableChild

ExampleChildBean getNullableChild()
Defines, in conjunction with ExampleRootBean.createNullableChild() and ExampleRootBean.destroyNullableChild(), a nullable child bean property named NullableChild. This property will initially have a null value.

Returns:
existing child or null

createNullableChild

ExampleChildBean createNullableChild()
Creates new instance of NullableChild and returns it. If the property is already non-null, returns the existing instance. Note that a subsequent call to ExampleRootBean.getNullableChild() will return the same instance.

Returns:
new NullableChild or existing one if one already exists.

destroyNullableChild

void destroyNullableChild()
Destroys existing NullableChild by setting the property to null. If the value of the property is already null, this method returns normally. A subsequent call to ExampleRootBean.getNullableChild() will return null.


getChildren

ExampleChildBean[] getChildren()
Defines, in conjunction with ExampleRootBean.createChild() and ExampleRootBean.destroyChild(weblogic.descriptor.example.ExampleChildBean) an array property of child beans named Children.

Note that create and destroy methods use the component name, Child, rather than the array property name. In most cases the component name can be determined automatically (by computing the singular of the array property name). In this case, because Children is an irregular plural, we use an explicit annotation to specify the component name (see PropertyAnnotations.COMPONENT_NAME).


createChild

ExampleChildBean createChild()
Creates a new child and adds it to the Children array property. A subsequent call to ExampleRootBean.getChildren() will return an array that includes the newly created child.

Returns:
new child

destroyChild

void destroyChild(ExampleChildBean childToDestroy)
Destroys childToDestroy by removing it from the Children array property. A subsquent call to ExampleRootBean.getChildren() will return an array that no longer includes childToDestroy. This method is idempotent - if childToDestroy in not in the list, this method will return normally.

Parameters:
childToDestroy -

lookupChild

ExampleChildBean lookupChild(String name)
Searches the Children array property for the first occurance of a child whose Name property matches the value of name. This is an optional method.

Parameters:
name -
Returns:
first occurance of child bean whose Name property is name.

getReadOnlyRef

ExampleChildBean getReadOnlyRef()
Defines a read-only bean reference named ReadOnlyRef. This property is identified as read-only reference rather than a read-only child by the presence of a PropertyAnnotations.REFERENCE annotation.


getModifiableRef

ExampleChildBean getModifiableRef()
Defines, in conjunction with ExampleRootBean.setModifiableRef(weblogic.descriptor.example.ExampleChildBean) a nullable child bean property named ModifiableRef. The initial value of this property is null.

Returns:
existing child or null

setModifiableRef

void setModifiableRef(ExampleChildBean bean)
See ExampleRootBean.getModifiableRef()

Parameters:
bean - - bean or null.

getReferences

ExampleChildBean getReferences()
Defines, in conjunction with ExampleRootBean.addReference(weblogic.descriptor.example.ExampleChildBean) and ExampleRootBean.removeReference(weblogic.descriptor.example.ExampleChildBean), a array of references property named References. The initial value of this property is a zero-length array.

Returns:
array of references

addReference

void addReference(ExampleChildBean bean)
Adds bean to References (See ExampleRootBean.getReferences())

Parameters:
bean - - bean to add.

removeReference

void removeReference(ExampleChildBean bean)
Removes bean from References (See ExampleRootBean.getReferences()

Parameters:
bean - - bean or null.

getAllChildren

ExampleChildBean[] getAllChildren()

Copyright 1996, 2013, Oracle and/or its affiliates. All rights reserved. Oracle is a registered trademark of Oracle Corporation and/or its affiliates. Other names may be trademarks of their respective owners.

Oracle Fusion Middleware
Java API Reference for Oracle WebLogic Server
12c (12.1.2)

Part Number E27170-01