Java tutorial
// license-header java merge-point // // Generated by: MetafacadeLogicImpl.vsl in andromda-meta-cartridge. package com.googlecode.androidcartridge.metafacades.authentication; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import org.andromda.metafacades.uml.AttributeFacade; import org.andromda.utils.StringUtilsHelper; import org.apache.commons.collections.CollectionUtils; import org.apache.commons.lang.StringUtils; import com.googlecode.androidcartridge.AndroidProfile; /** * * MetafacadeLogic implementation for * org.andromda.cartridges.android.metafacades * .authentication.AuthenticationControllerFacade. * * @see org.andromda.cartridges.android.metafacades.authentication.AuthenticationControllerFacade */ public class AuthenticationControllerFacadeLogicImpl extends AuthenticationControllerFacadeLogic { /** * */ private static final long serialVersionUID = 503544415029435024L; /** * Public constructor for AuthenticationControllerFacadeLogicImpl * * @see org.andromda.cartridges.android.metafacades.authentication.AuthenticationControllerFacade */ public AuthenticationControllerFacadeLogicImpl(final Object metaObject, final String context) { super(metaObject, context); } @Override protected String handleGetAccountDataClass() { return StringUtilsHelper.upperCamelCaseName(getAccountType()); } @Override protected String handleGetAccountType() { String accountType = (String) findTaggedValue(AndroidProfile.VALUE_ANDROID_ACCOUNT_TYPE); if (StringUtils.isBlank(accountType)) { accountType = getFullyQualifiedName(); } return accountType; } @Override protected boolean handleIsAccountDataFullySpecified() { String[] requiredProps = new String[] { "hostName", "port", "webappRoot", "ssl" }; Collection<String> allNames = new ArrayList<String>(); Collection<AttributeFacade> properties = getAllProperties(); for (AttributeFacade property : properties) { allNames.add(property.getName()); } return CollectionUtils.isSubCollection(allNames, Arrays.asList(requiredProps)); } @Override protected boolean handleIsSystemAccount() { String accountStorage = (String) findTaggedValue(AndroidProfile.VALUE_ANDROID_ACCOUNT_STORAGE); boolean result = !("settings".equalsIgnoreCase(accountStorage)); System.out.println("account in settings [" + accountStorage + "]"); return result; } }