Rule extends AbstractSrgsNode implements VoiceXmlNode { public boolean isPublic() { final String scope = getScope(); if (scope == null) { return false; } return scope.equalsIgnoreCase("public"); } Rule();   Rule(final Node node); private  Rule(final Node n,
            final XmlNodeFactory<? extends XmlNode> factory); String getTagName(); XmlNode newInstance(final Node n,
            final XmlNodeFactory<? extends XmlNode> factory); String getId(); void setId(final String id); String getScope(); void setScope(final String scope); void makePrivate(); void makePublic(); boolean isPublic(); Text addText(final String text); @Override Collection<String> getAttributeNames(); static final String TAG_NAME; static final String ATTRIBUTE_ID; static final String ATTRIBUTE_SCOPE; }
@Test public void testIsPublic() throws Exception { final SrgsXmlDocument document = new SrgsXmlDocument(); final Grammar grammar = document.getGrammar(); final Rule rule = grammar.appendChild(Rule.class); Assert.assertFalse(rule.isPublic()); rule.makePublic(); Assert.assertTrue(rule.isPublic()); rule.setScope("private"); Assert.assertFalse(rule.isPublic()); }