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 {
    public 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 " <!-- " + comment.replaceAll("[-]{2,}", "-") + " -->";
            }
        }

        return null;
    }
}