@Test( expected = NullPointerException.class ) public void testGetReferencedResourcesWithoutResourceManager() { attrCore.getReferencedResources( metaData, element, null, null ); }
public ResourceReference[] getReferencedResources( final AttributeMetaData metaData, final ReportElement element, final ResourceManager resourceManager, final Object attributeValue ) { if ( element == null ) { throw new NullPointerException(); } if ( resourceManager == null ) { throw new NullPointerException(); } final String valueRole = metaData.getValueRole(); if ( "Content".equals( valueRole ) ) { final ResourceKey contentBase = getContentBase( element ); final ResourceKey elementSource = getDefinitionSource( element ); if ( attributeValue instanceof ResourceKey ) { final ResourceKey path = (ResourceKey) attributeValue; final boolean linked = BundleUtilities.isSameBundle( elementSource, path ); return new ResourceReference[] { new ResourceReference( path, linked ) }; } else if ( attributeValue instanceof String && contentBase != null ) { try { final ResourceKey path = resourceManager.deriveKey( contentBase, String.valueOf( attributeValue ) ); final boolean linked = BundleUtilities.isSameBundle( elementSource, path ) == false; return new ResourceReference[] { new ResourceReference( path, linked ) }; } catch ( ResourceKeyCreationException rce ) { } } else if ( attributeValue != null ) { try { final ResourceKey path = resourceManager.createKey( attributeValue ); final boolean linked = BundleUtilities.isSameBundle( elementSource, path ) == false; return new ResourceReference[] { new ResourceReference( path, linked ) }; } catch ( ResourceKeyCreationException rce ) { } } } return EMPTY_RESOURCES; }
DefaultAttributeCore implements AttributeCore { public ResourceReference[] getReferencedResources( final AttributeMetaData metaData, final ReportElement element, final ResourceManager resourceManager, final Object attributeValue ) { if ( element == null ) { throw new NullPointerException(); } if ( resourceManager == null ) { throw new NullPointerException(); } final String valueRole = metaData.getValueRole(); if ( "Content".equals( valueRole ) ) { final ResourceKey contentBase = getContentBase( element ); final ResourceKey elementSource = getDefinitionSource( element ); if ( attributeValue instanceof ResourceKey ) { final ResourceKey path = (ResourceKey) attributeValue; final boolean linked = BundleUtilities.isSameBundle( elementSource, path ); return new ResourceReference[] { new ResourceReference( path, linked ) }; } else if ( attributeValue instanceof String && contentBase != null ) { try { final ResourceKey path = resourceManager.deriveKey( contentBase, String.valueOf( attributeValue ) ); final boolean linked = BundleUtilities.isSameBundle( elementSource, path ) == false; return new ResourceReference[] { new ResourceReference( path, linked ) }; } catch ( ResourceKeyCreationException rce ) { } } else if ( attributeValue != null ) { try { final ResourceKey path = resourceManager.createKey( attributeValue ); final boolean linked = BundleUtilities.isSameBundle( elementSource, path ) == false; return new ResourceReference[] { new ResourceReference( path, linked ) }; } catch ( ResourceKeyCreationException rce ) { } } } return EMPTY_RESOURCES; } }
DefaultAttributeCore implements AttributeCore { public ResourceReference[] getReferencedResources( final AttributeMetaData metaData, final ReportElement element, final ResourceManager resourceManager, final Object attributeValue ) { if ( element == null ) { throw new NullPointerException(); } if ( resourceManager == null ) { throw new NullPointerException(); } final String valueRole = metaData.getValueRole(); if ( "Content".equals( valueRole ) ) { final ResourceKey contentBase = getContentBase( element ); final ResourceKey elementSource = getDefinitionSource( element ); if ( attributeValue instanceof ResourceKey ) { final ResourceKey path = (ResourceKey) attributeValue; final boolean linked = BundleUtilities.isSameBundle( elementSource, path ); return new ResourceReference[] { new ResourceReference( path, linked ) }; } else if ( attributeValue instanceof String && contentBase != null ) { try { final ResourceKey path = resourceManager.deriveKey( contentBase, String.valueOf( attributeValue ) ); final boolean linked = BundleUtilities.isSameBundle( elementSource, path ) == false; return new ResourceReference[] { new ResourceReference( path, linked ) }; } catch ( ResourceKeyCreationException rce ) { } } else if ( attributeValue != null ) { try { final ResourceKey path = resourceManager.createKey( attributeValue ); final boolean linked = BundleUtilities.isSameBundle( elementSource, path ) == false; return new ResourceReference[] { new ResourceReference( path, linked ) }; } catch ( ResourceKeyCreationException rce ) { } } } return EMPTY_RESOURCES; } DefaultAttributeCore(); }
DefaultAttributeCore implements AttributeCore { public ResourceReference[] getReferencedResources( final AttributeMetaData metaData, final ReportElement element, final ResourceManager resourceManager, final Object attributeValue ) { if ( element == null ) { throw new NullPointerException(); } if ( resourceManager == null ) { throw new NullPointerException(); } final String valueRole = metaData.getValueRole(); if ( "Content".equals( valueRole ) ) { final ResourceKey contentBase = getContentBase( element ); final ResourceKey elementSource = getDefinitionSource( element ); if ( attributeValue instanceof ResourceKey ) { final ResourceKey path = (ResourceKey) attributeValue; final boolean linked = BundleUtilities.isSameBundle( elementSource, path ); return new ResourceReference[] { new ResourceReference( path, linked ) }; } else if ( attributeValue instanceof String && contentBase != null ) { try { final ResourceKey path = resourceManager.deriveKey( contentBase, String.valueOf( attributeValue ) ); final boolean linked = BundleUtilities.isSameBundle( elementSource, path ) == false; return new ResourceReference[] { new ResourceReference( path, linked ) }; } catch ( ResourceKeyCreationException rce ) { } } else if ( attributeValue != null ) { try { final ResourceKey path = resourceManager.createKey( attributeValue ); final boolean linked = BundleUtilities.isSameBundle( elementSource, path ) == false; return new ResourceReference[] { new ResourceReference( path, linked ) }; } catch ( ResourceKeyCreationException rce ) { } } } return EMPTY_RESOURCES; } DefaultAttributeCore(); String[] getReferencedFields( final AttributeMetaData metaData, final ReportElement element,
      final Object attributeValue ); String[] getReferencedGroups( final AttributeMetaData metaData, final ReportElement element,
      final Object attributeValue ); ResourceReference[] getReferencedResources( final AttributeMetaData metaData, final ReportElement element,
      final ResourceManager resourceManager, final Object attributeValue ); String[] getExtraCalculationFields( final AttributeMetaData metaData ); }
DefaultAttributeCore implements AttributeCore { public ResourceReference[] getReferencedResources( final AttributeMetaData metaData, final ReportElement element, final ResourceManager resourceManager, final Object attributeValue ) { if ( element == null ) { throw new NullPointerException(); } if ( resourceManager == null ) { throw new NullPointerException(); } final String valueRole = metaData.getValueRole(); if ( "Content".equals( valueRole ) ) { final ResourceKey contentBase = getContentBase( element ); final ResourceKey elementSource = getDefinitionSource( element ); if ( attributeValue instanceof ResourceKey ) { final ResourceKey path = (ResourceKey) attributeValue; final boolean linked = BundleUtilities.isSameBundle( elementSource, path ); return new ResourceReference[] { new ResourceReference( path, linked ) }; } else if ( attributeValue instanceof String && contentBase != null ) { try { final ResourceKey path = resourceManager.deriveKey( contentBase, String.valueOf( attributeValue ) ); final boolean linked = BundleUtilities.isSameBundle( elementSource, path ) == false; return new ResourceReference[] { new ResourceReference( path, linked ) }; } catch ( ResourceKeyCreationException rce ) { } } else if ( attributeValue != null ) { try { final ResourceKey path = resourceManager.createKey( attributeValue ); final boolean linked = BundleUtilities.isSameBundle( elementSource, path ) == false; return new ResourceReference[] { new ResourceReference( path, linked ) }; } catch ( ResourceKeyCreationException rce ) { } } } return EMPTY_RESOURCES; } DefaultAttributeCore(); String[] getReferencedFields( final AttributeMetaData metaData, final ReportElement element,
      final Object attributeValue ); String[] getReferencedGroups( final AttributeMetaData metaData, final ReportElement element,
      final Object attributeValue ); ResourceReference[] getReferencedResources( final AttributeMetaData metaData, final ReportElement element,
      final ResourceManager resourceManager, final Object attributeValue ); String[] getExtraCalculationFields( final AttributeMetaData metaData );  }