282 @Override
283 protected PolicySourceModel clone() throws CloneNotSupportedException {
284 final PolicySourceModel clone = (PolicySourceModel) super.clone();
285
286 clone.rootNode = this.rootNode.clone();
287 try {
288 clone.rootNode.setParentModel(clone);
289 } catch (IllegalAccessException e) {
290 throw LOGGER.logSevereException(new CloneNotSupportedException(LocalizationMessages.WSP_0013_UNABLE_TO_SET_PARENT_MODEL_ON_ROOT()), e);
291 }
292
293 return clone;
294 }
295
296 /**
297 * Returns a boolean value indicating whether this policy source model contains references to another policy source models.
298 * <p/>
299 * Every source model that references other policies must be expanded before it can be translated into a Policy objects. See
300 * {@link #expand(PolicySourceModelContext)} and {@link #isExpanded()} for more details.
301 *
302 * @return {@code true} or {code false} depending on whether this policy source model contains references to another policy source models.
303 */
304 public boolean containsPolicyReferences() {
305 return !references.isEmpty();
306 }
307
308 /**
309 * Returns a boolean value indicating whether this policy source model contains is already expanded (i.e. contains no unexpanded
310 * policy references) or not. This means that if model does not originally contain any policy references, it is considered as expanded,
311 * thus this method returns {@code true} in such case. Also this method does not check whether the references policy source models are expanded
312 * as well, so after expanding this model a value of {@code true} is returned even if referenced models are not expanded yet. Thus each model
313 * can be considered to be fully expanded only if all policy source models stored in PolicySourceModelContext instance are expanded, provided the
314 * PolicySourceModelContext instance contains full set of policy source models.
315 * <p/>
316 * Every source model that references other policies must be expanded before it can be translated into a Policy object. See
317 * {@link #expand(PolicySourceModelContext)} and {@link #containsPolicyReferences()} for more details.
318 *
319 * @return {@code true} or {@code false} depending on whether this policy source model contains is expanded or not.
320 */
321 private boolean isExpanded() {
322 return references.isEmpty() || expanded;
|
282 @Override
283 protected PolicySourceModel clone() throws CloneNotSupportedException {
284 final PolicySourceModel clone = (PolicySourceModel) super.clone();
285
286 clone.rootNode = this.rootNode.clone();
287 try {
288 clone.rootNode.setParentModel(clone);
289 } catch (IllegalAccessException e) {
290 throw LOGGER.logSevereException(new CloneNotSupportedException(LocalizationMessages.WSP_0013_UNABLE_TO_SET_PARENT_MODEL_ON_ROOT()), e);
291 }
292
293 return clone;
294 }
295
296 /**
297 * Returns a boolean value indicating whether this policy source model contains references to another policy source models.
298 * <p/>
299 * Every source model that references other policies must be expanded before it can be translated into a Policy objects. See
300 * {@link #expand(PolicySourceModelContext)} and {@link #isExpanded()} for more details.
301 *
302 * @return {@code true} or {@code false} depending on whether this policy source model contains references to another policy source models.
303 */
304 public boolean containsPolicyReferences() {
305 return !references.isEmpty();
306 }
307
308 /**
309 * Returns a boolean value indicating whether this policy source model contains is already expanded (i.e. contains no unexpanded
310 * policy references) or not. This means that if model does not originally contain any policy references, it is considered as expanded,
311 * thus this method returns {@code true} in such case. Also this method does not check whether the references policy source models are expanded
312 * as well, so after expanding this model a value of {@code true} is returned even if referenced models are not expanded yet. Thus each model
313 * can be considered to be fully expanded only if all policy source models stored in PolicySourceModelContext instance are expanded, provided the
314 * PolicySourceModelContext instance contains full set of policy source models.
315 * <p/>
316 * Every source model that references other policies must be expanded before it can be translated into a Policy object. See
317 * {@link #expand(PolicySourceModelContext)} and {@link #containsPolicyReferences()} for more details.
318 *
319 * @return {@code true} or {@code false} depending on whether this policy source model contains is expanded or not.
320 */
321 private boolean isExpanded() {
322 return references.isEmpty() || expanded;
|