List of usage examples for java.lang.reflect Modifier PRIVATE
int PRIVATE
To view the source code for java.lang.reflect Modifier PRIVATE.
Click Source Link
From source file:org.gvnix.flex.ui.FormTemplateTests.java
@Test public void testFormWithTextFieldNoValidations() throws SAXException, IOException { ActionScriptType entityType = new ActionScriptType("com.foo.Person"); StringTemplate listViewTemplate = templateGroup.getInstanceOf("org/gvnix/flex/roo/addon/ui/entity_form"); listViewTemplate.setAttribute("entityType", entityType); listViewTemplate.setAttribute("flexScaffoldMetadata", flexScaffoldMetadata); List<FieldMetadata> elegibleFields = new ArrayList<FieldMetadata>(); FieldMetadata field = new FieldMetadataBuilder("MID:person#1", Modifier.PRIVATE, new JavaSymbolName("name"), JavaType.STRING_OBJECT, null).build(); elegibleFields.add(field);//from ww w. ja v a2 s . c om listViewTemplate.setAttribute("fields", FlexUIMetadataProvider.wrapFields(elegibleFields)); String result = listViewTemplate.toString(); log.debug(result); assertFalse(result.contains("mx:StringValidator")); assertTrue(result.contains("s:TextInput")); ByteArrayInputStream stream = new ByteArrayInputStream(result.getBytes("UTF-8")); XmlUtils.getDocumentBuilder().parse(stream); }
From source file:org.springframework.flex.roo.addon.ui.FormTemplateTests.java
@Test public void testFormWithTextFieldNoValidations() throws SAXException, IOException { ActionScriptType entityType = new ActionScriptType("com.foo.Person"); StringTemplate listViewTemplate = templateGroup .getInstanceOf("org/springframework/flex/roo/addon/ui/entity_form"); listViewTemplate.setAttribute("entityType", entityType); listViewTemplate.setAttribute("flexScaffoldMetadata", flexScaffoldMetadata); List<FieldMetadata> elegibleFields = new ArrayList<FieldMetadata>(); FieldMetadata field = new FieldMetadataBuilder("MID:person#1", Modifier.PRIVATE, new JavaSymbolName("name"), JavaType.STRING_OBJECT, null).build(); elegibleFields.add(field);/* ww w . j a v a 2 s. c o m*/ listViewTemplate.setAttribute("fields", FlexUIMetadataProvider.wrapFields(elegibleFields)); String result = listViewTemplate.toString(); log.debug(result); assertFalse(result.contains("mx:StringValidator")); assertTrue(result.contains("s:TextInput")); ByteArrayInputStream stream = new ByteArrayInputStream(result.getBytes("UTF-8")); XmlUtils.getDocumentBuilder().parse(stream); }
From source file:pl.burningice.plugins.image.ast.AbstractImageContainerTransformation.java
private void transformGeneral(ClassNode node, String fieldName) { log("start transforming: " + node + " with field " + fieldName); // execute transformation for specified container transformSpecified(node, fieldName); // field where image will be bind FieldNode imageBindField = new FieldNode(fieldName, Modifier.PRIVATE, new ClassNode(MultipartFile.class), new ClassNode(node.getClass()), null); node.addField(imageBindField);/*w w w .jav a 2 s . c o m*/ addGetter(imageBindField, node); addSetter(imageBindField, node); addTransientValue(node, fieldName); addImageValidator(node, fieldName); // end for default bind field if (fieldName.equals(DEFAULT_FIELD_NAME)) { return; } // additional fields/methods in case when field name is different than default // we want to have possibility to get binded image addTransientValue(node, DEFAULT_FIELD_NAME); addGetter(DEFAULT_FIELD_NAME, imageBindField, node); }
From source file:com.hihframework.core.utils.ReflectUtil.java
public static final String[] getPrivateMethodsName(Object obj) { return getMethodsName(obj, Modifier.PRIVATE, null); }
From source file:org.tariel.dependrpc.containers.MalttabWord.java
public String getFormattedCategory() { List<String> translations = new ArrayList<String>(); for (Field field : MalttabWord.class.getDeclaredFields()) { if (field.getType() == String.class && field.getModifiers() == Modifier.PRIVATE) { try { if (this.Translations.containsKey((String) field.get(this))) { translations.add(this.Translations.get((String) field.get(this))); }/* w w w .ja va 2s. com*/ } catch (Exception ex) { ex.printStackTrace(); } } } //Some magic! if (translations.contains("VADJ")) { translations.remove("VADJ"); translations.set(translations.indexOf("V"), "VADJ"); } if (translations.contains("VADV")) { translations.remove("VADV"); translations.set(translations.indexOf("V"), "VADV"); } return this.word + "\t" + StringUtils.join(translations, "."); }
From source file:org.gvnix.addon.gva.security.providers.safe.SafeSecurityProviderAuthenticationFilterMetadata.java
public SafeSecurityProviderAuthenticationFilterMetadata(String identifier, JavaType aspectName, PhysicalTypeMetadata governorPhysicalTypeMetadata) { super(identifier, aspectName, governorPhysicalTypeMetadata); // Helper itd generation this.helper = new ItdBuilderHelper(this, governorPhysicalTypeMetadata, builder.getImportRegistrationResolver()); // Adding Fields builder.addField(getField("tokenParameter", "\"j_token\"", JavaType.STRING, Modifier.PRIVATE)); builder.addField(getField("postOnly", "true", JavaType.BOOLEAN_PRIMITIVE, Modifier.PRIVATE)); // Creating getters and setters builder.addMethod(getGetterMethod("tokenParameter", JavaType.STRING)); builder.addMethod(getSetterMethod("tokenParameter", JavaType.STRING)); // Adding necessary methods builder.addMethod(getAttemptAuthentication()); builder.addMethod(getObtainToken()); // Create a representation of the desired output ITD itdTypeDetails = builder.build();// w ww . j av a2s. co m }
From source file:org.gvnix.addon.gva.security.providers.safe.SafeSecurityProviderUserMetadata.java
public SafeSecurityProviderUserMetadata(String identifier, JavaType aspectName, PhysicalTypeMetadata governorPhysicalTypeMetadata) { super(identifier, aspectName, governorPhysicalTypeMetadata); /*Validate.isTrue(isValid(identifier), "Metadata identification string '" + identifier + "' does not appear to be a valid");*/ // Helper itd generation this.helper = new ItdBuilderHelper(this, governorPhysicalTypeMetadata, builder.getImportRegistrationResolver()); // Adding Fields builder.addField(getField("serialVersionUID", "5767016615242591655L", JavaType.LONG_PRIMITIVE, Modifier.PRIVATE + Modifier.STATIC + Modifier.FINAL)); // User Details builder.addField(getField("username", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); builder.addField(getField("password", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); builder.addField(getField("accountNonExpired", null, JAVA_TYPE_BOOLEAN, Modifier.PRIVATE)); builder.addField(getField("accountNonLocked", null, JAVA_TYPE_BOOLEAN, Modifier.PRIVATE)); builder.addField(getField("credentialsNonExpired", null, JAVA_TYPE_BOOLEAN, Modifier.PRIVATE)); builder.addField(getField("enabled", null, JAVA_TYPE_BOOLEAN, Modifier.PRIVATE)); builder.addField(getField("authorities", null, GRANTED_AUTHORITY, Modifier.PRIVATE)); // SAFE USER DATA builder.addField(getField("nombre", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); builder.addField(getField("email", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); builder.addField(getField("apellido1", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); builder.addField(getField("apellido2", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); builder.addField(getField("cif", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); builder.addField(getField("habilitado", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); builder.addField(getField("idHDFI", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); builder.addField(getField("iusserDN", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); builder.addField(getField("nif", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); builder.addField(getField("oid", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); builder.addField(getField("razonSocial", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); builder.addField(getField("representante", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); builder.addField(getField("serialNumber", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); builder.addField(getField("subjectDN", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); builder.addField(getField("tipoAut", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); builder.addField(getField("tipoCertificado", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); // Creating methods builder.addMethod(getGetterMethod("username", JavaType.STRING)); builder.addMethod(getSetterMethod("username", JavaType.STRING)); builder.addMethod(getGetterMethod("password", JavaType.STRING)); builder.addMethod(getSetterMethod("password", JavaType.STRING)); builder.addMethod(getGetterMethod("accountNonExpired", JAVA_TYPE_BOOLEAN)); builder.addMethod(getSetterMethod("accountNonExpired", JAVA_TYPE_BOOLEAN)); builder.addMethod(getGetterMethod("accountNonLocked", JAVA_TYPE_BOOLEAN)); builder.addMethod(getSetterMethod("accountNonLocked", JAVA_TYPE_BOOLEAN)); builder.addMethod(getGetterMethod("credentialsNonExpired", JAVA_TYPE_BOOLEAN)); builder.addMethod(getSetterMethod("credentialsNonExpired", JAVA_TYPE_BOOLEAN)); builder.addMethod(getGetterMethod("enabled", JAVA_TYPE_BOOLEAN)); builder.addMethod(getSetterMethod("enabled", JAVA_TYPE_BOOLEAN)); builder.addMethod(getGetterMethod("authorities", GRANTED_AUTHORITY)); builder.addMethod(getSetterMethod("authorities", GRANTED_AUTHORITY)); builder.addMethod(getGetterMethod("nombre", JavaType.STRING)); builder.addMethod(getSetterMethod("nombre", JavaType.STRING)); builder.addMethod(getGetterMethod("email", JavaType.STRING)); builder.addMethod(getSetterMethod("email", JavaType.STRING)); builder.addMethod(getGetterMethod("apellido1", JavaType.STRING)); builder.addMethod(getSetterMethod("apellido1", JavaType.STRING)); builder.addMethod(getGetterMethod("apellido2", JavaType.STRING)); builder.addMethod(getSetterMethod("apellido2", JavaType.STRING)); builder.addMethod(getGetterMethod("cif", JavaType.STRING)); builder.addMethod(getSetterMethod("cif", JavaType.STRING)); builder.addMethod(getGetterMethod("habilitado", JavaType.STRING)); builder.addMethod(getSetterMethod("habilitado", JavaType.STRING)); builder.addMethod(getGetterMethod("idHDFI", JavaType.STRING)); builder.addMethod(getSetterMethod("idHDFI", JavaType.STRING)); builder.addMethod(getGetterMethod("iusserDN", JavaType.STRING)); builder.addMethod(getSetterMethod("iusserDN", JavaType.STRING)); builder.addMethod(getGetterMethod("nif", JavaType.STRING)); builder.addMethod(getSetterMethod("nif", JavaType.STRING)); builder.addMethod(getGetterMethod("oid", JavaType.STRING)); builder.addMethod(getSetterMethod("oid", JavaType.STRING)); builder.addMethod(getGetterMethod("razonSocial", JavaType.STRING)); builder.addMethod(getSetterMethod("razonSocial", JavaType.STRING)); builder.addMethod(getGetterMethod("representante", JavaType.STRING)); builder.addMethod(getSetterMethod("representante", JavaType.STRING)); builder.addMethod(getGetterMethod("serialNumber", JavaType.STRING)); builder.addMethod(getSetterMethod("serialNumber", JavaType.STRING)); builder.addMethod(getGetterMethod("subjectDN", JavaType.STRING)); builder.addMethod(getSetterMethod("subjectDN", JavaType.STRING)); builder.addMethod(getGetterMethod("tipoAut", JavaType.STRING)); builder.addMethod(getSetterMethod("tipoAut", JavaType.STRING)); builder.addMethod(getGetterMethod("tipoCertificado", JavaType.STRING)); builder.addMethod(getSetterMethod("tipoCertificado", JavaType.STRING)); // Create a representation of the desired output ITD itdTypeDetails = builder.build();/*from ww w . j a va 2s .com*/ }
From source file:org.gvnix.addon.gva.security.providers.safe.SafeSecurityProviderLoginMetadata.java
public SafeSecurityProviderLoginMetadata(String identifier, JavaType aspectName, PhysicalTypeMetadata governorPhysicalTypeMetadata) { super(identifier, aspectName, governorPhysicalTypeMetadata); /*//from w ww . j a v a 2 s . c om * Validate.isTrue(isValid(identifier), * "Metadata identification string '" + identifier + * "' does not appear to be a valid"); */ // Helper itd generation this.helper = new ItdBuilderHelper(this, governorPhysicalTypeMetadata, builder.getImportRegistrationResolver()); // Adding Field annotations List<AnnotationMetadataBuilder> safeAppletLocationAnnotations = new ArrayList<AnnotationMetadataBuilder>(); AnnotationMetadataBuilder valueAnnotation = new AnnotationMetadataBuilder(SpringJavaType.VALUE); valueAnnotation.addStringAttribute("value", "${security.SAFE.applet.location}"); safeAppletLocationAnnotations.add(valueAnnotation); // Adding field builder.addField( getField("safeAppletLocation", JAVA_TYPE_STRING, Modifier.PRIVATE, safeAppletLocationAnnotations)); // Creating methods builder.addMethod(getCreateLoginMethod()); // Create a representation of the desired output ITD itdTypeDetails = builder.build(); }
From source file:org.gvnix.addon.gva.security.providers.safe.SafeSecurityProviderUserAuthorityMetadata.java
public SafeSecurityProviderUserAuthorityMetadata(String identifier, JavaType aspectName, PhysicalTypeMetadata governorPhysicalTypeMetadata) { super(identifier, aspectName, governorPhysicalTypeMetadata); /*Validate.isTrue(isValid(identifier), "Metadata identification string '" + identifier + "' does not appear to be a valid");*/ // Helper itd generation this.helper = new ItdBuilderHelper(this, governorPhysicalTypeMetadata, builder.getImportRegistrationResolver()); // Adding Fields builder.addField(getField("serialVersionUID", "-2443806778851127910L", JavaType.LONG_PRIMITIVE, Modifier.PRIVATE + Modifier.STATIC + Modifier.FINAL)); builder.addField(getField("authority", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); // User Details builder.addField(getField("nif", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); builder.addField(getField("usrtipo", null, JAVA_TYPE_STRING, Modifier.PRIVATE)); builder.addField(getField("idgrupo", null, JAVA_TYPE_STRING, Modifier.PUBLIC)); builder.addField(getField("idrol", null, JAVA_TYPE_STRING, Modifier.PUBLIC)); builder.addField(getField("idaplicacion", null, JAVA_TYPE_STRING, Modifier.PUBLIC)); // Creating getters and setters builder.addMethod(getGetterMethod("authority", JavaType.STRING)); builder.addMethod(getSetterMethod("authority", JavaType.STRING)); builder.addMethod(getGetterMethod("nif", JavaType.STRING)); builder.addMethod(getSetterMethod("nif", JavaType.STRING)); builder.addMethod(getGetterMethod("usrtipo", JavaType.STRING)); builder.addMethod(getSetterMethod("usrtipo", JavaType.STRING)); builder.addMethod(getGetterMethod("idgrupo", JavaType.STRING)); builder.addMethod(getSetterMethod("idgrupo", JavaType.STRING)); builder.addMethod(getGetterMethod("idrol", JavaType.STRING)); builder.addMethod(getSetterMethod("idrol", JavaType.STRING)); builder.addMethod(getGetterMethod("idaplicacion", JavaType.STRING)); builder.addMethod(getSetterMethod("idaplicacion", JavaType.STRING)); // Creating methods builder.addMethod(getHashCodeMethod()); builder.addMethod(getEqualsMethod()); // Create a representation of the desired output ITD itdTypeDetails = builder.build();/*from w ww . j av a 2 s. c o m*/ }
From source file:org.gvnix.addon.gva.security.providers.safe.SafeSecurityProviderPasswordMetadata.java
public SafeSecurityProviderPasswordMetadata(String identifier, JavaType aspectName, PhysicalTypeMetadata governorPhysicalTypeMetadata) { super(identifier, aspectName, governorPhysicalTypeMetadata); /*Validate.isTrue(isValid(identifier), "Metadata identification string '" + identifier + "' does not appear to be a valid");*/ // Helper itd generation this.helper = new ItdBuilderHelper(this, governorPhysicalTypeMetadata, builder.getImportRegistrationResolver()); // Adding Fields builder.addField(getField(PASSWORD, JAVA_TYPE_STRING, Modifier.PRIVATE)); // Creating methods builder.addMethod(getHandleMethod()); builder.addMethod(getSetterMethod(PASSWORD, JAVA_TYPE_STRING)); // Create a representation of the desired output ITD itdTypeDetails = builder.build();/*from w ww .j ava 2 s. co m*/ }