Search in sources :

Example 1 with ScopeType

use of jodd.madvoc.ScopeType in project jodd by oblac.

the class ScopeDataResolver method inspectOut.

/**
	 * Inspects single INOUT annotation as OUT.
	 * @see #inspectOut(jodd.madvoc.meta.Out, jodd.madvoc.ScopeType, String, Class)
	 */
protected ScopeData.Out inspectOut(InOut inOut, ScopeType scopeType, String propertyName, Class propertyType) {
    if (inOut == null) {
        return null;
    }
    ScopeType scope = inOut.scope();
    if (scope != scopeType) {
        return null;
    }
    ScopeData.Out oi = new ScopeData.Out();
    saveNameTarget(oi, inOut.value(), propertyName);
    oi.type = propertyType;
    return oi;
}
Also used : ScopeType(jodd.madvoc.ScopeType) ScopeData(jodd.madvoc.ScopeData) Out(jodd.madvoc.meta.Out) InOut(jodd.madvoc.meta.InOut)

Example 2 with ScopeType

use of jodd.madvoc.ScopeType in project jodd by oblac.

the class ScopeDataResolver method resolveScopeData.

/**
	 * Resolve scope data in given type for all scope types.
	 * Returns <code>null</code> if no scope data exist.
	 */
public ScopeData[] resolveScopeData(Class type) {
    final ScopeType[] allScopeTypes = ScopeType.values();
    ScopeData[] scopeData = new ScopeData[allScopeTypes.length];
    int count = 0;
    for (ScopeType scopeType : allScopeTypes) {
        ScopeData sd = inspectClassScopeData(type, scopeType);
        if (sd != null) {
            count++;
        }
        scopeData[scopeType.value()] = sd;
    }
    if (count == 0) {
        return null;
    }
    return scopeData;
}
Also used : ScopeType(jodd.madvoc.ScopeType) ScopeData(jodd.madvoc.ScopeData)

Example 3 with ScopeType

use of jodd.madvoc.ScopeType in project jodd by oblac.

the class ScopeDataResolver method inspectIn.

/**
	 * Inspects single INOUT annotation as IN.
	 * @see #inspectIn(jodd.madvoc.meta.In, jodd.madvoc.ScopeType, String, Class)
	 */
protected ScopeData.In inspectIn(InOut inOut, ScopeType scopeType, String propertyName, Class propertyType) {
    if (inOut == null) {
        return null;
    }
    ScopeType scope = inOut.scope();
    if (scope != scopeType) {
        return null;
    }
    ScopeData.In ii = new ScopeData.In();
    saveNameTarget(ii, inOut.value(), propertyName);
    ii.type = propertyType;
    return ii;
}
Also used : ScopeType(jodd.madvoc.ScopeType) In(jodd.madvoc.meta.In) ScopeData(jodd.madvoc.ScopeData)

Example 4 with ScopeType

use of jodd.madvoc.ScopeType in project jodd by oblac.

the class ScopeDataResolver method inspectOut.

/**
	 * Inspects single OUT annotation for a property.
	 */
protected ScopeData.Out inspectOut(Out out, ScopeType scopeType, String propertyName, Class propertyType) {
    if (out == null) {
        return null;
    }
    ScopeType scope = out.scope();
    if (scope != scopeType) {
        return null;
    }
    ScopeData.Out oi = new ScopeData.Out();
    saveNameTarget(oi, out.value(), propertyName);
    oi.type = propertyType;
    return oi;
}
Also used : ScopeType(jodd.madvoc.ScopeType) ScopeData(jodd.madvoc.ScopeData) Out(jodd.madvoc.meta.Out) InOut(jodd.madvoc.meta.InOut)

Example 5 with ScopeType

use of jodd.madvoc.ScopeType in project jodd by oblac.

the class ScopeDataResolver method resolveScopeData.

/**
	 * Resolves scope data in given annotations for all scope types.
	 * Returns <code>null</code> if no scope data exist.
	 */
public ScopeData[] resolveScopeData(String name, Class type, Annotation[] annotations) {
    final ScopeType[] allScopeTypes = ScopeType.values();
    ScopeData[] scopeData = new ScopeData[allScopeTypes.length];
    int count = 0;
    for (ScopeType scopeType : allScopeTypes) {
        ScopeData sd = inspectMethodParameterScopeData(name, type, annotations, scopeType);
        if (sd != null) {
            count++;
        }
        scopeData[scopeType.value()] = sd;
    }
    if (count == 0) {
        return null;
    }
    return scopeData;
}
Also used : ScopeType(jodd.madvoc.ScopeType) ScopeData(jodd.madvoc.ScopeData)

Aggregations

ScopeData (jodd.madvoc.ScopeData)6 ScopeType (jodd.madvoc.ScopeType)6 In (jodd.madvoc.meta.In)2 InOut (jodd.madvoc.meta.InOut)2 Out (jodd.madvoc.meta.Out)2