@@ -90,7 +90,7 @@ pub struct DocPattern {
9090 pub argument_seperator : String ,
9191}
9292
93- #[ derive( Debug , Clone , Deserialize ) ]
93+ #[ derive( Debug , Clone , Deserialize , Default ) ]
9494pub struct Rule {
9595 /// What java class(es) to match against. This takes the form of a simple prefix to a JNI path with no wildcards.
9696 ///
@@ -105,6 +105,13 @@ pub struct Rule {
105105 #[ serde( default ) ]
106106 pub include : Option < bool > ,
107107
108+ #[ serde( default ) ]
109+ pub include_private_classes : Option < bool > ,
110+ #[ serde( default ) ]
111+ pub include_private_methods : Option < bool > ,
112+ #[ serde( default ) ]
113+ pub include_private_fields : Option < bool > ,
114+
108115 #[ serde( default ) ]
109116 pub proxy : Option < bool > ,
110117
@@ -115,6 +122,10 @@ pub struct Rule {
115122#[ derive( Debug , Clone ) ]
116123pub struct ClassConfig < ' a > {
117124 pub include : bool ,
125+
126+ pub include_private_classes : bool ,
127+ pub include_private_methods : bool ,
128+ pub include_private_fields : bool ,
118129 pub proxy : bool ,
119130 pub doc_pattern : Option < & ' a DocPattern > ,
120131}
@@ -150,12 +161,7 @@ impl Config {
150161 serde_yaml:: from_str ( buffer) . map_err ( |e| io:: Error :: new ( io:: ErrorKind :: InvalidData , e) ) ?;
151162
152163 if config. rules . is_empty ( ) {
153- config. rules . push ( Rule {
154- prefix : "" . to_string ( ) ,
155- include : Some ( true ) ,
156- doc_pattern : None ,
157- proxy : None ,
158- } )
164+ config. rules . push ( Rule :: default ( ) )
159165 }
160166
161167 config. output = resolve_file ( & config. output , dir) ;
@@ -199,6 +205,9 @@ impl Config {
199205 pub fn resolve_class ( & self , class : & str ) -> ClassConfig < ' _ > {
200206 let mut res = ClassConfig {
201207 include : false ,
208+ include_private_classes : false ,
209+ include_private_methods : false ,
210+ include_private_fields : false ,
202211 proxy : false ,
203212 doc_pattern : None ,
204213 } ;
@@ -208,6 +217,15 @@ impl Config {
208217 if let Some ( include) = r. include {
209218 res. include = include;
210219 }
220+ if let Some ( include_private_classes) = r. include_private_classes {
221+ res. include_private_classes = include_private_classes;
222+ }
223+ if let Some ( include_private_methods) = r. include_private_methods {
224+ res. include_private_methods = include_private_methods;
225+ }
226+ if let Some ( include_private_fields) = r. include_private_fields {
227+ res. include_private_fields = include_private_fields;
228+ }
211229 if let Some ( proxy) = r. proxy {
212230 res. proxy = proxy;
213231 }
0 commit comments