Android Open Source - PasswordDroid Get Bundle Visitor






From Project

Back to project page PasswordDroid.

License

The source code is released under:

GNU General Public License

If you think the Android project PasswordDroid listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package de.wuthoehle.passworddroid.service.model.entries;
//  w  w w . j  a va  2  s .  c  o  m
/* Copyright (c) 2015 Marco Huenseler <marcoh.huenseler+git@gmail.com>
 * This Source Code Form is subject to the terms of the Mozilla Public
 * License, v. 2.0. If a copy of the MPL was not distributed with this
 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */

import android.os.Bundle;

public class GetBundleVisitor implements EntryVisitor {
    public static final String ID_SERVICE_NAME = "Entry.SERVICE_NAME";
    public static final String ID_SERVICE_USER = "Entry.SERVICE_USER";
    public static final String ID_COUNTER = "DerivatorEntry.COUNTER";
    public static final String ID_PW_MASK = "DerivatorEntry.PW_MASK";
    public static final String ID_PW_ADD_CHARACTERS = "DerivatorEntry.PW_ADD_CHARACTERS";
    public static final String ID_PW_ALL_CHARACTERS = "DerivatorEntry.PW_ALL_CHARACTERS";
    public static final String ID_PW_LENGTH = "DerivatorEntry.PW_LENGTH";
    public static final String ID_COMMENT = "DerivatorEntry.COMMENT";
    public static final String ID_SALTS = "DerivatorEntry.SALTS";

    private Bundle result;

    public GetBundleVisitor() {
        result = new Bundle();
    }

    public Bundle getBundle() {
        return result;
    }

    @Override
    public void visit(Countable countable) {
        result.putInt(ID_COUNTER, countable.getCounter());
    }

    @Override
    public void visit(Customizable customizable) {
        result.putByte(ID_PW_MASK, customizable.getMask());
        result.putString(ID_PW_ADD_CHARACTERS, customizable.getAdditionalCharacters());
        result.putInt(ID_PW_LENGTH, customizable.getLength());
        result.putString(ID_PW_ALL_CHARACTERS, customizable.getCharacters());
    }

    @Override
    public void visit(Commentable commentable) {
        result.putString(ID_COMMENT, commentable.getComment());
    }

    @Override
    public void visit(Saltable saltable) {
        result.putStringArrayList(ID_SALTS, saltable);
    }

    @Override
    public void visit(Entry entry) {
        result.putString(ID_SERVICE_NAME, entry.getName());
        result.putString(ID_SERVICE_USER, entry.getUser());
    }

}




Java Source Code List

com.lambdaworks.crypto.PBKDF.java
com.lambdaworks.crypto.SCrypt.java
de.wuthoehle.passworddroid.ApplicationTest.java
de.wuthoehle.passworddroid.PasswordDerivateActivity.java
de.wuthoehle.passworddroid.crypto.AESprng.java
de.wuthoehle.passworddroid.crypto.DerivationRunnableFactory.java
de.wuthoehle.passworddroid.crypto.Util.java
de.wuthoehle.passworddroid.crypto.SCryptParameters.SCryptParametersFactory.java
de.wuthoehle.passworddroid.crypto.SCryptParameters.SCryptParameters.java
de.wuthoehle.passworddroid.service.PasswordDroidService.java
de.wuthoehle.passworddroid.service.model.Category.java
de.wuthoehle.passworddroid.service.model.Container.java
de.wuthoehle.passworddroid.service.model.Database.java
de.wuthoehle.passworddroid.service.model.DerivatorCategory.java
de.wuthoehle.passworddroid.service.model.DerivatorDatabase.java
de.wuthoehle.passworddroid.service.model.FileFormat.java
de.wuthoehle.passworddroid.service.model.entries.Commentable.java
de.wuthoehle.passworddroid.service.model.entries.Countable.java
de.wuthoehle.passworddroid.service.model.entries.Customizable.java
de.wuthoehle.passworddroid.service.model.entries.DerivatorEntry.java
de.wuthoehle.passworddroid.service.model.entries.EntryElement.java
de.wuthoehle.passworddroid.service.model.entries.EntryFactory.java
de.wuthoehle.passworddroid.service.model.entries.EntryVisitor.java
de.wuthoehle.passworddroid.service.model.entries.Entry.java
de.wuthoehle.passworddroid.service.model.entries.GetBundleVisitor.java
de.wuthoehle.passworddroid.service.model.entries.SaltVisitor.java
de.wuthoehle.passworddroid.service.model.entries.Saltable.java
de.wuthoehle.passworddroid.service.model.entries.WriteVisitor.java