Search in sources :

Example 1 with PrincipalMapper

use of com.enonic.xp.lib.common.PrincipalMapper in project xp by enonic.

the class ContextMapper method serializeUser.

private void serializeUser(final MapGenerator gen, final User user) {
    if (user == null) {
        return;
    }
    gen.map("user");
    new PrincipalMapper(user).serialize(gen);
    gen.end();
}
Also used : PrincipalMapper(com.enonic.xp.lib.common.PrincipalMapper)

Example 2 with PrincipalMapper

use of com.enonic.xp.lib.common.PrincipalMapper in project xp by enonic.

the class LoginResultMapper method serializeUser.

private void serializeUser(final MapGenerator gen, final User value) {
    if (value == null) {
        return;
    }
    gen.map("user");
    new PrincipalMapper(value).serialize(gen);
    gen.end();
}
Also used : PrincipalMapper(com.enonic.xp.lib.common.PrincipalMapper)

Example 3 with PrincipalMapper

use of com.enonic.xp.lib.common.PrincipalMapper in project xp by enonic.

the class PrincipalsResultMapper method serialize.

private void serialize(final MapGenerator gen, final Principals principals) {
    gen.array("hits");
    for (final Principal principal : principals) {
        gen.map();
        new PrincipalMapper(principal, detailed).serialize(gen);
        gen.end();
    }
    gen.end();
}
Also used : PrincipalMapper(com.enonic.xp.lib.common.PrincipalMapper) Principal(com.enonic.xp.security.Principal)

Aggregations

PrincipalMapper (com.enonic.xp.lib.common.PrincipalMapper)3 Principal (com.enonic.xp.security.Principal)1