Search in sources :

Example 6 with OutputMode

use of sharpen.xobotos.output.OutputMode in project XobotOS by xamarin.

the class SharpenGenerator method processPropertyDeclaration.

@Override
public CSProperty processPropertyDeclaration(CSharpBuilder csharpBuilder, CSTypeDeclaration parent, MethodDeclaration node, String name, CSProperty property, IPropertyBuilderDelegate delegate) {
    final ITypeBuilder type = _typeStack.peek();
    final PropertyTemplate template = type.getTypeTemplate().findPropertyTemplate(node);
    if (template == null)
        return null;
    try {
        _outputProviderStack.push(template);
        final OutputType output = getOutputType();
        final OutputMode mode = output.getModeForMember(node);
        if (mode == OutputMode.NOTHING)
            return null;
        PropertyBuilder builder = new PropertyBuilder(template, output, node);
        type.registerMember(node, builder);
        boolean existing = property != null;
        property = builder.build(csharpBuilder, delegate);
        if (!existing)
            parent.addMember(property);
        return property;
    } finally {
        _outputProviderStack.pop();
    }
}
Also used : OutputMode(sharpen.xobotos.output.OutputMode) OutputType(sharpen.xobotos.output.OutputType)

Example 7 with OutputMode

use of sharpen.xobotos.output.OutputMode in project XobotOS by xamarin.

the class SharpenGenerator method processAnonymousClass.

@Override
public CSAnonymousClass processAnonymousClass(CSharpBuilder csharpBuilder, CSTypeContainer parent, AnonymousClassDeclaration node, IAnonymousClassBuilderDelegate delegate) {
    final TypeTemplate typeTemplate = _typeStack.peek().getTypeTemplate();
    final AnonymousClassTemplate template = typeTemplate.findAnonymousClassTemplate(node);
    if (template == null)
        return null;
    try {
        _outputProviderStack.push(template);
        final OutputType output = getOutputType();
        final OutputMode mode = output.getModeForMember(node);
        if (mode == OutputMode.NOTHING)
            return null;
        AnonymousClassBuilder builder = new AnonymousClassBuilder(template, output, node);
        _typeStack.push(builder);
        CSAnonymousClass type = builder.build(csharpBuilder, delegate);
        if (type != null)
            parent.addType(type.type());
        _typeStack.pop();
        return type;
    } finally {
        _outputProviderStack.pop();
    }
}
Also used : OutputMode(sharpen.xobotos.output.OutputMode) OutputType(sharpen.xobotos.output.OutputType)

Aggregations

OutputMode (sharpen.xobotos.output.OutputMode)7 OutputType (sharpen.xobotos.output.OutputType)7 MethodBinding (sharpen.xobotos.api.bindings.MethodBinding)1 NativeMethodBuilder (sharpen.xobotos.api.interop.NativeMethodBuilder)1