Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
//License from project: Apache License 

import java.util.Properties;

public class Main {
    static String extractComment(String tag, Properties properties) {
        if (properties == null || "span".equals(tag)) {
            return null;
        }

        String[] attributes = new String[] { "id", "name", "class" };
        for (String a : attributes) {
            String comment = properties.getProperty(a);
            if (comment != null) {
                return "<span class=\"com\">&lt;!-- " + comment.replaceAll("[-]{2,}", "-") + " --&gt;</span>";
            }
        }

        return null;
    }
}