Index: main/java/org/exolab/castor/builder/MemberFactory.java =================================================================== --- main/java/org/exolab/castor/builder/MemberFactory.java (Revision 6464) +++ main/java/org/exolab/castor/builder/MemberFactory.java (Arbeitskopie) @@ -433,6 +433,11 @@ if (component.getValidator() != null) { fieldInfo.setValidator(component.getValidator()); } + + if (component.getVisiblity() != null) { + String visibility = component.getVisiblity(); + fieldInfo.setVisibility(visibility); + } return fieldInfo; } Index: main/java/org/exolab/castor/builder/FieldInfo.java =================================================================== --- main/java/org/exolab/castor/builder/FieldInfo.java (Revision 6464) +++ main/java/org/exolab/castor/builder/FieldInfo.java (Arbeitskopie) @@ -127,6 +127,8 @@ private boolean _nillable = false; /** The fully qualified name of the Validator (if any) to use in the generated descriptor. */ private String _validator; + /** Visibility of this FieldInfo */ + private String _visibility = "private"; /** * Creates a new FieldInfo with the given XML Schema type and the given @@ -165,6 +167,15 @@ modifiers.setFinal(_final); modifiers.setStatic(_static); } + + if (!(_visibility.equals("private"))) { + JModifiers modifiers = field.getModifiers(); + if (_visibility.equals("protected")) { + modifiers.makeProtected(); + } else if (_visibility.equals("public")) { + modifiers.makePublic(); + } + } //-- set init String if (_default != null) { @@ -847,4 +858,14 @@ return JavaNaming.toJavaClassName(_name); } + /** + * Sets the visibility of this FieldInfo. + * + * @param visiblity the visibility of this FieldInfo + */ + public void setVisibility(String visibility) { + _visibility = visibility; + + } + } //-- FieldInfo Index: main/java/org/exolab/castor/builder/binding/XMLBindingComponent.java =================================================================== --- main/java/org/exolab/castor/builder/binding/XMLBindingComponent.java (Revision 6464) +++ main/java/org/exolab/castor/builder/binding/XMLBindingComponent.java (Arbeitskopie) @@ -1279,6 +1279,18 @@ } /** + * Returns the visibility of the Java member to generate. + * + * @return the visibility of the Java member to generate. + */ + public String getVisiblity() { + if (_type == MEMBER) { + return _member.getVisibility().toString(); + } + return null; + } + + /** * Returns the type of this component binding. A component binding can be of * three different types: *