Skip navigation links


com.bea.p13n.rules.model
Class MethodCallModel

java.lang.Object
  extended by com.bea.p13n.model.Model
      extended by com.bea.p13n.model.XmlObjectModel
          extended by com.bea.p13n.rules.model.ClauseModel
              extended by com.bea.p13n.rules.model.MethodCallModel

All Implemented Interfaces
Serializable, Cloneable
Direct Known Subclasses:
NamedMethodCallModel, NewInstanceModel

public abstract class MethodCallModel
extends ClauseModel

A base class for all method call models. This supports method arguments of type:

Subclasses can control the supported method argument types by overridding convertArgToXmlObject(Object) and convertXmlObjectArg(XmlObject) to throw IllegalArgumentException as needed.

See Also
Serialized Form

Nested Class Summary
static class MethodCallModel.PropertyRefArgument
          Represents a method call argument which is the value of a property.
static class MethodCallModel.UnknownArgument
          Representation of an unrecognized method argument.
static class MethodCallModel.VariableArgument
          Represents a variable reference method call argument.

 

Nested classes/interfaces inherited from class com.bea.p13n.model.Model
Model.ChangeEvent, Model.ChangeListener, Model.ChangeSupport, Model.Debug

 

Field Summary
static String LITERAL_NAMESPACE_URI
          The expression-literal namespace uri.

 

Fields inherited from class com.bea.p13n.rules.model.ClauseModel
clauseType

 

Fields inherited from class com.bea.p13n.model.XmlObjectModel
copyRootXmlObject, instanceUri, isComplete

 

Fields inherited from class com.bea.p13n.model.Model
childrenModels, docModel, parentModel, roChildrenModels

 

Constructor Summary
MethodCallModel()
           

 

Method Summary
 void clearCachedData()
          Clear any cached data.
protected  org.apache.xmlbeans.XmlObject convertArgToXmlObject(Object arg)
          Convert a regular object argument to an XmlObject-based argument.
protected  Object convertXmlObjectArg(org.apache.xmlbeans.XmlObject arg)
          Convert an XmlObject-based argument to a regular object argument.
 boolean determineArgumentIsComplete(Object arg)
          Tell if an argument is not complete.
protected  boolean determineIsComplete()
          StaticMethod calls are complete if their methods are all complete.
static PropertyRefModel.PropertySetType findPropertySetType(String typeAlias)
          Find the property set type for the type-alias, which is a short-name or a fully-qualified class.
protected abstract  com.bea.p13n.expression.schema.MethodArgumentList getMethodArgumentListFromXmlObject(boolean create)
          Get the MethodArgumentList from the underlying method call XmlObject
 Object[] getMethodArguments()
          Get the method arguments.
protected  Object[] getMethodArgumentsNoCache()
          Get the method arguments from the XmlObject.
protected abstract  void removeMethodArgumentListFromXmlObject()
          Remove the MethodArgumentList from the underlying XmlObject.
 void setMethodArguments(Object... args)
          Set the method arguments.
protected  void setParent(Model parent)
          Override to listen to changes to our RuleModel's conditions, for determining completeness.
protected  IllegalArgumentException unsupportedObjectArg(Object arg)
          Return an exception for an unsupported object argument.
protected  IllegalArgumentException unsupportedXmlObjectArg(org.apache.xmlbeans.XmlObject arg)
          Return an exception for an unsupported xml object argument.

 

Methods inherited from class com.bea.p13n.rules.model.ClauseModel
addBranch, addLiteral, addMethod, addMethodOrOperator, addOperator, addVariable, addVariableBinding, copy, createNewXmlObject, getClauseType, getContainingRuleModel, getCopyXmlObject, initializeNew, isInActions, isInConditions, isValidTypeAlias, isValidVariableName, makeSafeCopy, setXmlObject, toString

 

Methods inherited from class com.bea.p13n.model.XmlObjectModel
checkElement, childAdded, childRemoved, fixQName, getApplicationInstanceUri, getChild, getDocument, getLocalName, getParent, getQName, getRootXmlObject, isComplete, isNil, preRemove, propertyChanged, removeAllChildren, removeChild, setApplicationInstanceUri, setIsComplete, setIsComplete, setRootXmlObject

 

Methods inherited from class com.bea.p13n.model.Model
addChangeListener, addChild, addChild, clone, doubleEquals, equals, getChildren, getDebug, getDebug, getDocument, getParent, longEquals, removeChangeListener, removeChild, removeChild, removeEmpties, setDocument

 

Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Field Detail

LITERAL_NAMESPACE_URI

public static final String LITERAL_NAMESPACE_URI
The expression-literal namespace uri.
See Also
Constants Summary

Constructor Detail

MethodCallModel

public MethodCallModel()

Method Detail

clearCachedData

public void clearCachedData()
Clear any cached data. Subclasses can override if they have additional cached data.
Specified by:
clearCachedData in class XmlObjectModel

setParent

protected void setParent(Model parent)
Override to listen to changes to our RuleModel's conditions, for determining completeness.
Overrides:
setParent in class XmlObjectModel

determineIsComplete

protected boolean determineIsComplete()
StaticMethod calls are complete if their methods are all complete. Subclasses can override with additional requirements.
Overrides:
determineIsComplete in class XmlObjectModel
See Also
determineArgumentIsComplete(Object)

determineArgumentIsComplete

public boolean determineArgumentIsComplete(Object arg)
Tell if an argument is not complete. Subclasses that handle additional argument classes should override this method appropriately.

getMethodArguments

public Object[] getMethodArguments()
Get the method arguments.
See Also
getMethodArgumentsNoCache()

getMethodArgumentsNoCache

protected Object[] getMethodArgumentsNoCache()
Get the method arguments from the XmlObject. This implementation uses the MethodArgumentList from getMethodArgumentListFromXmlObject(boolean). Subclasses can override as needed.

getMethodArgumentListFromXmlObject

protected abstract com.bea.p13n.expression.schema.MethodArgumentList getMethodArgumentListFromXmlObject(boolean create)
Get the MethodArgumentList from the underlying method call XmlObject
Parameters
create - true to create if not currently set, false to return null if currently set.
Returns
the MethodArgumentList, or null if not set and create==false.

setMethodArguments

public void setMethodArguments(Object... args)
                        throws IllegalArgumentException
Set the method arguments. This implementation uses the MethodArgumentList from getMethodArgumentListFromXmlObject(boolean) and removeMethodArgumentListFromXmlObject() as needed.
Throws
IllegalArgumentException - thrown if one of the arguments is not valid.

removeMethodArgumentListFromXmlObject

protected abstract void removeMethodArgumentListFromXmlObject()
Remove the MethodArgumentList from the underlying XmlObject.

convertXmlObjectArg

protected Object convertXmlObjectArg(org.apache.xmlbeans.XmlObject arg)
                              throws IllegalArgumentException
Convert an XmlObject-based argument to a regular object argument.
Throws
IllegalArgumentException - thrown on an invalid xml object argument.

unsupportedXmlObjectArg

protected IllegalArgumentException unsupportedXmlObjectArg(org.apache.xmlbeans.XmlObject arg)
Return an exception for an unsupported xml object argument. Subclasses can use this when overriding convertXmlObjectArg(XmlObject).

convertArgToXmlObject

protected org.apache.xmlbeans.XmlObject convertArgToXmlObject(Object arg)
                                                       throws IllegalArgumentException
Convert a regular object argument to an XmlObject-based argument.
Throws
IllegalArgumentException - thrown on an invalid object argument.

unsupportedObjectArg

protected IllegalArgumentException unsupportedObjectArg(Object arg)
Return an exception for an unsupported object argument. Subclasses can use this when overriding convertArgToXmlObject(Object).

findPropertySetType

public static PropertyRefModel.PropertySetType findPropertySetType(String typeAlias)
Find the property set type for the type-alias, which is a short-name or a fully-qualified class.

Skip navigation links


Copyright © 2010, Oracle. All rights reserved.