BrightSide Workbench Full Report + Source Code
org.turro.publishing.Publishing< E > Class Template Reference
Inheritance diagram for org.turro.publishing.Publishing< E >:
Collaboration diagram for org.turro.publishing.Publishing< E >:

Public Member Functions

String getEntityRoot ()
 
boolean hasContext (String context)
 
PublishingContext getContext (String context)
 
boolean checkEntity (String context, E entity)
 

Static Public Member Functions

static< T extends Publishing > Publishing getPublishing (Class< T > javaClass, String root)
 
static< T extends Publishing > PublishingContext getPublishingContext (Class< T > javaClass, String root, String context)
 

Protected Member Functions

boolean checkEntity (PublishingContext pc, E entity)
 

Static Protected Member Functions

static< T extends Publishing > Publishing doLoad (Class< T > javaClass, String publishingFile)
 

Detailed Description

Author
Lluis TurrĂ³ Cutiller lluis.nosp@m.@tur.nosp@m.ro.or.nosp@m.g

Definition at line 37 of file Publishing.java.

Member Function Documentation

◆ checkEntity() [1/2]

boolean org.turro.publishing.Publishing< E >.checkEntity ( PublishingContext  pc,
entity 
)
protected

Definition at line 59 of file Publishing.java.

59  {
60  return false;
61  }

◆ checkEntity() [2/2]

boolean org.turro.publishing.Publishing< E >.checkEntity ( String  context,
entity 
)

Definition at line 54 of file Publishing.java.

54  {
55  PublishingContext pc = contexts.get(context);
56  return (pc != null) ? checkEntity(pc, entity) : null;
57  }
boolean checkEntity(String context, E entity)
Definition: Publishing.java:54

◆ doLoad()

static <T extends Publishing> Publishing org.turro.publishing.Publishing< E >.doLoad ( Class< T >  javaClass,
String  publishingFile 
)
staticprotected

Definition at line 83 of file Publishing.java.

83  {
84  if(_pub.get(publishingFile) == null || FileWatch.isNewer(convert(publishingFile), _lastLoads.get(publishingFile))
85  || !FileWatch.exists(convert(publishingFile))) {
86  T pub = null;
87  try {
88  JSONSerializer ser = new JSONSerializer(true);
89  pub = ser.fromJson(FileUtil.getContent(new File(convert(publishingFile))), javaClass);
90  } catch (IOException ex) {
91  Logger.getLogger(Publishing.class.getName()).log(Level.SEVERE, ElephantContext.logMsg(null), ex);
92  }
93  if(pub != null) {
94  _pub.put(publishingFile, pub);
95  _lastLoads.put(publishingFile, FileWatch.getTime(convert(publishingFile)));
96  }
97  }
98  return _pub.get(publishingFile);
99  }
Here is the call graph for this function:
Here is the caller graph for this function:

◆ getContext()

PublishingContext org.turro.publishing.Publishing< E >.getContext ( String  context)

Definition at line 50 of file Publishing.java.

50  {
51  return contexts.get(context);
52  }
Here is the caller graph for this function:

◆ getEntityRoot()

String org.turro.publishing.Publishing< E >.getEntityRoot ( )

Definition at line 42 of file Publishing.java.

42  {
43  return entityRoot;
44  }

◆ getPublishing()

static <T extends Publishing> Publishing org.turro.publishing.Publishing< E >.getPublishing ( Class< T >  javaClass,
String  root 
)
static

Definition at line 65 of file Publishing.java.

65  {
66  return doLoad(javaClass, root);
67  }
static< T extends Publishing > Publishing doLoad(Class< T > javaClass, String publishingFile)
Definition: Publishing.java:83
Here is the call graph for this function:

◆ getPublishingContext()

static <T extends Publishing> PublishingContext org.turro.publishing.Publishing< E >.getPublishingContext ( Class< T >  javaClass,
String  root,
String  context 
)
static

Definition at line 69 of file Publishing.java.

69  {
70  Publishing publishing = doLoad(javaClass, root);
71  if(publishing != null) {
72  return publishing.getContext(context);
73  } else {
74  return null;
75  }
76  }
Here is the call graph for this function:

◆ hasContext()

boolean org.turro.publishing.Publishing< E >.hasContext ( String  context)

Definition at line 46 of file Publishing.java.

46  {
47  return contexts.containsKey(context);
48  }

The documentation for this class was generated from the following file: