Package org.mule.metadata.message.api.el
Interface ExpressionLanguageMetadataTypeResolver
-
public interface ExpressionLanguageMetadataTypeResolverResolves the metadata for a specific expression language.
-
-
Nested Class Summary
Nested Classes Modifier and Type Interface Description static interfaceExpressionLanguageMetadataTypeResolver.MessageCallbackCallback from the resolverstatic classExpressionLanguageMetadataTypeResolver.MessageLocationRepresents a message locationstatic classExpressionLanguageMetadataTypeResolver.MessagePositionA position with the line , column and offset in a document
-
Method Summary
All Methods Static Methods Instance Methods Abstract Methods Modifier and Type Method Description voidgetInputType(String expression, MetadataType output, MuleEventMetadataTypeBuilder builder, ExpressionLanguageMetadataTypeResolver.MessageCallback callback)Infers the expected input mule event typeMuleEventMetadataTypefor specified output type with the given script.static ExpressionLanguageMetadataTypeResolvergetInstance()Returns the default instance for this Type Resolverstatic ExpressionLanguageMetadataTypeResolvergetInstance(ClassLoader loader)MetadataTypegetMetadataFromSample(InputStream sample, Map<String,Object> readerProperties, String mimeType)Infers the metadata out of a sample dataMetadataTypegetOutputType(TypeBindings typeBindings, String expression, String outputMimeType, ExpressionLanguageMetadataTypeResolver.MessageCallback callback)Returns the result type expression when invoked with the givenTypeBindings.MetadataTypegetOutputType(TypeBindings typeBindings, String expression, ExpressionLanguageMetadataTypeResolver.MessageCallback callback)Returns the result type expression when invoked with the givenTypeBindings.MetadataTypeintersect(List<MetadataType> metadataTypes)Intersects all the specified types into one type.booleanisAssignable(MetadataType assignment, MetadataType expected, ExpressionLanguageMetadataTypeResolver.MessageCallback callback)Returns if the assignment type can be assigned to the expected typeMap<String,MetadataType>resolveAssignment(MetadataType assignment, MetadataType expected, ExpressionLanguageMetadataTypeResolver.MessageCallback callback)Returns the substitution that needs to be done in order for this two types can be assignedMetadataTypesubstitute(MetadataType assignment, Map<String,MetadataType> substitution)Returns a new type with the substitution being appliedMetadataTypeunify(List<MetadataType> metadataTypes)Unify all the specified types into one type.
-
-
-
Method Detail
-
getInputType
void getInputType(String expression, MetadataType output, MuleEventMetadataTypeBuilder builder, ExpressionLanguageMetadataTypeResolver.MessageCallback callback)
Infers the expected input mule event typeMuleEventMetadataTypefor specified output type with the given script.- Parameters:
expression- The scripting text.output- The expected output typebuilder- The builder to be used to build the event typecallback- The callback
-
getOutputType
MetadataType getOutputType(TypeBindings typeBindings, String expression, ExpressionLanguageMetadataTypeResolver.MessageCallback callback)
Returns the result type expression when invoked with the givenTypeBindings.- Parameters:
typeBindings- The script bindingsexpression- The scripting text.callback- The callback- Returns:
- The return type of the expression.
-
getOutputType
MetadataType getOutputType(TypeBindings typeBindings, String expression, String outputMimeType, ExpressionLanguageMetadataTypeResolver.MessageCallback callback)
Returns the result type expression when invoked with the givenTypeBindings.- Parameters:
typeBindings- The script bindingsexpression- The scripting text.outputMimeType- The output mimeType of the expressioncallback- The callback- Returns:
- The return type of the expression.
-
getMetadataFromSample
MetadataType getMetadataFromSample(InputStream sample, Map<String,Object> readerProperties, String mimeType)
Infers the metadata out of a sample data- Parameters:
sample- The sample data to be usereaderProperties- The configuration properties to read the sample datamimeType- The mimeType of the sample data- Returns:
- The infered MetadataType
-
isAssignable
boolean isAssignable(MetadataType assignment, MetadataType expected, ExpressionLanguageMetadataTypeResolver.MessageCallback callback)
Returns if the assignment type can be assigned to the expected type- Parameters:
assignment- The type to be assignedexpected- The expected typecallback- Callback for error messages. All the reasons of why it was not able to assign- Returns:
- True if it can be assign
-
resolveAssignment
Map<String,MetadataType> resolveAssignment(MetadataType assignment, MetadataType expected, ExpressionLanguageMetadataTypeResolver.MessageCallback callback)
Returns the substitution that needs to be done in order for this two types can be assigned- Parameters:
assignment- The assignment typeexpected- The expected typecallback- The callback for errors and warnings- Returns:
- The substitution
-
substitute
MetadataType substitute(MetadataType assignment, Map<String,MetadataType> substitution)
Returns a new type with the substitution being applied- Parameters:
assignment- The type to be substitutedsubstitution- The substitution- Returns:
- The new type
-
unify
MetadataType unify(List<MetadataType> metadataTypes)
Unify all the specified types into one type. It will remove duplications and return a UnionType only if required- Parameters:
metadataTypes- The types to be unified- Returns:
- The new type
-
intersect
MetadataType intersect(List<MetadataType> metadataTypes)
Intersects all the specified types into one type.- Parameters:
metadataTypes- The types to be intersected- Returns:
- The new type
-
getInstance
static ExpressionLanguageMetadataTypeResolver getInstance()
Returns the default instance for this Type Resolver- Returns:
- The default instance
-
getInstance
static ExpressionLanguageMetadataTypeResolver getInstance(ClassLoader loader)
-
-