/** * Create an instance of the definition. The instance may be wrapped * in a proxy class. This is a special version of create for * IntrospectionHelper and UnknownElement. * @param project the current project. * @return the created object. */ public Object createObject(Project project) { return parent.create(project); }
/** * Create an object for a component. * * @param componentName the name of the component, if * the component is in a namespace, the * name is prefixed with the namespace uri and ":". * @return the class if found or null if not. */ public Object createComponent(String componentName) { AntTypeDefinition def = getDefinition(componentName); return def == null ? null : def.create(project); }
/** * Create an instance of the definition. * The instance may be wrapped in a proxy class. * @param project the current project * @return the created object */ @Override public Object create(Project project) { Object o = super.create(project); if (o == null) { return null; } ((MacroInstance) o).setMacroDef(macroDef); return o; }
private MethodAndObject createRestricted( final ComponentHelper helper, final String elementName, final List<Method> addTypeMethods) { final Project project = helper.getProject(); final AntTypeDefinition restrictedDefinition = findRestrictedDefinition(helper, elementName, addTypeMethods); if (restrictedDefinition == null) { return null; } final Method addMethod = findMatchingMethod( restrictedDefinition.getExposedClass(project), addTypeMethods); if (addMethod == null) { throw new BuildException("Ant Internal Error - contract mismatch for " + elementName); } final Object addedObject = restrictedDefinition.create(project); if (addedObject == null) { throw new BuildException( "Failed to create object " + elementName + " of type " + restrictedDefinition.getTypeClass(project)); } return new MethodAndObject(addMethod, addedObject); }